Re: large bitmaps for printing (GDI+)
From: semhelp (semhelp_at_discussions.microsoft.com)
Date: 01/11/05
- Next message: sean.slavin_at_wonderware.com: "Re: problems with flips/rotations of certain shapes"
- Previous message: marko v via DotNetMonster.com: "scrolling map"
- In reply to: Bob Powell [MVP]: "Re: large bitmaps for printing (GDI+)"
- Next in thread: alejandro lapeyre: "Re: large bitmaps for printing (GDI+)"
- Reply: alejandro lapeyre: "Re: large bitmaps for printing (GDI+)"
- Reply: Bob Powell [MVP]: "Re: large bitmaps for printing (GDI+)"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 11 Jan 2005 14:17:05 -0800
Thanks for the response--but I have a couple of questions:
I'm not 'loading' an image from disk. I allocate a 16bpp bitmap and then
draw to it. Are you saying that at some point, it is stored at 32bpp
internally?
To generalize my original question a little--How do you print a CAD drawing
to postscript plotters (large page size) at good resolution without using
many gigs of memory?
I'm trying to print a bitmap image because there appears to be problem when
sending metafile data with transparency to postscript printers. I have
shapes drawn with different hatch brushes on different layers. If I use the
standard printing approach (drawing to e.graphics in the printdocument
routine) the transparency doesn't work. Microsoft has documented this issue
and recommends printing as an bitmap image.
So I'm drawing to a bitmap and then using e.graphics.drawimageunscaled in
the printdocument routine to print. As you point out, this uses a lot of
memory as the bitmaps get larger.
Will it help if I draw 1/4th of the image to a quarter size bitmap and then
call e.graphics.drawimageunscaled to draw the image in the upper left corner
and then draw another 1/4th of the image to the bitmap and call
e.graphics.drawimageunscaled to draw the image in the upper right corner,
etc. This way, I'm not allocating as large of a bitmap, but I'm not sure
about how the printing object allocates memory.
I don't have the luxury of a many gigibyte machine either--I just want a
good resolution plot. Any ideas?
"Bob Powell [MVP]" wrote:
> An image of this size is 1.6 gigabytes in size. There is no way to use such
> an image in a compressed form. When images are loaded they are expanded to
> their full 32 bpp size when they are first used.
>
> You'd need a machine with at least 3 gigs of hard memory on board to even
> think about printing this. 5 might be better.
>
> AFAIK there are no numerical limits other than the size of the integer
> values for the dimensions of a bitmap. the problems soon arise however when
> bitmap size approaches available memory size.
>
> I've never had the luxury of an n gigabyte computer system to test such
> things.
>
> --
> Bob Powell [MVP]
> Visual C#, System.Drawing
>
> Find great Windows Forms articles in Windows Forms Tips and Tricks
> http://www.bobpowell.net/tipstricks.htm
>
> Answer those GDI+ questions with the GDI+ FAQ
> http://www.bobpowell.net/faqmain.htm
>
> All new articles provide code in C# and VB.NET.
> Subscribe to the RSS feeds provided and never miss a new article.
>
>
>
>
>
> "semhelp" <semhelp@discussions.microsoft.com> wrote in message
> news:8323693A-1FE9-41E2-A67E-7DE5E8D0F56E@microsoft.com...
> >I need to draw a bitmap from CAD data and then print it in color (at least
> >16
> > bits) at 600DPI to a large page. The resulting bitmap can be as large as
> > 20000 x 20000 pixels. What is the best way to work with these large
> > images?
> > Is there some way to work with them in a compressed format? If you have
> > an
> > image in .png format, can you draw to it with standard graphics methods
> > while
> > the image is still compressed?
> >
>
>
>
- Next message: sean.slavin_at_wonderware.com: "Re: problems with flips/rotations of certain shapes"
- Previous message: marko v via DotNetMonster.com: "scrolling map"
- In reply to: Bob Powell [MVP]: "Re: large bitmaps for printing (GDI+)"
- Next in thread: alejandro lapeyre: "Re: large bitmaps for printing (GDI+)"
- Reply: alejandro lapeyre: "Re: large bitmaps for printing (GDI+)"
- Reply: Bob Powell [MVP]: "Re: large bitmaps for printing (GDI+)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|