1.8" LCD & Large BMP question.

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

1.8" LCD & Large BMP question.

Postby nam3ci » Wed Dec 05, 2012 3:53 am

Hello!

I've been searching the forum but have not found it. :(

I'm doing a project and need to show a portion of a large BMP in the 1.8 "LCD.

The idea is that from an image of a size (for example) of 1024 x 1024 pixels display only a region of 160x128 pixels giving x and y coordinates for any point in the image.

Anyone know how to create a function like found in the library that draws a BMP to do this?

Thank you!
User avatar
nam3ci
 
Posts: 3
Joined: Wed Dec 05, 2012 3:44 am

Re: 1.8" LCD & Large BMP question.

Postby pburgess » Wed Dec 05, 2012 6:46 pm

Have a look at the spitftbitmap sketch included with the current ST7735 LCD library. I've never specifically tested it against an image that large, but in theory it should handle the cropping OK.
User avatar
pburgess
 
Posts: 1408
Joined: Sun Oct 26, 2008 1:29 am

Re: 1.8" LCD & Large BMP question.

Postby nam3ci » Thu Dec 06, 2012 4:38 am

Ok. I'll try It.

I was using the old library . :wink:

Thank you!

**** EDIT ***

Image cropped correct at (0,0) position to screen size, now only I need to change origin position to another , for example (10,20) and show the image. It's seems easy changing "pos" in:

Code: Select all
if(flip) // Bitmap is stored bottom-to-top order (normal BMP)
            pos = bmpImageoffset + (bmpHeight - 1 - row) * rowSize;
          else     // Bitmap is stored top-to-bottom
            pos = bmpImageoffset + row * rowSize;
          if(bmpFile.position() != pos) { // Need seek?
            bmpFile.seek(pos);
            buffidx = sizeof(sdbuffer); // Force buffer reload
          }
User avatar
nam3ci
 
Posts: 3
Joined: Wed Dec 05, 2012 3:44 am

Re: 1.8" LCD & Large BMP question.

Postby nam3ci » Thu Dec 06, 2012 10:51 am

Solved!!!! :mrgreen:

In bmpDraw function I've changed:

Code: Select all
pos = bmpImageoffset + (bmpHeight - 1 - row) * rowSize;


by

Code: Select all
pos = ( bmpImageoffset + (orig_x * 3)) + (bmpHeight - 1 - ( row + orig_y)) * rowSize ;


Where orig_x and orig_y are the new origin for image.
User avatar
nam3ci
 
Posts: 3
Joined: Wed Dec 05, 2012 3:44 am


Return to Glowy things (LCD, LED, TFT, EL) purchased at Adafruit

Who is online

Users browsing this forum: Google [Bot] and 7 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [114]

Raspberry Pi[82]
 
FLORA[24]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[12]
Arduino[60]
 
NETduino[14]
 
BeagleBone[23]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[39]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[9]


 
Breakout Boards[35]
LCDs & Displays[49]
Components & Parts[70]
Batteries & Power[54]
EL Wire/Tape/Panel[52]
LEDs[112]
 
Wireless[16]
Cables[66]
 
Lasers[6]
Sensors/Parts[147]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[41]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[25]


 
Stickers[41]
 
Skill badges[55]
 
Books[26]
 
Circuit Playground[7]
 
Gift Certificates[4]