int img; if (image.type == SWT.ICON){ img = Gdip.Bitmap_new(image.handle); } else { img = Gdip.Bitmap_new(image.handle, 0); }
int[] gdipImage = image.createGdipImage(); int img = gdipImage[0];
public Pattern(Device device, Image image) {	if (device == null) device = Device.getDevice();	if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);	if (image == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);	if (image.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);	this.device = device;	device.checkGDIP();	int img;	if (image.type == SWT.ICON){		img = Gdip.Bitmap_new(image.handle);	} else {		img = Gdip.Bitmap_new(image.handle, 0);	}	int width = Gdip.Image_GetWidth(img);	int height = Gdip.Image_GetHeight(img);	handle = Gdip.TextureBrush_new(img, Gdip.WrapModeTile, 0, 0, width, height);		Gdip.Bitmap_delete(img);	if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES);	if (device.tracking) device.new_Object(this);}