TftPrintBdfInteger()

Library Description ›› Fonts ›› BDF ››
Parent Previous Next

TftPrintBdfInteger(sdInteger As SDword, bDigits As Byte, wX_Pos As Word, wY_Pos As Word, wForeColor As Word, wBackColor As Word, pTransparent As Bit)


sdInteger: The signed integer value to print.

bSigDigits: The number of significant digits to print:

• If bSigDigits is larger than the number of significant digits, leading zeroes will be added.

• If bSigDigits is smaller than the number of significant digits, only bSigDigits digits will be printed.

• If bSigDigits = 0, the number of significant digits will be determined automatically.

wX_Pos: The absolute X position of the character's lower-left corner.

wY_Pos: The absolute Y position of the character's lower-left corner.

wForeColor: The 16-bit RGB565 color for the character (used for the active pixels in the glyph).

wBackColor: The 16-bit RGB565 color for the background (used for the empty pixels in the glyph box).

pTransparent: Whether to use transparency:

• 1: Yes (only active pixels are printed, preserving the background).

• 0: No (inactive pixels are filled with the background color).


Print a signed integer using BDF font.


Example:

TftPrintBdfInteger(-12345, 7, 1, 1, WHITE, BLACK, 0)


Note: When transparency is used, the background color (wBackColor) is ignored, and only the active pixels of the glyph are printed. This is slower than using the background color.

For specific formatting, you can use Positron’s Str$ functions to format the integer as a string and then print it using TftPrintBdfString()


Include "TftLib\Fonts\SND\F5_BDF_Sail-Regular-25.inc"

'....

TftSetUp(0)

TftSetBdfFont(5)

TftResetScreen(BLUE)        

TftPrintBdfInteger(-12345, 0, 10, 10, WHITE, BLACK, 1)

TftPrintBdfInteger(-12345, 7, 10, 40, WHITE, BLACK, 1)

TftPrintBdfInteger(-12345, 3, 10, 70, WHITE, BLACK, 1)

TftPrintBdfInteger(8765, 0, 10, 100, WHITE, BLACK, 0)

TftPrintBdfInteger(8765, 8, 10, 130, WHITE, BLACK, 0)

TftPrintBdfInteger(8765, 3, 10, 160, WHITE, BLACK, 0)






Created with the Personal Edition of HelpNDoc: Elevate Your Documentation with HelpNDoc's Project Analyzer Features