Loading 32 bpp images with GDI+

Loading 32 bpp images with GDI+

Post by Rossen Tzone » Mon, 22 Apr 2002 21:41:00


Hi all,

I am trying to use GDI+ to load 32bpp images (RGBA) but I get valid
Gdiplus::Bitmap objects but the width and height values are both 0. What is
wrong?

Here is my example code( "32bpp.tiff" is RGBA image made with Photoshop ):

Gdiplus::Bitmap bitmap( "32bpp.tiff" );

ASSERT( bitmap.GetWidth()  );
ASSERT( bitmap.GetHeight() );

--
Rossen Tzonev
Sofia, Bulgaria

 
 
 

Loading 32 bpp images with GDI+

Post by John Hornick [M » Mon, 22 Apr 2002 23:37:27


Hi,

Quote:> I am trying to use GDI+ to load 32bpp images (RGBA) but I get valid
> Gdiplus::Bitmap objects but the width and height values are both 0. What
is
> wrong?

> Here is my example code( "32bpp.tiff" is RGBA image made with Photoshop ):

> Gdiplus::Bitmap bitmap( "32bpp.tiff" );

> ASSERT( bitmap.GetWidth()  );
> ASSERT( bitmap.GetHeight() );

Please share with us one such TIFF file.

Thanks,
- John
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Visit http://www.microsoft.com/security for current information on security.

 
 
 

Loading 32 bpp images with GDI+

Post by Rossen Tzone » Wed, 24 Apr 2002 00:01:24


Sorry. Incorrect usage of Photoshop. Everything work fine now.



Quote:> Hi,

> > I am trying to use GDI+ to load 32bpp images (RGBA) but I get valid
> > Gdiplus::Bitmap objects but the width and height values are both 0. What
> is
> > wrong?

> > Here is my example code( "32bpp.tiff" is RGBA image made with
Photoshop ):

> > Gdiplus::Bitmap bitmap( "32bpp.tiff" );

> > ASSERT( bitmap.GetWidth()  );
> > ASSERT( bitmap.GetHeight() );

> Please share with us one such TIFF file.

> Thanks,
> - John
> Microsoft Developer Support
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Visit http://www.microsoft.com/security for current information on
security.

 
 
 

1. How to convert a 32 bit per pixel (bpp) image to an 8 bpp image

    I have been using the .NET framework to get icons for files/directories
and am trying to save the icons as transparent gifs.  Now I know that most
of the graphics routines in .NET are built on top of GDI/GDI+, so that is
why I am asking the question in these forums.

    I can get a handle to an icon just fine.  I can even convert it to a
transparent bitmap just fine.  However, this bitmap is 32 bits per pixel.
When I want to save this as a transparent gif, I cannot, because the
specification calls for a max of 8bpp.

    So, given that, how can I convert or create a new bitmap that I can save
as a transparent gif, but reducing the resolution to 8bpp?

    Thanks in advance for any help, it is greatly appreciated.

--
               - Nicholas Paldino [.NET MVP]

2. HP ScanJet 5100C Poor quality for e-mail?

3. how to convert 16 bpp image to 4 bpp image ?

4. What IDE CD-ROM drives can READ audio cd's ?

5. Create a device context with 8,16,24,32 bpp manually

6. Parameterized cells question?

7. Color remapping animation in 16/32 bpp

8. Publishing a sbs server with 2 Nic's

9. Loading 32 bit bmp file with alpha settings (alpha settings not loaded)

10. GDI+ load image from IStream

11. Loading .png images from strings using GDI+

12. loading images with GDI+ question

13. Please Help: Problem saving GDI+ image to stream after loading from a memory stream