TftBmpFromCodeClip()

Library Description ›› System ››
Parent Previous Next

TftBmpFromCodeClip(dwBmpAlias As dwTftLibParameter1, wOriginX As wTftLibParameter1, wOriginY As wTftLibParameter2, wBmpOriginX As wTftLibParameter3, wBmpOriginY As wTftLibParameter4, wBmpWidth As wTftLibParameter5, wBmpHeight As wTftLibParameter6, bTransparent As bTftLibParameter1, wAlphaColor As wTftLibParameter7, bOverlay As bTftLibParameter2)


Description:

Prints a clipped region of a BMP image stored in program flash memory to the TFT screen, with optional transparency and pixel overlay effects.


Parameters:

dwBmpAlias - Alias of the BMP image table stored in program flash memory.

wOriginX - X coordinate of the bottom-left corner on the TFT screen where the image will be drawn.

wOriginY - Y coordinate of the bottom-left corner on the TFT screen where the image will be drawn.

wBmpOriginX - X coordinate of the bottom-left corner of the image region to be read from memory.

wBmpOriginY - Y coordinate of the bottom-left corner of the image region to be read from memory.

wBmpWidth - Width of the clipped image region to be printed.

wBmpHeight - Height of the clipped image region to be printed.

bTransparent - Transparency mode selection:

0 = Normal printing (no transparency)

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

wAlphaColor - Color value used as the transparency (alpha) key when transparent printing is enabled.

bOverlay - Pixel overlay (blend) effect applied during rendering:

0 = NONE – No overlay; direct pixel replacement

1 = OR – Lightens overlapping areas; 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 – Preserves pixels where both match; strong masking effect

7 = ADD – Adds color values; brightens overlapping regions

8 = SUB – Subtracts color values; darkens overlaps (shadow 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 using a non-linear mix


Notes:

Processing order is: Transparency check → Overlay effect → Pixel output.

Transparent printing is slower because each pixel must be evaluated individually rather than using block transfers.

Overlay effects are slower because each destination pixel must be read, modified, and written back.

If the global TftPixelCheck flag is enabled, boundary checks are applied to both the source image and the screen destination:

If the image lies completely outside the visible screen area, nothing is drawn.

If the image is partially outside the visible area, it is automatically clipped to the screen boundaries.

Created with the Personal Edition of HelpNDoc: Generate Kindle eBooks with ease