/** * Invokes platform specific functionality to allocate a new image. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public * API for <code>Image</code>. It is marked public only so that it * can be shared within the packages provided by SWT. It is not * available on all platforms, and should never be called from * application code. * </p> * * @param device the device on which to allocate the color * @param type the type of the image (<code>SWT.BITMAP</code> or <code>SWT.ICON</code>) * @param pixbuf an GdkPixbuf * * @noreference This method is not intended to be referenced by clients. */ public static Image gtk_new_from_pixbuf(Device device, int type, int /*long*/ pixbuf) { Image image = new Image(device); image.createFromPixbuf(type, pixbuf); image.type = type; return image; }
/** * Invokes platform specific functionality to allocate a new image. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public * API for <code>Image</code>. It is marked public only so that it * can be shared within the packages provided by SWT. It is not * available on all platforms, and should never be called from * application code. * </p> * * @param device the device on which to allocate the color * @param type the type of the image (<code>SWT.BITMAP</code> or <code>SWT.ICON</code>) * @param pixbuf an GdkPixbuf * * @noreference This method is not intended to be referenced by clients. */ public static Image gtk_new_from_pixbuf(Device device, int type, long /*int*/ pixbuf) { Image image = new Image(device); image.createFromPixbuf(type, pixbuf); image.type = type; return image; }
/** * Invokes platform specific functionality to allocate a new image. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public * API for <code>Image</code>. It is marked public only so that it * can be shared within the packages provided by SWT. It is not * available on all platforms, and should never be called from * application code. * </p> * * @param device the device on which to allocate the color * @param type the type of the image (<code>SWT.BITMAP</code> or <code>SWT.ICON</code>) * @param pixbuf an GdkPixbuf * * @noreference This method is not intended to be referenced by clients. */ public static Image gtk_new_from_pixbuf(Device device, int type, int /*long*/ pixbuf) { Image image = new Image(device); image.createFromPixbuf(type, pixbuf); image.type = type; return image; }
void initNative(String filename) { try { int length = filename.length (); char [] chars = new char [length]; filename.getChars (0, length, chars, 0); byte [] buffer = Converter.wcsToMbcs(null, chars, true); int /*long*/ pixbuf = OS.gdk_pixbuf_new_from_file(buffer, null); if (pixbuf != 0) { try { createFromPixbuf (SWT.BITMAP, pixbuf); } finally { if (pixbuf != 0) OS.g_object_unref (pixbuf); } } } catch (SWTException e) {} }
void initNative(String filename) { try { int length = filename.length (); char [] chars = new char [length]; filename.getChars (0, length, chars, 0); byte [] buffer = Converter.wcsToMbcs(null, chars, true); int /*long*/ pixbuf = OS.gdk_pixbuf_new_from_file(buffer, null); if (pixbuf != 0) { try { createFromPixbuf (SWT.BITMAP, pixbuf); } finally { if (pixbuf != 0) OS.g_object_unref (pixbuf); } } } catch (SWTException e) {} }
void initNative(String filename) { try { int length = filename.length (); char [] chars = new char [length]; filename.getChars (0, length, chars, 0); byte [] buffer = Converter.wcsToMbcs(null, chars, true); long /*int*/ pixbuf = OS.gdk_pixbuf_new_from_file(buffer, null); if (pixbuf != 0) { try { createFromPixbuf (SWT.BITMAP, pixbuf); } finally { if (pixbuf != 0) OS.g_object_unref (pixbuf); } } } catch (SWTException e) {} }