From 03c0dc023580fd2fc710259c4aab29ac791b400c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 28 Dec 2013 15:11:36 +0000 Subject: [PATCH] Mention that raw pixel access is efficient only with DIBs under MSW. While accessing DDBs (now) works too, it's inefficient and should be avoided. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75439 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- interface/wx/rawbmp.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/interface/wx/rawbmp.h b/interface/wx/rawbmp.h index e1808a70ca..fe087d5bad 100644 --- a/interface/wx/rawbmp.h +++ b/interface/wx/rawbmp.h @@ -24,10 +24,16 @@ @li wxImagePixelData: Class to access to wxImage's internal data with alpha channel (RGBA). + wxMSW note: efficient access is only possible to the bits of the so called + device independent bitmaps (DIB) under MSW. To ensure that wxBitmap uses a + DIB internally and not a device dependent bitmap (DDB), you need to pass an + explicit depth to its ctor, i.e. either 24 or 32, as by default wxBitmap + creates a DDB of the screen depth. + Example: @code - wxBitmap bmp; + wxBitmap bmp(width, size, 24); // explicit depth important under MSW wxNativePixelData data(bmp); if ( !data ) {