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

x
?
Solved

Print a already existing Graphics object

Posted on 2004-08-15
3
Medium Priority
?
225 Views
Last Modified: 2008-02-26
Hello

I have previously created a Graphics object and I would like to print it.

The problem is the PrintPage handler is passed a Graphics in the EventArgs and that's what's used.

I am trying to do something like this
private void pd_PrintPage(object sender, PrintPageEventArgs ev)
{
  ev.Graphics = g;  //Where g is the graphics I have already saved.  But ev.Graphics is read only...
}

Is there a way to do what I am asking?

Regards,
NTAC
0
Comment
Question by:NTAC
[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
  • 2
3 Comments
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11804772
write to a bitmap in a memory stream ... then draw the bitmap object in e.Graphics

0
 
LVL 4

Author Comment

by:NTAC
ID: 11805468
Greg can you post an example of writing to a bitmap in a memory stream?  

I looked up the Bitmap class, and there is a Bitmap(stream) constructor, but I'm not sure how to get my Graphics g into a stream.

Regards,
NTAC
0
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 1400 total points
ID: 11805754
from looking at another question where you detail why you wanted to do this ...

"as for your graphics question I believe this gets done for you as well (it just reuses the graphics object 4 times) it won't ask you to draw it for each of the 4 copies (they are copies I mean why would it ask 4 times)

theres alot of detailed info here http://samples.gotdotnet.com/quickstart/winforms/doc/WinFormsPrinting.aspx"

0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
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…

722 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