Closed spger closed 4 years ago
// rgba to bgra
std::uint8_t* ptr = bitmap.data();
std::uint8_t* end = bitmap.data() + bitmap.height() * bitmap.stride();
while(ptr < end)
{
std::uint8_t r = ptr[0];
std::uint8_t g = ptr[1];
std::uint8_t b = ptr[2];
std::uint8_t a = ptr[3];
ptr[0] = b;
ptr[1] = g;
ptr[2] = r;
ptr[3] = a;
ptr += 4;
}
HBITMAP handle = CreateBitmap(bitmap.width(), bitmap.height(), 1, 32, bimap.data());
CBitmap cbimap = CBitmap::FromHandle(handle);
If it works lemme know.
Its working! Thank you
Hi, I will like to know if is possible or there is some kind of compatibility to cast lunasvg::Bitmap to CBitmap. Regards