bitmap.SetDepth( 1 );
+ GdkVisual *visual = gdk_window_get_visual( wxRootWindow->window );
+ wxASSERT( visual );
+
// Create picture image
unsigned char *data_data = (unsigned char*)malloc( ((width >> 3)+8) * height );
GdkImage *data_image =
- gdk_image_new_bitmap( gdk_visual_get_system(), data_data, width, height );
+ gdk_image_new_bitmap( visual, data_data, width, height );
// Create mask image
{
unsigned char *mask_data = (unsigned char*)malloc( ((width >> 3)+8) * height );
- mask_image = gdk_image_new_bitmap( gdk_visual_get_system(), mask_data, width, height );
+ mask_image = gdk_image_new_bitmap( visual, mask_data, width, height );
wxMask *mask = new wxMask();
mask->m_bitmap = gdk_pixmap_new( wxRootWindow->window, width, height, 1 );
bitmap.SetPixmap( gdk_pixmap_new( wxRootWindow->window, width, height, -1 ) );
- // Retrieve depth
+ // Retrieve depth
- GdkVisual *visual = gdk_window_get_visual( bitmap.GetPixmap() );
- if (visual == NULL) visual = gdk_visual_get_system();
+ GdkVisual *visual = gdk_window_get_visual( wxRootWindow->window );
+ wxASSERT( visual );
+
int bpp = visual->depth;
bitmap.SetDepth( bpp );
// Create picture image
GdkImage *data_image =
- gdk_image_new( GDK_IMAGE_FASTEST, gdk_visual_get_system(), width, height );
+ gdk_image_new( GDK_IMAGE_FASTEST, visual, width, height );
// Create mask image
{
unsigned char *mask_data = (unsigned char*)malloc( ((width >> 3)+8) * height );
- mask_image = gdk_image_new_bitmap( gdk_visual_get_system(), mask_data, width, height );
+ mask_image = gdk_image_new_bitmap( visual, mask_data, width, height );
wxMask *mask = new wxMask();
mask->m_bitmap = gdk_pixmap_new( wxRootWindow->window, width, height, 1 );
if (bpp >= 24)
{
- GdkVisual *visual = gdk_visual_get_system();
if ((visual->red_mask > visual->green_mask) && (visual->green_mask > visual->blue_mask)) b_o = RGB;
else if ((visual->red_mask > visual->blue_mask) && (visual->blue_mask > visual->green_mask)) b_o = RGB;
else if ((visual->blue_mask > visual->red_mask) && (visual->red_mask > visual->green_mask)) b_o = BRG;