- new from_resources(res: NativeResources, id: Int) in "Java" `{ return BitmapFactory.decodeResource(res, id); `}
- fun width: Int in "Java" `{ return recv.getWidth(); `}
- fun height: Int in "Java" `{ return recv.getHeight(); `}
+ new from_resources(res: NativeResources, id: Int) in "Java" `{ return BitmapFactory.decodeResource(res, (int)id); `}
+
+ # Width in pixels
+ #
+ # Wraps Java: `int android.graphics.Bitmap.getWidth()`
+ fun width: Int in "Java" `{ return self.getWidth(); `}
+
+ # Height in pixels
+ #
+ # Wraps Java: `int android.graphics.Bitmap.getHeight()`
+ fun height: Int in "Java" `{ return self.getHeight(); `}
+
+ # Number of bytes per row
+ #
+ # Wraps Java: `int android.graphics.Bitmap.getRowBytes()`
+ fun row_bytes: Int in "Java" `{
+ return self.getRowBytes();
+ `}
+
+ # Does this bitmap has an alpha channel?
+ #
+ # Wraps Java: `boolean android.graphics.Bitmap.hasAlpha()`
+ fun has_alpha: Bool in "Java" `{
+ return self.hasAlpha();
+ `}
+
+ # HACK for bug #845
+ redef fun new_global_ref import sys, Sys.jni_env `{
+ Sys sys = NativeBitmap_sys(self);
+ JNIEnv *env = Sys_jni_env(sys);
+ return (*env)->NewGlobalRef(env, self);
+ `}
+
+ redef fun pop_from_local_frame_with_env(jni_env) `{
+ return (*jni_env)->PopLocalFrame(jni_env, self);
+ `}