Hi everyone,
I'm using emWin 4.18 and would like to set the bitmap of a button. But the bitmap is not known during compile time, so i cant use something like that (which would work, btw):
instead i want to do something like this:
Display All
This works fine when I draw it on the screen with
But when I use
the application crashes.
Can anyone help please.
Thank you,
Florian
I'm using emWin 4.18 and would like to set the bitmap of a button. But the bitmap is not known during compile time, so i cant use something like that (which would work, btw):
instead i want to do something like this:
C Source Code
- GUI_COLOR colors[2];
- GUI_LOGPALETTE palette;
- GUI_BITMAP bitmap;
- //set palette colors
- colors[0] = GUI_BLACK;
- colors[1] = GUI_WHITE;
- //fill palette with values
- palette.NumEntries = 2;
- palette.HasTrans = 1;
- palette.pPalEntries = &colors[0];
- //fill bitmap with values
- bitmap.XSize = 24;
- bitmap.YSize = 24;
- bitmap.BytesPerLine = 3;
- bitmap.BitsPerPixel = 1;
- bitmap.pData = acMyBitmapData; //This data is read from a flash memory, so not known at compile time
- bitmap.pPal = &palette;
- bitmap.pMethods = NULL;
This works fine when I draw it on the screen with
But when I use
the application crashes.
Can anyone help please.
Thank you,
Florian