Re: Two CBitmap questions

Tech-Archive recommends: Speed Up your PC by fixing your registry



The GDI+ Image/Bitmap classes will load png images. There's direct support
for alpha values.

The ATL class CImage uses GDI+ for loading/saving images and can/does wrap
an image as a DIBSection which can be used with GDI APIs.

To use BitBlt, the source bitmap needs to be selected into a DC.

Mark

--
Mark Salsbery
Microsoft MVP - Visual C++


"David Thielen" <thielen@xxxxxxxxxxxxx> wrote in message
news:C8BF130C-B964-4212-9D8D-6BEE73EDDB15@xxxxxxxxxxxxxxxx
Hi;

I am writing my first C++ program in 10 years I think so these are pretty
basic questions.

1) It looks like CBitmap.LoadBitmap cannot load png files. Is there a file
format with alpha that CBitmap does support? If not, what is the best way
to
draw bitmaps with alpha or is that "very difficult?" I don't have to have
this but it sure does make the output look better.

2) How do I draw a bitmap in a CDC? I thought it was with CDC.BitBlt but
you
cannot pass it a CBitmap.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




.



Relevant Pages

  • Re: GdipCreateHBITMAPFromBitmap + PixelFormat32bppARGB
    ... The Windows bitmap specification was drawn up for Windows 3.1 ... Alpha blended bitmaps were not supported. ... The documentation for AlphaBlend function implies that Windows GDI ... an alpha channel. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Very Large Bitmaps
    ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... Answer those GDI+ questions with the GDI+ FAQ ... > spaces and 16-bit images etc without the horrible ambiguity and missing ... A bitmap is loaded and expanded to an uncompressed raster so 18000 * ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Very Large Bitmaps
    ... The GDI+ encoder/decoder systems are dedicated to working with whole images ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... Answer those GDI+ questions with the GDI+ FAQ ... >>> but does not work for the large size bitmap, ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: A Table and GDI+ challenge in ASP.NET
    ... Answer those GDI+ questions with the GDI+ FAQ ... > chessboard with figures as images. ... how to "paste" images to cells. ... > serve for rendering text, but does this mean that I will have to derive my ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Near-opaque Alpha Values Fail to Retain Color on Copy
    ... The value *is* changing after you draw the copied bitmap to the graphics but ... If you run your messagebox on the bmpCopy you'll see that the copy was ... Answer those GDI+ questions with the GDI+ FAQ ... > I posted earlier about a problem with combining alpha values, ...
    (microsoft.public.dotnet.framework.drawing)