Pixbuffer (Image src) { if (src == null || src.pixmap == 0) SWT.error(SWT.ERROR_NULL_ARGUMENT);   int[] unused = new int[1]; int[] w = new int[1]; int[] h = new int[1]; int[] d = new int[1]; OS.gdk_window_get_geometry(src.pixmap, unused, unused, w, h, unused); int width = w[0]; int height = h[0];   createHandle(width, height);   int cmap = OS.gdk_colormap_get_system(); GDKPIXBUF.gdk_pixbuf_get_from_drawable( handle, src.pixmap, cmap, 0,0,0,0, width, height);   if (src.alphaData != null) fillAlphaFromAlphaBytes(src.alphaData); else if (src.alpha != -1) fillConstantAlpha(src.alpha); else if (src.mask != 0) fillAlphaFromPixmapMask(src.mask); else if (src.transparentPixel != -1) fillAlphaFromTransparentPixel(src.pixmap, src.transparentPixel); else fillOpaque(); }
private Pixbuffer() {}
	Pixbuffer (Image src) {		if (src == null || src.pixmap == 0) SWT.error(SWT.ERROR_NULL_ARGUMENT);		// get the geometry		int[] unused = new int[1];		int[] w = new int[1];		int[] h = new int[1];		int[] d = new int[1];		OS.gdk_window_get_geometry(src.pixmap, unused, unused, w, h, unused);	 	int width = w[0];	 	int height = h[0];		// create the actual OS resource		createHandle(width, height);				// pull the color data		int cmap = OS.gdk_colormap_get_system();		GDKPIXBUF.gdk_pixbuf_get_from_drawable(			handle,			src.pixmap,			cmap,			0,0,0,0,			width, height);				// the tricky part is alpha		if (src.alphaData != null) fillAlphaFromAlphaBytes(src.alphaData);		else if (src.alpha != -1) fillConstantAlpha(src.alpha);		else if (src.mask != 0) fillAlphaFromPixmapMask(src.mask);		else if (src.transparentPixel != -1) fillAlphaFromTransparentPixel(src.pixmap, src.transparentPixel);		else fillOpaque();	}