Reverse images.

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

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
juliemac
 
Posts: 9
Joined: Mon Jan 27, 2014 8:50 pm

Reverse images.

Post by juliemac »

I have a Arduino Uno with a 2.4" TFT display.
Is it possible to reverse the image in a mirror config?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Reverse images.

Post by adafruit_support_mike »

In theory, sure. I don't think we have a function in the library to do it though.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Reverse images.

Post by pburgess »

The GFX library handles rotation but not mirroring. If you want to try adding it, look in the drawPixel() function in the device-specific library (not Adafruit_GFX, but the second, hardware-specific library for the LCD).

BIG_DMAN_V1
 
Posts: 2
Joined: Fri Feb 21, 2014 9:15 pm

Re: Reverse images.

Post by BIG_DMAN_V1 »

First off I must confess that I am new to all of this and am diving head long into a HUD project... (Best way to learn right?) And I could use some help with something which I'm sure is very easy to some but is frustrating me to no end.
pburgess wrote:The GFX library handles rotation but not mirroring. If you want to try adding it, look in the drawPixel() function in the device-specific library (not Adafruit_GFX, but the second, hardware-specific library for the LCD).
I have a SSD1306. I have seen your post on another thread (http://forums.adafruit.com/viewtopic.ph ... ip#p209517) .... and did as you suggested while also using the text portion of the example code only. (Other shapes and such removed from code.) It works fine for setTextsize(1) but that is much too small for my particular project and if I change the size to anything but 1 it goes back to normal. Is there something that I am missing here? Any help would be greatly appreciated. :D

Additionally I have tried changing the code in the getRoatation() section of the cpp file with the same outcome as above.

BIG_DMAN_V1
 
Posts: 2
Joined: Fri Feb 21, 2014 9:15 pm

Re: Reverse images.

Post by BIG_DMAN_V1 »

OK so as usual after I finally give up and ask for help I figured it out... :roll:
So I will post here for anyone else wanting to do this sort of thing. Just make sure you make a safe copy of the file first in case something should go wrong...(saves a download anyway :D )

No mods to the Adafruit_SSD1306.cpp file that I described above.

In the Adafruit_SSD1306.h file look for the lines:

#define SSD1306_COMSCANINC 0xC0
#define SSD1306_COMSCANDEC 0xC8

Change these lines to say:

#define SSD1306_COMSCANINC 0xC8
#define SSD1306_COMSCANDEC 0xC0

This reverses the display over the Y axis (would have liked to reverse over X so any further help would be appreciated... but since I am so early in the process the design can be adjusted for this.)

Hope this helps anyone in the future looking to do this kind of change.

If anyone has any suggestions as to how to do this in code or to flip it over the X axis that would be awesome and possibly save a lot of headaches for others.
Thanks!!

Locked
Please be positive and constructive with your questions and comments.

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