TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Alex Brown
NA
10
0
Text on image - watermark - font size
May 22 2008 5:07 PM
I have images, that are stored in sql server.
One of the images is retrieved, into a memory stream, then returned as an Image object.
I then have a method called addWatermark(string text, Image img)
Graphics g = Graphics.FromImage(image);
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
g.DrawString(text, new Font("Tahoma",fontSize), Brushes.White, new PointF(0, 0));
i want the text to take up around 70% of the width of the image... im trying to calculate the value fontSize
the image thats passed in could be any size.... not always the same size.
Basically, i need to calculate the max font size, then reduce it by 30% i guess.
any ideas?
Reply
Answers (
2
)
Need Your Help in Improving the Speed of Graphics while Drawing Lines on Picturebox with Image
Drag And Drop lines