PDA

View Full Version : Hexa generation from Pixmaps



Anwar Said
8th December 2016, 13:20
Hi everyone,

I am working on Qt 4.6 with OpenGL. The requirement of my project is to draw hundreds of bitmaps on GLWidget. Now i need to convert all the images (Pixmaps) to Hexa 8 bytes array that a system can draw all the images at run time quickly, therefore please suggest me any software that can generates Hexa for me, or provide me any alternate fastest way to do the task. Any help will be appreciated.

Thanks..

below is the sample of Hexa array

char imageArray[] = {
0x5C,
0x24,
0x3F,
0x4E,
0x45,
0xFF,
0xFF,
0xFF
};

anda_skoa
8th December 2016, 15:31
What does "Hexa array" mean.

Your example is a char array with unknown format.

Cheers,
_

Anwar Said
8th December 2016, 15:54
By Hexa array, i mean a character bitmap array which consists of hexa code like this

const uint_8 microsoftSansSerif_8ptBitmaps[] =
{

0xF8, // #####
0x80, // #
0x80, // #
0x80, // #
0xF0, // ####
0x80, // #
0x80, // #
0x80, // #
0xF8, // #####
};
Thanks..

anda_skoa
8th December 2016, 19:25
Hexadecimal notation is just a way to write a bytes value in source code.

You need to identify the your source data format and your destination data format.

Depending on the latter you might be able to use the data loaded into a QImage directly via QImage::bits() or via saving with the destination format into QBuffer.

Cheers,
_