Bitmap/Canvas use and the NDK

前端 未结 1 1528
-上瘾入骨i
-上瘾入骨i 2020-12-19 23:17

I\'ve recently found out that there is no hard limit to the amount of memory NDK code can allocate in contrast to the heavily limited amount of memory (~25Mb on most devices

相关标签:
1条回答
  • 2020-12-19 23:49

    Check out the "bitmap-plasma" sample in the NDK. It creates a bitmap in Java and manipulates the bits in native code. One possible technique is that you can allocate the large blocks of memory and hold your images in native code and simply render a "view" into a Java-created bitmap. The method to render the view and do the "flattening" of your image layers should probably be done in native code. Something along the lines of:

    ...user changed a layer...

    My_native_render_code(MyDisplayBitmap);

    invalidate();

    0 讨论(0)
提交回复
热议问题