Last post Oct 13, 2008 09:35 AM by The_RaynMan
Oct 13, 2008 09:35 AM|The_RaynMan|LINK
http://forums.asp.net/t/1330800.aspx. I thought that I put this post in the System.Drawing.GDI+ forum, but it was in Client Side Web Development. I apologize for the cross post. I'm trying this again, because I still need help with this.
I have a web site with a static image on it. I need to allow the user to draw freehand on top of this image. To explain what I'm trying to do, picture an image that has four images of a silhouette of a car. The left, right, front and back. The user will
draw with the mouse on the image where the car was damaged. This drawing will be tied to the customer in the database.
I have two versions of this part completed.
For the first version I have a page (opens as a popup window) with the static image set as the background of the page. The user can draw on the page with the mouse. The problem with this version is, I don't know how to store the newly drawn image the user
just created with a transparent background. If I could store it with a transparent background, I still need to find a way to put this image on top of the static image I have. Another option (although, I don't know how to do it) is to somehow capture the exactly
what the user sees, a drawing on top of an image, kind of like copy/paste.
The second version I have set up as web service with a dynamically created canvas. I have this set up so that the user can draw on this image as well. The problem I'm having with this version is somewhat similar to the first. I can't capture the background
image, only the drawing. I got somewhat closer to getting this to work on the second version. I can change the background color of the canvas and actually store this drawing with the background color. But, I can't set the background image, only the color.
Here is the code I used to change the background color:
new Rectangle(0, 0, bmp.Width, bmp.Height));
Doing this, the user sees the orange background and I can save with the orange background as well.
I later put the following code to try to make the the bmp transparent. This doesn't work. It makes the canvas a dark gray so you can't see the background image.
Any help on this would be greatly appreciated. I have been working on this for what seems like forever. I was told that 3rd party controls are out of the question. Even SilverLight is out of the question. I have to do all of this within the 2.0
framework. However, even though it would take an act of congress to get a 3rd party tool accepted, I'm willing to look into it. A drawing tool won't do it though. I've seen several of these, but I don't have an issue with drawing. I have an issue
with saving the drawing and the background.
Thank you very much.