I have created BGRABitmap for Android demo which provides fast pixel access for jBitmap, and allows fast conversion “array of Byte” into jBitmap.
jmpessoa, please download the attachment and include it in public distribution of LAMW demos.
Currently LAMW does not provide fast pixel access for Android graphics.
jCanvas has
procedure DrawPoint(_x1: single; _y1: single);
which is extremely slow and makes Android app almost unusable.
Attached “AppBGRABitmapDemo1” has solved the problem of extremely slow graphics and now everybody will be able to create fast graphics apps using LAMW.
Instructions how to test the AppBGRABitmapDemo1:
1) Install BGRABitmap package to Lazarus IDE.
2) Original BGRABitmap package does not compile in Android, thus you need to use patched source code files.
From project subdirectory “!BGRABitmap_fixed_files” take 3 files
bgrafreetype.pas
bgranoguibitmap.pas
bgraopengl.pas
and replace these 3 files in TBGRABitmap package, which are located in directory:
“C:\fpcupdeluxe\ccr\bgrabitmap\bgrabitmap”
3) Add “BGRABitmapPack4NoGUI” to the project “Required Packages”.
Go to the menu:
Project -> Project Inspector -> Required Packages -> Add -> BGRABitmapPack4NoGUI -> Ok
4) Run project and press button “Draw BGRABitmap”.
P. S.: patched BGRABitmap package files need more investigation by the author of BGRABitmap. Now I have disabled all fonts and OpenGL related code in order to enable compilation under Android. Official distribution of BGRABitmap package should be updated accordingly.