DnD fixes

Image fixes
  Clipboard API


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@952 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1998-11-02 14:12:29 +00:00
parent 8c65b36ad7
commit dc86cb34c3
17 changed files with 453 additions and 174 deletions

View File

@@ -513,8 +513,12 @@ wxImage wxBitmap::ConvertToImage() const
image.Create( M_BMPDATA->m_width, M_BMPDATA->m_height );
char unsigned *data = image.GetData();
GdkVisual *visual = gdk_window_get_visual( M_BMPDATA->m_pixmap );
if (visual == NULL) visual = gdk_window_get_visual( (GdkWindow*) &gdk_root_parent );
int bpp = visual->depth;
int bpp = gdk_image->bpp;
GdkColormap *cmap = gtk_widget_get_default_colormap();
long pos = 0;
@@ -525,6 +529,11 @@ 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;