SptFromCode()

Parent Previous Next

SptFromCode(dwBmpAlias As dwTftLibParameter1, bBuffer As bTftLibParameter1, bTransparent As bTftLibParameter2, wAlphaColor As wTftLibParameter1, bOverlay As bTftLibParameter3), Byte


Load a BMP image stored in flash program memory into a sprite buffer for further processing or for later rendering to the TFT screen.

- If transparent mode is enabled, any pixels matching the specified Alpha Color are omitted, thereby preserving the existing pixels already present in the sprite buffer.

- If an overlay function is selected, it is applied in accordance with the transparency rule.


dwBmpAlias = Name of the BMP image table stored in flash memory

bBuffer = Sprite buffer index where the image data will be loaded

bTransparent

0 = Normal load (no transparency)

1 = Transparent load (pixels matching the alpha color are skipped)

wAlphaColor = Alpha color value used when transparent loading is enabled

bOverlay = Pixel overlay effect to apply during the load operation:

0 = NONE – No overlay; direct pixel replacement

1 = OR – Lightens overlapping areas (adds bits); merges bright regions

2 = AND – Keeps only common bits; intersection-style effect

3 = XOR – Highlights differences; toggles pixels where colors differ

4 = NAND – Inverts the intersection; brightens overlap zones

5 = NOR – Inverts the union; creates darker overlays

6 = XNOR – Keeps pixels unchanged where both match; strong masking effect

7 = ADD – Adds color values; brightens overlapping regions (light addition)

8 = SUB – Subtracts color values; darkens overlaps (shadow-like effect)

9 = AVG – Averages colors; produces a soft blending effect

10 = SCR – Screen blend (inverse multiply); brightens highlights

11 = MUL – Multiply blend; darkens overlapping areas (similar to Photoshop “Multiply”)

12 = CON – Contrast blend; enhances midtones with a non-linear mix


Result:

0 – Operation completed successfully

1 – Invalid buffer index

2 – Buffer is not fully within the allowed RAM space

3 – Buffer size is smaller than the image area to be copied

Created with the Personal Edition of HelpNDoc: Easily convert your WinHelp HLP help files to CHM with HelpNDoc's step-by-step guide