SptFromSD()

 visits
Parent Previous Next

Syntax

SptFromSD(sFileName As sStringParameter1, bBuffer As bTftLibParameter1, bTransparent As bTftLibParameter2, wAlphaColor As wTftLibParameter1, bOverlay As bTftLibParameter3), Byte

Overview

Loads a BMP image from an SD card file into a sprite buffer for further processing or for later rendering to the TFT display.
When transparent mode is enabled, any pixel matching the specified alpha color is skipped, preserving the existing pixels already present in the sprite buffer.
If an overlay mode is selected, it is applied in accordance with the transparency rule.

Parameters

Parameter

Description

sFileName

File name of the image to load. Must be in 8.3 format and shorter than 13 characters, including the dot and file extension.

bBuffer

Sprite buffer index into which the image data will be loaded.

bTransparent

Specifies whether transparency is enabled:
0 – Normal load (no transparency)
1 – Transparent load (pixels matching wAlphaColor are skipped)

wAlphaColor

Alpha color value used when transparent loading is enabled.

bOverlay

Pixel overlay effect applied during the load operation:
0 – NONE: Direct pixel replacement
1 – OR: Bitwise OR; lightens overlapping areas
2 – AND: Bitwise AND; keeps only common bits
3 – XOR: Bitwise XOR; highlights differences
4 – NAND: Inverted AND; brightens overlap zones
5 – NOR: Inverted OR; produces darker overlays
6 – XNOR: Keeps pixels where both match; strong masking effect
7 – ADD: Adds color values; brightens overlapping regions
8 – SUB: Subtracts color values; darkens overlapping regions
9 – AVG: Averages colors; soft blending effect
10 – SCR: Screen blend (inverse multiply); brightens highlights
11 – MUL: Multiply blend; darkens overlapping areas
12 – CON: Contrast blend; enhances midtones using a non-linear mix

Return value

Value

Meaning

0

Operation completed successfully

1

No response from SD card

2

Card not formatted as FAT16 or FAT32

3

File not found

4

File is currently in use

5

Read/write error

6

Invalid buffer index

7

Buffer size is smaller than the file size

Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Review with HelpNDoc's Project Analyzer