Hi All,
I want to allocate mem in native used bitmapfactory, when we create
bitmap.( After andorid 3.0, mem allocate in heap)
following is my code:
in java code
*Bitmap b = createBitmap(600, 600);//this is my ndk interface*
// normal
Options options = new Options();
options.inBitmap = b;
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
InputStream in =
getResources().openRawResource(R.drawable.ic_launcher);
Bitmap noticeIcon = android.graphics.BitmapFactory.decodeStream(in,
null, options);
And, ndk createBitmap is as following:
JNIEXPORT jobject JNICALL
Java_com_example_ndktest_BitmapFactory_nativeCreateBitmap(
JNIEnv * env, jobject obj, jintArray jColors, int offset, int stride,
int width, int height, SkBitmap::Config config,jboolean isMutable){
SkBitmap* bitmap = new SkBitmap();
bitmap->setConfig(SkBitmap::kARGB_8888_Config, width, height);
--
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-developers/5a4e45d8-7acd-47ed-aa78-a9389c477257%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.