HighTechTalks DotNet Forums  

Scale Image w/o creating a 24 bit image object

Dotnet Framework (Drawing) microsoft.public.dotnet.framework.drawing


Discuss Scale Image w/o creating a 24 bit image object in the Dotnet Framework (Drawing) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
davermcl@hotmail.com
 
Posts: n/a

Default Scale Image w/o creating a 24 bit image object - 12-11-2007 , 11:04 AM






Hi,

I have a large (1000px x 20000px) Image object that I am trying to
scale down. It is in the 8bppIndexed format.

I am currently creating a new 24 bit Image object and using the
DrawImage method to do the scaling. But creating the new Image object
takes too much RAM (~70 MB) for the deployment machine. This object
cannot be in the 8bppIndexed format because then I cannot get a
Graphics object from it.

So I am looking for an alternative way to scale it down w/o creating
the 24 bit Image. Is it possible to scale an image by using its array
of bytes?

Any tips are greatly appreciated

Thanks,

Dave

Reply With Quote
  #2  
Old   
Michael Phillips, Jr.
 
Posts: n/a

Default Re: Scale Image w/o creating a 24 bit image object - 12-11-2007 , 11:18 AM






Quote:
So I am looking for an alternative way to scale it down w/o creating
the 24 bit Image.
You could unpack it to16bpp instead of 24bpp.

You could also use GDI StretchBlt via p-invoke which works with all bit
depths

<davermcl (AT) hotmail (DOT) com> wrote

Quote:
Hi,

I have a large (1000px x 20000px) Image object that I am trying to
scale down. It is in the 8bppIndexed format.

I am currently creating a new 24 bit Image object and using the
DrawImage method to do the scaling. But creating the new Image object
takes too much RAM (~70 MB) for the deployment machine. This object
cannot be in the 8bppIndexed format because then I cannot get a
Graphics object from it.

So I am looking for an alternative way to scale it down w/o creating
the 24 bit Image. Is it possible to scale an image by using its array
of bytes?

Any tips are greatly appreciated

Thanks,

Dave



Reply With Quote
  #3  
Old   
Michael C
 
Posts: n/a

Default Re: Scale Image w/o creating a 24 bit image object - 12-11-2007 , 05:36 PM



<davermcl (AT) hotmail (DOT) com> wrote

Quote:
Hi,

I have a large (1000px x 20000px) Image object that I am trying to
scale down. It is in the 8bppIndexed format.

I am currently creating a new 24 bit Image object and using the
DrawImage method to do the scaling. But creating the new Image object
takes too much RAM (~70 MB) for the deployment machine. This object
cannot be in the 8bppIndexed format because then I cannot get a
Graphics object from it.
What size are you scaling down to? You should be creating your 24bit bitmap
at the smaller size, not 1000x20000.




Reply With Quote
  #4  
Old   
davermcl@hotmail.com
 
Posts: n/a

Default Re: Scale Image w/o creating a 24 bit image object - 12-12-2007 , 03:57 PM



Quote:
What size are you scaling down to? You should be creating your 24bit bitmap
at the smaller size, not 1000x20000.
Thanks for your reply!

But I've resolved this issue by creating a 16bit Image instead of the
default of 32bit. The memory usage still isn't as low as I would like,
but at least the deployment machine doesn't crash anymore.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.