(1) How to use the bitmap object passed by the upper layer of Android

Source: Internet
Author: User

1. #include <android/bitmap.h> affirms three functions related to bitmap and pixel operations:

File location:./frameworks/native/include/android/bitmap.h
(1) Int androidbitmap_getinfo (jnienv* env, jobject jbitmap,androidbitmapinfo* info);

The bitmap object transferred from the upper layer is transformed into a native structure information androidbitmapinfo

(2) int androidbitmap_lockpixels (jnienv* env, Jobject Jbitmap, void** addrptr);

Locks the bitmap object's pixels in the memory address of the upper layer, ensuring that the memory does not change until it is unlocked.

(3) int androidbitmap_unlockpixels (jnienv* env, Jobject jbitmap);

Called when the pixel operation is complete

2. Bitmap.cpp implements these three functions, the implementation uses the Skia library, generates a library file, the upper layer uses three functions need to reference this library file.

File Location:

./frameworks/base/native/graphics/jni/bitmap.cpp

./frameworks/base/native/graphics/jni/android.mk

Generated

local_module:= Libjnigraphics

Include $ (build_shared_library)

(1) How to use the bitmap object passed by the upper layer of Android

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.