| | |
add watermark in image
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2007
Posts: 84
Reputation:
Solved Threads: 4
Its fine working.Thanks.I have one more doubt regarding watermark text size.I have same size images.In one image,watermark text is large font.In another one image small font size.I want watermark text as standard format,size and also according to image size.
below code for text size.
SizeF textSize = graphic.MeasureString(watermark, myFont);
int x =100;
int y= 100;
PointF pointF = new PointF(x, y);
graphic.DrawString(watermark, myFont, brush, pointF);
x += Convert.ToInt32(textSize.Width);
y += Convert.ToInt32(textSize.Height);
If u want please verify my earlier attachment.
below code for text size.
SizeF textSize = graphic.MeasureString(watermark, myFont);
int x =100;
int y= 100;
PointF pointF = new PointF(x, y);
graphic.DrawString(watermark, myFont, brush, pointF);
x += Convert.ToInt32(textSize.Width);
y += Convert.ToInt32(textSize.Height);
If u want please verify my earlier attachment.
•
•
Join Date: Sep 2007
Posts: 1,080
Reputation:
Solved Threads: 68
You need to set the font size depending on the size of the image. Now how long is your watermark, and how far across the image do you want it to be? In my example, it is set at 70% of the image's size. So if this was my images' size: Therefore, if you wish your watermark to be 70% of the picture width, you need to divide your pictures width by the ratio.
Look at my earlier example. It is always set to 75% of the picture. So if the picture is 6000 pixels in width, my text will always take up 4500 pixels. If it is only 100 pixels in width, it will take up 75 pixels.
ASP.NET Syntax (Toggle Plain Text)
--------------------------- | | | | |WaterMarkText 70% | | | |Water Mark 50% | ---------------------------
Look at my earlier example. It is always set to 75% of the picture. So if the picture is 6000 pixels in width, my text will always take up 4500 pixels. If it is only 100 pixels in width, it will take up 75 pixels.
Last edited by SheSaidImaPregy; Jan 29th, 2008 at 10:47 am.
![]() |
Similar Threads
- Program to convert video to Flash AND watermark it? (Graphics and Multimedia)
- Auto replace hotlinked Image Javascript? (JavaScript / DHTML / AJAX)
- Java Applet [Move Image] (Java)
- DIV Help! (HTML and CSS)
Other Threads in the ASP.NET Forum
- Previous Thread: how to design a website
- Next Thread: Application Variables
| Thread Tools | Search this Thread |
.net 2.0 activexcontrol ajax alltypeofvideos appliances application asp asp.net bc30451 beginner bottomasp.net box browser button c# cac checkbox commonfunctions control dataaccesslayer database datagridview datagridviewcheckbox datalist deployment development dgv dialog dropdownlist dynamic dynamically edit embeddingactivexcontrol expose feedback fileuploader fill findcontrol flash form formatdecimal formview google gridview gudi iis image javascript listbox login microsoft mobile mouse mssql news novell numerical opera panelmasterpagebuttoncontrols parent radio redirect registration relationaldatabases reportemail save schoolproject search security select sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 ssl suse textbox tracking treeview unauthorized validatedate validation vb.net video videos view vista visualstudio web webapplications webdevelopemnt webdevelopment webprogramming webservice xsl youareanotmemberofthedebuggerusers






