This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Convert BMP images to Hex

Other Parts Discussed in Thread: MSP430F5438

Hi everyone!

 

Currently I'm using the Example Software (UserExperience) for the MSP430F5438 Experimenter Board (MSP-EXP430F5438) and I need to convert a bitmap to the format used for displaying images in the Board's graphic LCD.  Is there a software and/or any guidelines to achieve this?

 

Thanks,

Ruben

  • Hello!

    If you use for instance GraphicConverter, you can directly dump your image in a const char * format.

    No need to write code. Enter any image, convert it to black and white, save as "c source" and you're done.

    Maybe other image editors have the same functionality.

    Pascal

     

  • Thanks for the reply!

    Do you know the format of the export?? Could you please provide me with a like for this program?  I have found a few of this programs but none of them exports the data in a format I can use. The TI code uses a format similar to:  

    image[] = {

    0xFFFF,..., 0xFFFF,

    0xFFFF,..., 0xFFFF

    }

    And all the programs seem to export in a format like this one:

    image[] = {

    0xFF,..., 0xFF,

    0xFF,..., 0xFF

    }

     

    Meaning I can't use them... :(

     


    I was hooping someone who worked at TI could find out about the program they used internally to pass the images to the array format inside the UserExperience Demo.

     

    Thanks for any help on the matter!

     

  • Hello!

    I don't remember whether the export format was uint8 or uint16.

    Usully in programming, you will never find anything that fits _exactly_ your needs.

    If the export is 0xAB, 0xCD and you need 0xABCD, why not using a simple data cast?

    for instance:

    uint16 * my_uint16_array = (uint16 *)uint8_array; (or the opposite if you want uint8 and

    you have uint16).

    And then you get the format you wanted and it costs you close to 0 in processing power.

    If the data is not in the proper order, (you need 0xCDAB instead of 0xABCD, then you can

    convert 2 bytes by 2 bytes when you display. And if you don't want to convert, you can

    preprocess the data you get with a Perl script.

    Pascal

     

  • Hi Pascal,

    My problem is that this is the first time that I work in this sort of things and I'm not exactly sure what's the format being used in the user experience demo. I'm going to try and do the data cast you mentioned to see if that works. Thanks a lot for the suggestion!

**Attention** This is a public forum