[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

large bitmaps for printing (GDI+

semhelp

1/11/2005 3:57:00 PM

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?

8 Answers

Bob Powell

1/11/2005 8:29:00 PM

0

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/tips...

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/f...

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?
>


semhelp

1/11/2005 10:17:00 PM

0

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/tips...
>
> Answer those GDI+ questions with the GDI+ FAQ
> http://www.bobpowell.net/f...
>
> 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?
> >
>
>
>

alejandro lapeyre

1/12/2005

0

I would write to an EMF image.

<Unless you are drawing bitmaps> The lines and text you draw are stored as
instructions, not as bits in the image. And You can also scale the resulting
file!

best regards,
Alejandro Lapeyre


"semhelp" <semhelp@discussions.microsoft.com> escribió en el mensaje
news:95F426C5-DA50-41C3-AEF6-5739D3B90961@microsoft.com...
> 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/tips...
>>
>> Answer those GDI+ questions with the GDI+ FAQ
>> http://www.bobpowell.net/f...
>>
>> 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?
>> >
>>
>>
>>


Bob Powell

1/12/2005 7:19:00 AM

0

None of the 16 bpp image formats work under GDI+. They are essentially
broken and were included in the system in error.

CAD drawings to plotters are usually defined in a vector graphics format
such as HP plotter format. These formats do not require gigabytes of storage
for even the most complex drawings.

If you have the possibility of breaking the drawing up into smaller chunks
then I think this is the only way that you're likely to have much success.


--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tips...

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/f...

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:95F426C5-DA50-41C3-AEF6-5739D3B90961@microsoft.com...
> 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/tips...
>>
>> Answer those GDI+ questions with the GDI+ FAQ
>> http://www.bobpowell.net/f...
>>
>> 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?
>> >
>>
>>
>>


semhelp

1/12/2005 3:31:00 PM

0

I'm currently using a 16bpp format (the RGB555 format) and it seems to work
OK. When I look at the task manager, my application seems to use a lot less
memory when using the 16bpp format vs. the 32bpp format. Is there something
in particular that doesn't work when using 16bpp?

I have had some problems using the 1,4,8 bpp indexed formats, but I haven't
looked into what is causing the problem.

"Bob Powell [MVP]" wrote:

> None of the 16 bpp image formats work under GDI+. They are essentially
> broken and were included in the system in error.
>
> CAD drawings to plotters are usually defined in a vector graphics format
> such as HP plotter format. These formats do not require gigabytes of storage
> for even the most complex drawings.
>
> If you have the possibility of breaking the drawing up into smaller chunks
> then I think this is the only way that you're likely to have much success.
>
>
> --
> Bob Powell [MVP]
> Visual C#, System.Drawing
>
> Find great Windows Forms articles in Windows Forms Tips and Tricks
> http://www.bobpowell.net/tips...
>
> Answer those GDI+ questions with the GDI+ FAQ
> http://www.bobpowell.net/f...
>
> 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:95F426C5-DA50-41C3-AEF6-5739D3B90961@microsoft.com...
> > 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/tips...
> >>
> >> Answer those GDI+ questions with the GDI+ FAQ
> >> http://www.bobpowell.net/f...
> >>
> >> 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?
> >> >
> >>
> >>
> >>
>
>
>

blue_collar_worker

9/17/2008 1:00:00 AM

0

On Sep 16, 4:57 pm, haterofneoc...@yahoo.com wrote:
> On Sep 15, 10:51 pm, graverobber...@yahoo.com wrote:
>
> >http://news.yahoo.com/s/ap/palin_t...
>
> > Wow, what a flip-flop on her part!  If she can't be truthful about
> > this, she could hardly be truthful about the other scandals that
> > plague her.
>
> http://news.yahoo.com/s/ap/20080916/ap_on_el_pr/palin_t...
>
> The unmitigated gall of those Republican politicians up there in
> Alaska.  And yet another lie from Palin - "Hold me accountable".  If
> she can't be held accountable and to her word that she would cooperate
> with the probe, she will feel she never has too.  So much for being a
> "government reformer".

The trooper gate investigation is a political smear and the Democrats
and the Troopers Union, the AFL-CIO know so.

SteelersFanInTx

9/17/2008 2:00:00 AM

0

On Sep 16, 7:59 pm, 527_blue_collar_worker <GeraldCNew...@hotmail.com>
wrote:
> On Sep 16, 4:57 pm, haterofneoc...@yahoo.com wrote:
>
> > On Sep 15, 10:51 pm, graverobber...@yahoo.com wrote:
>
> > >http://news.yahoo.com/s/ap/palin_t...
>
> > > Wow, what a flip-flop on her part!  If she can't be truthful about
> > > this, she could hardly be truthful about the other scandals that
> > > plague her.
>
> >http://news.yahoo.com/s/ap/20080916/ap_on_el_pr/palin_t...
>
> > The unmitigated gall of those Republican politicians up there in
> > Alaska.  And yet another lie from Palin - "Hold me accountable".  If
> > she can't be held accountable and to her word that she would cooperate
> > with the probe, she will feel she never has too.  So much for being a
> > "government reformer".
>
> The trooper gate investigation is a political smear and the Democrats
> and the Troopers Union, the AFL-CIO know so.

A bipartisan commission of 14 decided to present the findings, and a
committee of 3 Republicans and 2 Democrats decided to
investigate...care to explain how that is political smear, Genius?

SteelersFanInTx

10/16/2008 4:05:00 AM

0

On Sep 16, 10:40 pm, "Obama-Biden in 08" <NoTha...@NoSpam.com> wrote:
> "527_blue_collar_worker" <GeraldCNew...@hotmail.com> wrote in message
>
> news:49160127-7d4b-47a1-974a-a6f88ec99674@b30g2000prf.googlegroups.com...
> On Sep 16, 4:57 pm, haterofneoc...@yahoo.com wrote:
>
> > On Sep 15, 10:51 pm, graverobber...@yahoo.com wrote:
>
> > >http://news.yahoo.com/s/ap/palin_t...
>
> > > Wow, what a flip-flop on her part! If she can't be truthful about
> > > this, she could hardly be truthful about the other scandals that
> > > plague her.
>
> >http://news.yahoo.com/s/ap/20080916/ap_on_el_pr/palin_t...
>
> > The unmitigated gall of those Republican politicians up there in
> > Alaska. And yet another lie from Palin - "Hold me accountable". If
> > she can't be held accountable and to her word that she would cooperate
> > with the probe, she will feel she never has too. So much for being a
> > "government reformer".
>
> The trooper gate investigation is a political smear and the Democrats
> and the Troopers Union, the AFL-CIO know so.
> ===================================
>
> The investigation was initially demanded by REPUBLICAN lawmakers in Alaska,
> and officially launched with a unanimous vote of a bipartisan committee.
> Why would her own fellow Republicans want to initiate a "political smear" of
> a supposedly popular governor of their own party?
>
> --
> I'm not really anti-Bush . . . I'm really just anti-stupid.
> I support the right of all Americans to arm bears.
> The only Bush I trust is my wife's.

A committee of 10 Republicans and 4 Democrats, and it's a "political
smear"...borrowing recreational pharmaceuticals from Rush again?