From 64d315544fe5ebe0a22297ff340a99e63230415f Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Tue, 3 Nov 1998 14:46:38 +0000 Subject: [PATCH] Bit fiddling. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@956 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/bitmap.cpp | 7 +------ src/gtk1/bitmap.cpp | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index 50d6763dcf..453f827b5f 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -529,18 +529,13 @@ wxImage wxBitmap::ConvertToImage() const int pixel = gdk_image_get_pixel( gdk_image, i, j ); if (bpp <= 8) { -/* - int r = cmap->colors[pixel].red; // debug code - int g = cmap->colors[pixel].green; - int b = cmap->colors[pixel].blue; -*/ data[pos] = cmap->colors[pixel].red >> 8; data[pos+1] = cmap->colors[pixel].green >> 8; data[pos+2] = cmap->colors[pixel].blue >> 8; } else if (bpp == 15) { data[pos] = (pixel >> 7) & 0xf8; - data[pos+1] = (pixel >> 3) & 0xf8; + data[pos+1] = (pixel >> 2) & 0xf8; data[pos+2] = (pixel << 3) & 0xf8; } else if (bpp == 16) { diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index 50d6763dcf..453f827b5f 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -529,18 +529,13 @@ wxImage wxBitmap::ConvertToImage() const int pixel = gdk_image_get_pixel( gdk_image, i, j ); if (bpp <= 8) { -/* - int r = cmap->colors[pixel].red; // debug code - int g = cmap->colors[pixel].green; - int b = cmap->colors[pixel].blue; -*/ data[pos] = cmap->colors[pixel].red >> 8; data[pos+1] = cmap->colors[pixel].green >> 8; data[pos+2] = cmap->colors[pixel].blue >> 8; } else if (bpp == 15) { data[pos] = (pixel >> 7) & 0xf8; - data[pos+1] = (pixel >> 3) & 0xf8; + data[pos+1] = (pixel >> 2) & 0xf8; data[pos+2] = (pixel << 3) & 0xf8; } else if (bpp == 16) { -- 2.45.2