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
Gage BrodyPosted May 13, 2014, 2:56 AM
If you mean by that you want to give the user the ability to specify the location of text before drawing it, you can do this using Annotations objects.
The user can load the image, add the text annotation object on it, change its location and then draw (burn) the text object on the image, so that the text becomes part of image's pixel data.
We used in one of our internal-use application a similar feature from a commercial toolkit- leadtools.
If you are interested, you can find more information on their website.
Selva GanapathyPosted Mar 12, 2014, 12:25 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
Ramya PPosted Mar 7, 2014, 7:42 AM
can you pls check my app and how to write the code for writing text on image..
thank you...
Abhijit PatilPosted Mar 7, 2014, 7:36 AM
can you post error here then i tell u what is problem in your co
Ramya PPosted Mar 7, 2014, 7:34 AM
Abhijit PatilPosted Mar 7, 2014, 7:25 AM
try this code
Ramya PPosted Mar 7, 2014, 7:21 AM
Ramya PPosted Mar 7, 2014, 6:59 AM
otherwise can you send a sample app for it...
Abhijit PatilPosted Mar 7, 2014, 5:43 AM
hey ramya,
There are basically 6 steps for my sample: