- // scale pixbuf if available and it has alpha or there is no mask
- if (M_BMPDATA->m_pixbuf != NULL && (
- M_BMPDATA->m_mask == NULL || gdk_pixbuf_get_has_alpha(M_BMPDATA->m_pixbuf)))
- {
- bmp.SetPixbuf(gdk_pixbuf_new(GDK_COLORSPACE_RGB,
- gdk_pixbuf_get_has_alpha(M_BMPDATA->m_pixbuf),
- 8, width, height), M_BMPDATA->m_bpp);
- gdk_pixbuf_scale(M_BMPDATA->m_pixbuf, bmp.GetPixbuf(),
- 0, 0, width, height,
- clipx, clipy,
- (double)newx/GetWidth(), (double)newy/GetHeight(),
- GDK_INTERP_BILINEAR);
- }
- else
- {
- GdkImage* img = gdk_drawable_get_image(
- M_BMPDATA->m_pixmap, 0, 0, M_BMPDATA->m_width, M_BMPDATA->m_height);
-
- wxCHECK_MSG(img, bmp, wxT("couldn't create image"));
-
- GdkGC *gc = NULL;
- GdkPixmap *dstpix = NULL;
- char *dst = NULL;
- long dstbyteperline = 0;
-
- if (GetDepth() != 1)
- {
- bmp.Create(width, height, gdk_drawable_get_depth(M_BMPDATA->m_pixmap));
- dstpix = bmp.GetPixmap();
- gc = gdk_gc_new( dstpix );
- }
- else
- {
- dstbyteperline = (width + 7) / 8;
- dst = (char*) malloc(dstbyteperline*height);
- }