我們正在使用System.Drawing.Graphics.Drawstring
在圖像中寫入文本。下面的代碼顯示在asp.net中獲取圖形的單擊事件
Bitmap bitMapImage = new System.Drawing.Bitmap(@"D:\ABC\Chart1.png");
Graphics graphicImage = Graphics.FromImage(bitMapImage);
//Smooth graphics is nice.
graphicImage.SmoothingMode = SmoothingMode.AntiAlias;
String drawString = "250";
Font drawFont = new Font("Arial", 12,FontStyle.Bold);
SolidBrush drawBrush = new SolidBrush(Color.White);
PointF drawPoint= new PointF(169.0F, 85.0F); .
graphicImage.DrawString(drawString, drawFont, drawBrush, drawPoint);
//Set the content type
Response.ContentType = "image/jpeg";
//Save the new image to the response output stream.
bitMapImage.Save(Response.OutputStream, ImageFormat.Jpeg);
//Clean house.
graphicImage.Dispose();
bitMapImage.Dispose();
的代碼需要一個鏡像文件,並寫入字符串(這裏:250),當用戶點擊250。現在,新的窗口應該拿開。
不知道如何獲得250的點擊事件?
請幫忙!謝謝