Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
![]() |
•
•
Join Date: Dec 2007
Posts: 84
Reputation:
Rep Power: 2
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,075
Reputation:
Rep Power: 4
Solved Threads: 62
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.
--------------------------- | | | | |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
Other Threads in the ASP.NET Forum
- 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
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Linear Mode