Menu
JAQForum Ver 19.10.27

Forum Index : Microcontroller and PC projects : pic from sd card how do make it a background if place text on it disap

Posted: 01:35am
18 Jun 2025
Copy link to clipboard
tenij000
Newbie

pic from sd card how do make it a background if place text on it disapears where text is get black background
 
Posted: 03:03am
18 Jun 2025
Copy link to clipboard
phil99
Guru


  Quote  TEXT x, y, string$ [,alignment$] [, font] [, scale] [, c] [, bc]
'c' is the drawing colour and 'bc' is the background colour. They are optional and default to the current foreground and background colours.
If your display supports transparent text set bc to -1.
If not using other optional parameters you still need a coma to show where they belong.
Eg TEXT x, y, string$ , , , , , -1
  Quote  Transparent Text
The VGA or HDMI video output or LCD displays using the SSD1963, ST7796S, ILI9341, ST7789_320, or ILI9488 with MISO connected are capable of transparent text.
In this case the TEXT command will allow the use of -1 for the background colour. This means that the text is drawn over the background with the background image showing through the gaps in the letters.

The catch is when you change the text it will be on top of the old text so the total number of characters needs to be the same by adding leading or trailing spaces to equal the longest line.
eg
txt1$ = "Hello World"
txt2$ = "  Earth    "

This works for VGA mode 1 but for colour modes you will need to save an image of the area where the text is going to be (before running the program perhaps) with:-
SAVE IMAGE file$, x, y, w, h
and load that image before changing the text.
> gui test lcdpanel 'stop with Ctrl-C to retain image
> save image "txtspace.bmp", 99,99,99,15
> text 99,99,"Hello World",,,,,-1
> load image "txtspace.bmp", 130,99 :text 99,99,"Earth",,,,0,-1
>

Edited 2025-06-18 15:27 by phil99
 
Posted: 06:38am
18 Jun 2025
Copy link to clipboard
Martin H.
Guru


using Layer:
MODE 2:CLS
FRAMEBUFFER layer
Load image "BG.BMP"
FRAMEBUFFER write L
CLS
text 99,99,"Hello World"
do:loop until Inkey$=chr$(27)
 


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025