Hi All,
I am working on a C# web application. I need to select/highlight some area on an image on focus of a textbox, and then de-select the area when the focus is lost. I have been able to do so on click of a button, by using bitmap and Graphics object. But I cant do the same on textbox onfocus event.
I had used the following code written inside a static server side function :
Bitmap bmp = (Bitmap)Bitmap.FromFile("~/Images/SampleDoc.jpg");
Graphics g = Graphics.FromImage(bmp);
Pen snowPen = new Pen(Color.Blue, 2);
g.DrawRectangle(snowPen, 600, 225, 100, 30);
String path = Server.MapPath("~/Images/DrawRectangle.jpg");
bmp.Save(path, ImageFormat.Jpeg);
Image1.ImageUrl = "~/Images/DrawRectangle.jpg";
g.Dispose();
bmp.Dispose();
and called it using a javascipt function.
I tried using the code above for a textbox focus too but I wasn't able to access the Server object and Image1 object.
I am pretty new to asp.net and javascript. Any help will be much appreciated.
Thanks in advance.
Gitika Khurana