Hi,
Hope someone can help.
I've got my ESP32 with GC9A01 now working and can acess the display with some basic uniform graphics, e.g. fill screen, checker pattern basic, shapes created in simple loops.
I'm now trying to load images. The GC9A01 uses 12, 16 or 18bit graphics whcih means using (at least for the start) a tool to take a 24bit image and create a n 18bit image, which I've done. The tool produces a C array as follows which I've embeded as inline code along with some additonal code:
and I call a small B4R routine to load this into a B4R array which I can then use to write to the display
I have two problems:
1. With 'const unsigned char...' it fails to compile with error "error: invalid conversion from 'const void*' to 'void*' [-fpermissive]", but it at least compiles without the 'const'
2. The size of the B4R array is only 51592 (both from mySize and SizeOf(myImage) when the C array is 117128
I know its me, but if anyone could advise that would be great.
Thanks
Dave
Hope someone can help.
I've got my ESP32 with GC9A01 now working and can acess the display with some basic uniform graphics, e.g. fill screen, checker pattern basic, shapes created in simple loops.
I'm now trying to load images. The GC9A01 uses 12, 16 or 18bit graphics whcih means using (at least for the start) a tool to take a 24bit image and create a n 18bit image, which I've done. The tool produces a C array as follows which I've embeded as inline code along with some additonal code:
B4X:
#if C
const unsigned char gImage_MickyMouse[117128] = { 0X00,0X20,0XF0,0X00,0X7A,0X00,0X00,0XE4,
0XFF,0XFF,0XFF,0X00,0XFF,0XFF,0XFF,0X00,0XFF,0XFF,0XFF,0X00,0XFF,0XFF,0XFF,0X00,
......etc
......etc
};
void Load_Image(B4R::Object* o)
{
b4r_image::_myimage->data = gImage_MickyMouse;
b4r_image::_myimage->length = sizeof(gImage_MickyMouse);
b4r_image::_mysize = sizeof(gImage_MickyMouse);
}
#End If
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public myImage() As Byte
Public mySize As UInt
End Sub
Public Sub Load_Image
RunNative ("Load_Image", Null)
End Sub
1. With 'const unsigned char...' it fails to compile with error "error: invalid conversion from 'const void*' to 'void*' [-fpermissive]", but it at least compiles without the 'const'
2. The size of the B4R array is only 51592 (both from mySize and SizeOf(myImage) when the C array is 117128
I know its me, but if anyone could advise that would be great.
Thanks
Dave