[Ask] Insert into SQL from merge Picturebox and Grapich


Nov 20, 2011
I have 1 image and i draw some lines on the image. i want to insert this picture with the lines to SQL..how i can combine 2 different object become one, and insert to SQL??


Jul 1, 2005
UK North East
Hi Anin,

Firstly you're going to want to store the image into an image field, probably using something like this...

The image should be pristine, any drawn lines not affecting the image itself - you may want to put a transparent canvas over the top of the image to catch any clicks and draw the lines onto this.

Then you're going to want to save start and end points that were clicked by the user for each line into an array and then transfer this array into the database.

When the image is recalled from the database you'll then need to re-render the lines on.

Alternatively you could simply save the second canvas as an image also, but this doesn't give you any editing facility - at least with the previous method you could click near one of the previously rendered points and allow it to be moved (for example).

I'm no GDI programmer, though, but this is more of a design issue than a GDI question.

Kind regards,
Top Bottom