简体   繁体   中英

How to transform QImage from C++ to Android?

Currently I am developing an Android app. I have to convert an algorithm from C++ to Android. Most of the code was converted but I don't know what symbolize the next lines in C++.

 QImage my_image(W,H, QImage::Format_RGB32);
 my_image.fill(Qt:black);

In my code my_image was declared a Bitmap. Please help me with the equivalent code for Android or please specify what does the described C++ code.

Thank you !

The code

 QImage my_image(W,H, QImage::Format_RGB32);
 my_image.fill(Qt:black);

is a QT GUI framework code that creates RGB32 image with width W and height H and fills it with a black color.

RGB32 image pixels consist of bytes arranged in memory like this:

[ BGRA ] [ BGRA ] [ BGRA ] [ BGRA ] ...

B - blue pixel component G - green pixel component R - red pixel component A - padding byte (is used as alpha pixel component in related formats ARGB32 and ARGB32-premultiplied)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM