TftPrintSndInteger()

Library Description ›› Fonts ›› SND ››
Parent Previous Next

TftPrintSndInteger(sdInteger As SDword, bDigits As Byte, bFontSize As Byte, wX_Pos As Word, wY_Pos As Word, pPosition As Bit, wForeColor As Word, wBackColor As Word, pTransparent As Bit)


sdInteger = signed integer value to print

bSigDigits = number of significant digits to print

• If bSigDigits is larger than the number of significant digits, leading zeros 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 automatically determined.

bFontSize = font size

• 0 or 1 = nominal size

• 2, 3, 4, ... = multiples of the nominal size

wX_Pos = x position (absolute) for the lower left corner of the first character

wY_Pos = y position (absolute) for the lower left corner of the first character

pPosition = position type for the lower left corner of the character

• 0 = absolute, actual pixel position on the TFT screen (e.g., wX_Pos = 152, wY_Pos = 86)

• 1 = relative, based on the virtual division of the TFT screen into columns and rows (calculated by FontPixels and FontSpace) (e.g., wX_Pos = 5, wY_Pos = 2; with FontPixels = 8 and FontSpace = 9, the actual position would be x = 5 * 8 = 40; y = 2 * 9 = 18)

wForeColor = character color in 16-bit RGB565 format - used for the glyph pixels

wBackColor = background color in 16-bit RGB565 format - used for empty pixels within the glyph's bounding box

pTransparent = transparency option

• 1 = Yes (use transparency)

• 0 = No (use background color)


Print a signed integer using SND font.


Example:

TftPrintSndInteger(-12345, 7, 2, 1, 1, 0, WHITE, BLACK, 0)


Note:

-Background color (wBackColor) will be ignored if transparency is enabled, and only the pixels from the glyph will be printed. However, this approach is slower than using a background color.

-For specific formatting, you can use built-in functions in Positron's Str$... and print the resulting string using TftPrintSndString().

-Refer to TftPrintBdfInteger() and TftPrintSndString() for example parameter usage.


$define FontSmooth           0

$define FontMaxSpace         16

$define FontMaxPixels        16

Include "TftLib\Fonts\SND\F51_SND_48x72_Digits_Sixteen_Segment.inc"

Include "TftLib\TFT_Graphic_Lib.inc"

'...

TftSetUp(0)

TftSetSndFont(51,0)

TftBmpFromSD("Cat.BMP", 0,0)

TftPrintSndInteger(1234, 0, 0, 10, 10, 0, YELLOW, BLUE, 0)

TftPrintSndInteger(1234, 0, 0, 100, 100, 0, GREEN, BLUE, 1)






Created with the Personal Edition of HelpNDoc: Import and export Markdown documents