Re: Simple printing and graphics
- From: "Kevin Spencer" <uce@xxxxxxx>
- Date: Thu, 6 Jul 2006 17:57:57 -0400
I'm still confused. The objects should draw themselves when they need to.
This is essentially what the Control.Paint method does. So, you don't store
images; you store the data that defines what the images are to be drawn. You
could store the images too, but that would be counter-productive in most
situations. You only need them when you need them. As for "Graphics," I'm
not sure you're talking about images or the Graphics class. If you're
talking about the Graphics class, as I said, it is provided in the Print
event handler (just like in the Paint event handler). You also have to
handle transparency and Z-Levels.
--
HTH,
Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist
Big thicks are made up of lots of little thins.
"Chris Dunaway" <dunawayc@xxxxxxxxx> wrote in message
news:1152214250.531207.208600@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Kevin Spencer wrote:
I'm confused. You say you want "sugggestions on how to implement the
rendering of each page." This would refer, I presume to "printing each
I'm sorry for the confusion, I guess my intent is not clear. I want to
wrap the .Net printing method into a simpler class. I understand how
the HasMorePages and the event model of the .Net PrintDocument classes
work. I want to create a class that wraps that functionality up into
an easy to use class. For example of what I am trying to do,
originally in the .Net 2.0 Beta there was a class called
SimplePrintDocument but it was not included in the final release. Here
is a link that describes that class:
http://wesnerm.blogs.com/net_undocumented/2004/05/easier_printing.html
I want to create a class similar to that which encapsulates the
complexity of the .Net net printing method.
My idea was to create a simple class called say, EasyPrintDocument.
That class would have a pages collection Using that class would follow
the pattern below:
EasyPrintDocument epd = new EasyPrintDocument();
EasyPrintPage page = epd.AddPage();
page.DrawText("Blah Blah", 100. 40); //draws text at location 100,
40 on this page.
page.DrawCircle(50, 50, 10); //draws circle of radius 10 at location
50, 50 on this page.
Once the user has added all the pages they need the document, they
would call a method on my class to acutally kick off the printing
process:
epd.PrintIt();
Behind the scenes, this would use the normal .Net printing methodology,
including the HasMorePages.
I want to *hide* that complexity in an easy to use class.
My question was, specifically, how to store the page images until the
user calls the PrintIt method of my class. In other words, can I
create a collection of Graphics objects, for example, and then use them
when it comes time to print my pages? How can I create a Graphics
object with the same dimensions of the printer?
I hope I have explained better what I want.
Thanks again for taking time to respond.
.
- Follow-Ups:
- Re: Simple printing and graphics
- From: Chris Dunaway
- Re: Simple printing and graphics
- References:
- Simple printing and graphics
- From: Chris Dunaway
- Re: Simple printing and graphics
- From: Kevin Spencer
- Re: Simple printing and graphics
- From: Chris Dunaway
- Re: Simple printing and graphics
- From: Kevin Spencer
- Re: Simple printing and graphics
- From: Chris Dunaway
- Simple printing and graphics
- Prev by Date: Re: How does "new" work in a loop?
- Next by Date: building c# with ant or nant
- Previous by thread: Re: Simple printing and graphics
- Next by thread: Re: Simple printing and graphics
- Index(es):
Relevant Pages
|