Results 1 to 4 of 4

Thread: Hexa generation from Pixmaps

  1. #1
    Join Date
    Sep 2016
    Location
    Pakistan
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Hexa generation from Pixmaps

    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
    };
    Last edited by Anwar Said; 8th December 2016 at 13:21. Reason: spelling mistake

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Hexa generation from Pixmaps

    What does "Hexa array" mean.

    Your example is a char array with unknown format.

    Cheers,
    _

  3. #3
    Join Date
    Sep 2016
    Location
    Pakistan
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Hexa generation from Pixmaps

    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..

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Hexa generation from Pixmaps

    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,
    _

Similar Threads

  1. QPixmap: It is not safe to use pixmaps outside the GUI
    By juergenmw in forum Qt Programming
    Replies: 1
    Last Post: 11th November 2012, 22:54
  2. Bmp image to hexa data ????
    By sai_3289 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 1st September 2012, 07:57
  3. need to draw on pixmaps outside of the gui thread
    By Serenius in forum Qt Programming
    Replies: 2
    Last Post: 27th January 2009, 16:22
  4. Hande a *lot* of pixmaps (Qt4.4)
    By bunjee in forum Qt Programming
    Replies: 3
    Last Post: 20th May 2008, 10:08
  5. Problems with QActions and Pixmaps
    By ToddAtWSU in forum Qt Programming
    Replies: 8
    Last Post: 11th April 2007, 21:53

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.