Display a smaller section of a background image

FTDI/Bridgetek EVE2 & EVE3 & EVE4 SPI TFT Series by Matrix Orbital

Moderator: Mods

Post Reply
azstevep
LCD?
Posts: 3
Joined: Thu Dec 24, 2020 10:41 am

Display a smaller section of a background image

Post 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

Rudolph
LCD Guru
Posts: 67
Joined: Wed Feb 28, 2018 11:09 am

Re: Display a smaller section of a background image

Post 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()

azstevep
LCD?
Posts: 3
Joined: Thu Dec 24, 2020 10:41 am

Re: Display a smaller section of a background image

Post by azstevep »

Thanks. That worked nicely.

Post Reply