Solved

Saving on a drawn on control

Posted on 2004-10-10
3
187 Views
Last Modified: 2012-05-05
Ok I have a control that I draw ontop of by overriding the paint method now I want to save a bmp or jpg of the control with the edits ontop of it. Whenever I use the graphics save method though I get either one layer (the original image) or the edits (my draw changes).

How can I save both layers to one images?
0
Comment
Question by:toby_lang
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 11

Accepted Solution

by:
Agarici earned 125 total points
ID: 12274580
try something like this:

private void OnPaint(object sender, System.Windows.Forms.PaintEventArgs e)
{
   MyDrawChanges( e.Graphics );
}

private void MyDrawChanges( Graphics g )
{
// do your edits here
}

// and save all your drawing like this
public void Save(string FileName)
{
 Btimap bmp = new Bitmap(YourOriginalImage);
 Graphics g = Graphics.FromImage(bmp);
 MyDrawChanges( g );
 
 bmp.Save(FileName);  
}


hth,
A.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question