X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/69060f4f0c6a35cd4e8c031794f7c78c59712539..d298f18ffb4bd0bd758b10f34c9e01cd119d1365:/include/wx/msw/dib.h diff --git a/include/wx/msw/dib.h b/include/wx/msw/dib.h index c85c9e9d2c..58061449f1 100644 --- a/include/wx/msw/dib.h +++ b/include/wx/msw/dib.h @@ -138,12 +138,28 @@ public: // ------------------ #if wxUSE_IMAGE - // create a DIB from the given image, the DIB will be either 24 or 32 (if - // the image has alpha channel) bpp - wxDIB(const wxImage& image) { Init(); (void)Create(image); } + // Possible formats for DIBs created by the functions below. + enum PixelFormat + { + PixelFormat_PreMultiplied = 0, + PixelFormat_NotPreMultiplied = 1 + }; + + // Create a DIB from the given image, the DIB will be either 24 or 32 (if + // the image has alpha channel) bpp. + // + // By default the DIB stores pixel data in pre-multiplied format so that it + // can be used with ::AlphaBlend() but it is also possible to disable + // pre-multiplication for the DIB to be usable with ImageList_Draw() which + // does pre-multiplication internally. + wxDIB(const wxImage& image, PixelFormat pf = PixelFormat_PreMultiplied) + { + Init(); + (void)Create(image, pf); + } // same as the above ctor but with the return code - bool Create(const wxImage& image); + bool Create(const wxImage& image, PixelFormat pf = PixelFormat_PreMultiplied); // create wxImage having the same data as this DIB wxImage ConvertToImage() const;