hi im doing an app which is write text or draw something on the image, can you help me how can i write the code im trying many ways but im not getting the correct code i need dynamically write something on image...
pls any one can help me....
Loading
Selva GanapathyPosted Mar 12, 2014, 12:27 AM
No need to add any library. Can you please share the error message? Or more details refer my blog
http://www.c-sharpcorner.com/Blogs/13621/getting-cursor-position-and-showing-it-in-taskbar-without-oc.aspx
Regards,
Selva Ganapathy K
Dharani dharanPosted Mar 11, 2014, 8:10 AM
Please refer this above url. It works fine.
Ramya PPosted Mar 11, 2014, 6:00 AM
is there any library to add my application...
Selva GanapathyPosted Mar 11, 2014, 4:53 AM
It seems you are trying to have a text into an image. if you need to do like this please use the following code snippet to achieve the same
var xValue = "Tamil valga! Tamil Valarga!!"+ Cursor.Position.X .ToString(); // Get the Value of text
var taskIcon = new Bitmap(100, 100); // Get a bitmap
var font = new Font("TimesNewRoman", 27, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel); // Get a font
var graphics = Graphics.FromImage(taskIcon); // Get a graphics with the bitmap image
graphics.DrawString(xValue, font, Brushes.Red, new PointF(0, 0)); // Add the text value in the graphics
graphics.SmoothingMode = SmoothingMode.AntiAlias; // Smoothing the pixel
graphics.TextRenderingHint = TextRenderingHint.AntiAlias; // Smoothing the text rendering because stem width may differ
The similar this I have used in one of my article which is as follows.
[Blog Link]
http://www.c-sharpcorner.com/Blogs/13621/getting-cursor-position-and-showing-it-in-taskbar-without-oc.aspx
Regards,
Selva Ganapathy K