Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Saving on a drawn on control

Posted on 2004-10-10
3
Medium Priority
?
190 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 500 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

721 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