2013-08-29 101 views
0

我有一个图片框控件,通过使用鼠标向下和鼠标移动事件,我使用点绘制图像并将其存储在我的数据库中。 和在更新模式中我检索字节并绘制图像到图片框控件中,现在我在图片上添加了更多行,但要么是新添加的行或旧图片,但我希望两者都是DrawLines在使用图形在紧凑框架中的图像

//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的字节数组点的名单。

回答

0

在图形对象上创建图像和绘制线的渐变已解决了我的问题。

  //Ref with above Code 

//创建图像的图形是否存在

 gxcomp=Graphics.FromImage(im); 

和 //写上我的新绘制点到图形

 gxComp.DrawLines(pen, _currentStroke.ToArray());