Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 18:17 18 Jun 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

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

Author Message
tenij000
Newbie

Joined: 30/05/2025
Location: Netherlands
Posts: 16
Posted: 01:35am 18 Jun 2025
Copy link to clipboard 
Print this post

pic from sd card how do make it a background if place text on it disapears where text is get black background
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2557
Posted: 03:03am 18 Jun 2025
Copy link to clipboard 
Print this post

  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
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1213
Posted: 06:38am 18 Jun 2025
Copy link to clipboard 
Print this post

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)

'no comment
 
Print this page


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