0

I have a panel with a background image set that I want to be able to draw on and save changes as an image file. I managed to complete the painting part with 'panel1.CreateGraphics', however this does not allow you to save whatever you've painted on top of the image (if you minimize the windows the paintings disappear).

How can I paint on the panel (and its bkground image) and then save changes?

Note: I have asked a couple of similar questions with no definitive answers as I don't think people have grasped what I'm trying to achieve.

LarsTech
  • 80,625
  • 14
  • 153
  • 225
ajm
  • 101
  • 2
  • 3
  • 15
  • Did you try to use the `Bitmap` class with a `PictureBox`? – Jeroen van Langen Apr 06 '14 at 10:55
  • Yes that was my first attempt, but I need to use a panel now although ti shouldn't really make a different. Its just getting the paint to apply itself to the panel within a bitmap – ajm Apr 06 '14 at 11:08
  • You can't use CreateGraphics(). Paint on the BackgroundImage instead with Graphics.FromImage(). Call the Panel's Invalidate() method when you're done painting so the user can see it. – Hans Passant Apr 06 '14 at 12:01
  • Graphics.FromImage isn't a method of 'panel' ? – ajm Apr 06 '14 at 12:23
  • possible duplicate of [C# Save modified image in panel](http://stackoverflow.com/questions/22843369/c-sharp-save-modified-image-in-panel) – LarsTech Apr 08 '14 at 15:39

0 Answers0