cancel
Showing results for 
Search instead for 
Did you mean: 

getting bitmap ID from C++ code

Epamuk
Associate III

Hello,

I have user parameters in my device and every single parameter will have 5 image. Image will be choosen acorrding the working scenario.

I want to store bitmap ID in my memory area so want to get bitmap ID from C++ code.

Touchgfx generates "BitmapDatabase.hpp" . It ıncludes bit map IDs like below

// Generated by imageconverter. Please, do not edit!
 
#ifndef BITMAPDATABASE_HPP
#define BITMAPDATABASE_HPP
 
#include <touchgfx/hal/Types.hpp>
#include <touchgfx/lcd/LCD.hpp>
#include <touchgfx/Bitmap.hpp>
 
const uint16_t BITMAP_A_ID = 0;
const uint16_t BITMAP_B_ID = 1;
 
 
namespace BitmapDatabase
{
const touchgfx::Bitmap::BitmapData* getInstance();
uint16_t getInstanceSize();
}
 
#endif

and I try to add below two lines to my C file

extern "C" const uint16_t BITMAP_A_ID ;
extern "C" const uint16_t BITMAP_B_ID ;

or

extern const uint16_t BITMAP_A_ID ;
extern const uint16_t BITMAP_B_ID ;
 

But both lines caueses error and I cant reach to bitmap ID.

How can I get bitmap IDs from touchgfx generated C++ code ?

Thanks.

2 REPLIES 2
Martin KJELDSEN
Chief III

Does it need to be from C-code?

We do not generate the "extern" keywords in the BitmapDatabase.hpp file so that you can use it from C code.

Epamuk
Associate III

It is better do like this for my code readabilty. But anyway I will create a cpp file for this and I will fill my C array with bitmap ID s inside C++.

thanks.