Last post May 28, 2007 03:53 PM by Slam
May 11, 2007 09:58 AM|JsonTerre1|LINK
I have an image which i want to add different lines of text to.
Each line of text has to be possitioned in a different part of the image.
I then want to allow the user to print that image without seeing it. So they can't copy it and photoshop it. *** If this is possible.
I do not need to store the image at all. In fact i would rather not. Although if i have to then i could store it and then delete it afterward.
May 11, 2007 11:35 AM|Trebolin|LINK
Take a look at this watermark function and see if it helps:
public static Bitmap AddWatermark(Bitmap Bitmap, string WatermarkText, Color TextColor, int OpacityPercent, string FontFamily, FontStyle FontStyle, int MaxFontSize)
int opacity = (int)((255.0f * OpacityPercent) / 100.0f);
gr = Graphics.FromImage(Bitmap);
Bitmap bmpNew = new Bitmap(Bitmap.Width, Bitmap.Height);
gr = Graphics.FromImage(bmpNew);
gr.DrawImage(Bitmap, new Rectangle(0, 0, bmpNew.Width, bmpNew.Height), 0, 0, Bitmap.Width, Bitmap.Height, GraphicsUnit.Pixel);
Bitmap = bmpNew;
using (Brush semiTransparentBrush = new SolidBrush(Color.FromArgb(opacity, TextColor)))
gr.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
gr.DrawString(WatermarkText, font, semiTransparentBrush, new Point(0, 0), stringFormat);
May 23, 2007 10:26 AM|macal_vm|LINK
i have a gif image.
how do I do it?
I didint understand much
May 24, 2007 08:51 AM|macal_vm|LINK
I want to know how do I write text over an existing *.jpg image. Its something like this:
I have the same image in 4 different colours indicating the current state of this "car". But I also want to write over the image the number of the cars (1 to 26).
Is this possible?
May 25, 2007 01:17 PM|Trebolin|LINK
You can load the the jpg or gif image into a Bitmap object like this:
Bitmap obj = new Bitmap(pathtotheimage);
And then use the code that I pasted before.
May 26, 2007 12:02 PM|Slam|LINK
Could you please give a hint how to draw a different color border around each letter of the watermark text?
May 28, 2007 07:53 AM|macal_vm|LINK
i got some errors that concerns to the library u used.
what should I import?
May 28, 2007 03:53 PM|Slam|LINK
You need to import System.Drawing and System.Drawing.Drawing2D namespaces