diesel
Junior Member
Posts: 22
|
Post by diesel on Mar 16, 2014 11:52:17 GMT -8
I am trying to use full screen JPEGS for a GUI. I have them working on a smaller touch screen, and am excited to port them to the Gameduino2.
My issue is, I can get them to display properly in an "if loop". The problem is being displayed in this fashion, they slow down touch inputs, and if plotting button inputs and integer counts, they count very slow, and keep counting when not touching.
I think I can use 30k for my program if I don't have to redraw everything using circles, rectangles, and widgets. My theory is I can cut the program substantially by using the images as the buttons and such.
I am not calling Jpegs in setup, they never seem to load correct even using handles.
I have different code for the touch mapping, it isn't the issue.
If I write out the references to loading the Jpeg, the number is displayed, and when the mapped area is touched it counts to 65535 in just a few seconds, then rolls over as expected.
Any help in the right direction would be appreciated.
This is a code snippet. void loop() {
GD.Begin(BITMAPS);
GD.get_inputs();
int x1 = GD.inputs.x;
int y1 = GD.inputs.y;
if(widgets2){
widgets = false;
widgets3 = false;
GD.Clear();
GD.Vertex2ii(0, 0);
GD.cmd_loadimage(0, 0);
GD.load("openscr.jpg");
GD.cmd_number(240, 20, 30, OPT_CENTER | 5, count);
if ((y1>=220) && (y1<=271) && (x1>=200) && (x1<=280)){
count = count + 100;
}
} GD.swap();
}
|
|
diesel
Junior Member
Posts: 22
|
Post by diesel on Mar 16, 2014 11:58:44 GMT -8
By the way, I tried just making it into a void, so it is only called once in the loop, it is displayed, then cleared. GD.swap(), doesn't seem to make any difference.
|
|
|
Post by jamesbowman on Mar 16, 2014 12:43:17 GMT -8
The code seems to be loading the JPEG from storage every time through the loop. Instead you can load the JPEG in setup() and just *draw* it in loop().
void setup() {
... GD.cmd_loadimage(0, 0); GD.load("openscr.jpg"); }
|
|
diesel
Junior Member
Posts: 22
|
Post by diesel on Mar 16, 2014 13:14:52 GMT -8
Thanks, James
I have tried it in that fashion, but I have many jpegs that I will be using. If I put them all in setup in only loads the last one. I may have 30-40 full screen jpegs to use...
I have loaded them in setup and assigned handles to them as well to no avail.
Is their any means to use a rgb565 converter to .raw data, from an SD and display it that way?
|
|
diesel
Junior Member
Posts: 22
|
Post by diesel on Mar 16, 2014 14:50:00 GMT -8
I added a optimized 1250 millis non blocking delay to image load, it helped, but the count increment is about 1 second per number. This may be useful to someone who isn't flexible and must add some sort of function over an existing uncompressed full screen jpeg. Their may be other ways around the problem, but I am moving on.
I am excited at how fast coded graphics and widgets react and load on the GD2, but just a little bummed out about the jpegs.
I have spent hundreds of hours on these graphic images that won't jive with GD2, never the less, looks like the good will easily outweigh the bad in this situation.
|
|