# Create a NativeBitmap using a resource ID and the NativeResources
# Called by the ResourceManager
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);
return (*env)->NewGlobalRef(env, self);
`}
+ redef fun pop_from_local_frame_with_env(jni_env) `{
+ return (*jni_env)->PopLocalFrame(jni_env, self);
+ `}
end
# Android AssetFileDescriptor, can be retrieve by AssetManager and used to load a sound in a SoundPool