Click here to Skip to main content
15,921,452 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a picturebox control in which by using mouse down and mouse move events ,I am drawing a image using points and storing it in my database. and in update mode I am retrieving the bytes and drawing an image in to the picture box control and now I am adding few lines more on the image but either I am getting newly added lines or the old image but i want both

//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 is my byte array of my image
gxComp.DrawLines(pen, _currentStroke.ToArray());

_currentStroke is the list of points.

1 solution

Creating the grahics of image and drawing lines on to that graphics object has solved my problem.

//Ref with above Code
//Creating the graphics of the image if exists



//writing my new drawn points on to the graphics

gxComp.DrawLines(pen, _currentStroke.ToArray());
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900