[英]DrawLines over Image using graphics in compact framework
我有一个picturebox控件,其中通过使用鼠标按下和鼠标移动事件,我使用点绘制图像并将其存储在数据库中。 在更新模式下,我正在获取字节并将图像绘制到图片框控件中,现在我在图像上添加了几行,但是我正在获取新添加的行或旧图像,但是我都希望
//rect is my picture box
Bitmap bmp = new Bitmap(rect.Width, rect.Height);
// Create compatible graphics
Graphics gxComp = Graphics.FromImage(bmp);
//If i have a image
System.IO.MemoryStream memStream = new System.IO.MemoryStream(TmpSign);
Bitmap im = new Bitmap(memStream);
Tmp是我图像的字节数组
gxComp.DrawLines(pen, _currentStroke.ToArray());
_currentStroke是点列表。
在该图形对象上创建图像和绘制线条的图形已解决了我的问题。
//Ref with above Code
//创建图像的图形(如果存在)
gxcomp=Graphics.FromImage(im);
然后//将新绘制的点写到图形上
gxComp.DrawLines(pen, _currentStroke.ToArray());
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.