Page 1 of 1

Display a smaller section of a background image

Posted: Fri Jul 23, 2021 2:36 pm
by azstevep
I'm using EVE3 7" display 800x480 and I want to load a background image of 1024x768. I want to always display 800x480, but I want the display 0,0 position to start at some x offset and y offset. For example, I want 50,50 of the image to be shown at the 0,0 position of the display. Essentially, I want to the ability to pan across the image. Setting the image origin to (10,0) caused the image not to be display.

Has anyone had any experience with this? Is it possible?

Thanks,
Steve

Re: Display a smaller section of a background image

Posted: Sun Jul 25, 2021 7:31 am
by Rudolph
The VERTEX2F command takes signed values as arguments, so displaying 50,50 at 0,0 would be just VERTEX2F(-50,-50)
Yes ok, the exact value also depends on the pixel precision setup with VERTEX_FORMAT but I usually change that from the default value of 4 for 1/16 pixel precision to 0 for 1 pixel precision. And this also increases the range of VERTEX2F from -1024...1023 to -16384...16383.

I tried this both in EVE Screen Editor and in hardware with an EVE3-50G and it works.
This is the code for ESE:
BITMAP_HANDLE(0)
CMD_SETBITMAP(0, COMPRESSED_RGBA_ASTC_8x8_KHR, 1920, 1080)
VERTEX_FORMAT(0)
CLEAR(1, 1, 1)
BEGIN(BITMAPS)
VERTEX2F(-400, -200)
END()

Re: Display a smaller section of a background image

Posted: Mon Jul 26, 2021 9:17 pm
by azstevep
Thanks. That worked nicely.