Scroll Large Bitmap on TFT LCD

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello.  Those of you with Arduino and TFT display are probably well acquainted with the example that comes with most libraries that loads a bmp from sd card and displays it.  I decided to ad touchscreen functionality to this sketch.  Once the first image is loaded and displayed, the program waits for the user to tap the screen to load the next image.  After learning how to accept input from the touch screen, I decided to try something more exciting.  I wanted to load a full size image (one larger than the 320 by 240 display and tap the screen in the appropriate region to scroll in that direction.  I am working on scrolling to the left in portrait mode.  The program scrolls one screen width (240 pixels) to the left and displays the next section of the image.  But if I go beyond one screen width (if I tap again) the scan lines are jumbled and out of order and misplaced on the screen.  As if it has lost its place in the bmp file.  I just can't figure it out.  I have attached the code of the entire program.  If you put a large image on a sd card in a directory called "fullsize," you can try it out.  The code comes from the library MCUFRIEND_kbv for ili9341 2.4 lcd examples.  I am using a touch shield version with arduino uno.  A small edit will allow you to have the touchscreen enabled slide show for normal sized (240x320) images.  I already have that working.  I think the function showBMP is losing its place in the row/ column bits of the bmp file.  But I can't fix it.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your ILI9341 is 240x320.  i.e. vertical scrolling is always in the 320 direction.

 

As you have seen from the demo sketch hardware scrolling is top to bottom in Portrait mode.

And left to right in Landscape mode.

 

Most TFT controllers can do vertical scrolling.   Very few can scroll in both directions like the RA8875.

 

If you have a large bitmap on SD,   I suggest that you change to Landscape mode if you want to scroll left to right.

It should be possible to move the image smoothly with the hardware scroll.

 

If you have smooth scroll left to right,  you can't have it top to bottom or vice versa.    If you are determined to scroll an any direction,  buy a Raio RA8875.

 

If scroll speed is not important,  it should be easy to modify the showBMP(bmp, destX, destY) to showBMP(bmp, bmp_X, bmp_Y, destX, destY) i.e. read the BMP from a different start point.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the information.  If only these cheap TFTs on Ebay came with documentation.  The Raio RA8875 probably comes on larger, more expensive displays, as I haven't seen the small screens with this controller.  I'm still puzzled as to why I could scroll horizontally in portrait mode until x < -240.  I will probably upgrade to a larger display at some point.  Thank you for answering.