NTAC
asked on
Print a already existing Graphics object
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
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
write to a bitmap in a memory stream ... then draw the bitmap object in e.Graphics
ASKER
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.