Page 1 of 3

Round display GC9A01

Posted: Thu Aug 24, 2023 10:15 am
by Fernando Perez
I bought two screens of this type on AliExpress at a really low price.
Running on Annex32 CAN 1.50.8 LFS and Wemos D1mini ESP32 without problems, with this setup:
image.png
image.png


Attached demo program. Amazing image quality, much better than what is seen in the video. It is due to problems with my camera and lighting.

Code: [Local Link Removed for Guests]

second = 0 : lastSecond = 0
h$ = "" : s$ = ""
background = tft.rgb(215,216,211)

tft.loadFont "/DS_DIGIB19pt7b.bin", 10
tft.loadFont "/DS_DIGIB27pt7b.bin", 11
tft.init 0
tft.fill 0
pause 3000

tft.jpg "/mosca.jpg"
pause 5000
tft.image "/Jo_van_Gogh.jpg"
pause 5000

tft.jpg "/casio.jpg"
gui.init 2
s = gui.textLine(157, 125, 45, 30, s$, 10, black, background, background)
h = gui.textLine(42, 117, 113, 38, h$, 11, black, background, background, ALIGN_MID_RIGHT, 2)
gosub displayHours

while 1
  second = val(right$(time$, 1))
  seconds = val(right$(time$, 2))
  if second <> lastSecond then gosub displaySeconds
  if seconds = 0 then gosub displayHours
wend  

displaySeconds:
  gui.settext s, right$(time$, 2)
  gui.refresh
  lastSecond = second
return  

displayHours:
  h$ = str$(val(left$(time$, 2))) + mid$(time$, 3, 3) ' pipsqueak
  gui.setText h, h$
  gui.refresh
return
GC9A01.zip
https://youtube.com/shorts/tfc9oxDMu5E?feature=share

Just two observations: I'm missing the tft.pixel(x, y, color) instruction and when I try to load a 32-bit bmp image with a transparent background, Annex doesn't detect it.

Re: Round display GC9A01

Posted: Thu Aug 24, 2023 11:33 am
by cicciocb
Ho Fernando,
the command is without the ()

Code: [Local Link Removed for Guests]

tft.pixel x, y, color
About the transparent color, all depends on what you define for transparent image.
Post it here and I'll check if your image has an alpha channel.

Re: Round display GC9A01

Posted: Thu Aug 24, 2023 2:58 pm
by Fernando Perez
True, Francesco, with that syntax tft.pixel works for me. I was confused because I can't find it in Help.
I upload a .bmp image that I think is 32 bit, 240x240 with a transparent background. At least, I set the alpha channel to 0, but my knowledge is very limited.
Europa32b.7z

Re: Round display GC9A01

Posted: Thu Aug 24, 2023 3:20 pm
by cicciocb
Yes, the command is missing in the help. I'll update the help.

About the image, the image is transparent but I don't understand what is the issue as the image is exactly the size of the TFT so the transparent part is outside the screen

Re: Round display GC9A01

Posted: Thu Aug 24, 2023 3:47 pm
by Fernando Perez
You are right the image is round and 240x240. It is not a good example.
But my problem is that when I load a 24 bit bmp image, it appears on the screen. The same image in 32 bits is ignored. It does not appear on the screen and there is no error message.

Code: [Local Link Removed for Guests]

tft.init 0
tft.fill 0

tft.bmp "/borron24.bmp", 0, 0  '  You can see it well
pause 1000
tft.fill blue
pause 1000
' Can't see anything, screen goes from blue to yellow background without transition:
tft.bmp "/borron32T.bmp", 0, 0, -1  ' 
pause 1000
tft.fill yellow
END

I'm almost sure the problem is that I can't make 32-bit transparent bmp images with the means I use, Paint Net.
I will try to install GIMP.

Re: Round display GC9A01

Posted: Fri Aug 25, 2023 8:23 am
by Fernando Perez
I've installed GIMP, created a 32-bit BMP image with a transparent background, and still get a black screen. I'm sorry to bother you so much, but can you post or send me an image of these characteristics that works for you? Thank you.

Re: Round display GC9A01

Posted: Fri Aug 25, 2023 8:47 am
by cicciocb
as soon as i'll have the time I'll test, maybe is not working.

Re: Round display GC9A01

Posted: Mon Aug 28, 2023 7:49 pm
by cicciocb
[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Fri Aug 25, 2023 8:23 am I've installed GIMP, created a 32-bit BMP image with a transparent background, and still get a black screen. I'm sorry to bother you so much, but can you post or send me an image of these characteristics that works for you? Thank you.
I tried your images and are not working.
So I tried to see how is coded and I discovered that the format 32bits actually implemented in Annex is not exactly the format that gimp exports, I did that some years ago and honestly I don't remember if I was using an older version of Gimp or another tool for the images.
Having said that, I just "patched" your image and it works (Is attached).
I think that is not practical to patch all the images (change the byte at address 0x1e from 3 to 0) :lol:
So I need to update a little bit annex to make it compatible with gimp. I'll include also the format 16 bits for more compact images.
As I did a deep learning on the bmp format recently, this is the good moment before I'll change completely the subject.

Re: Round display GC9A01

Posted: Mon Aug 28, 2023 8:47 pm
by Fernando Perez
Works! Beautiful.
What's more, I've dug up the "hexadecimal editor" function of my favorite editor, PSPad and I can make my images transparent with your instructions.
I don't know where you learn so many things...
Like always, thank you.
image.png
I take this opportunity to comment on how easy it is to create a screen to display QR codes and how well they look on this round TFT.

Code: [Local Link Removed for Guests]

background = tft.rgb(215,216,211)
tft.init 0
tft.fill background
for v = 1 to 15
  tft.qrcode "192.168.1.103", 33, 33, 170, v
  pause 3000
next v  

Re: Round display GC9A01

Posted: Thu Oct 19, 2023 7:33 pm
by Helmut_number_one
I can't use the code, in Annex32 CAN 1.50.8 LFS and in newer Firmware, TFT Int, TFT.TJPG and so on.