diff options
Diffstat (limited to 'plugins/Popup/src/bitmap_funcs.cpp')
-rw-r--r-- | plugins/Popup/src/bitmap_funcs.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/Popup/src/bitmap_funcs.cpp b/plugins/Popup/src/bitmap_funcs.cpp index 2ae6256e21..f28dba8f28 100644 --- a/plugins/Popup/src/bitmap_funcs.cpp +++ b/plugins/Popup/src/bitmap_funcs.cpp @@ -762,6 +762,11 @@ void MyBitmap::allocate(int w, int h) width = w;
height = h;
+ if (dcBmp) {
+ DeleteObject(SelectObject(dcBmp, hBmpSave));
+ DeleteDC(dcBmp);
+ }
+
BITMAPINFO bi;
bi.bmiHeader.biSize = sizeof(bi.bmiHeader);
bi.bmiHeader.biWidth = w;
@@ -769,11 +774,7 @@ void MyBitmap::allocate(int w, int h) bi.bmiHeader.biPlanes = 1;
bi.bmiHeader.biBitCount = 32;
bi.bmiHeader.biCompression = BI_RGB;
-
- if (dcBmp) {
- DeleteObject(SelectObject(dcBmp, hBmpSave));
- DeleteDC(dcBmp);
- }
+ bi.bmiColors[0].rgbRed = bi.bmiColors[0].rgbGreen = bi.bmiColors[0].rgbBlue = bi.bmiColors[0].rgbReserved = 0;
hBmp = (HBITMAP)CreateDIBSection(0, &bi, DIB_RGB_COLORS, (void **)&bits, 0, 0);
dcBmp = CreateCompatibleDC(0);
|