TftBmpFromSD()

Parent Previous Next

TftBmpFromSD(sFileName As String * 12, wX_Pos As Word, wY_Pos As Word), Byte 


sFileName: The file name of the BMP image to print (max 12 characters, including the file extension).

wX_Pos: The X position of the lower left corner of the image on the screen.

wY_Pos: The Y position of the lower left corner of the image on the screen.


Return Status:

• 0: No error

• 1: No response from SD card

• 2: SD card not formatted with FAT16 or FAT32

• 3: File not found

• 4: File is in use

• 5: Read/write error


Print BMP File from SD Card (FAT16/FAT32)


This procedure prints a BMP file from an SD card formatted with FAT16 or FAT32. The BMP file must meet specific requirements as no image processing is performed.


BMP File Requirements:

• The image must be smaller than the screen width and height.

• The color depth should be 16-bit RGB (565).

• The row direction should be bottom to top (default).

• No compression.

You can convert images to the correct format using online tools, such as this one. 

Alternatively, you can use the included SdCardWriteRGB565 library tool to convert and upload the BMP file to the SD card.


Example:

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


Note: No need to initialize the SD card with File_Init() before using this command.


TftSetUp(0)

TftBmpFromSD("cat.bmp", 0,0)

DelayMS 1000

TftBmpFromSD("dog.bmp", 0,0)

DelayMS 1000

TftBmpFromSD("button.bmp", 73,85)

TftBmpFromSD("button.bmp", 130,165)






Created with the Personal Edition of HelpNDoc: Why Microsoft Word Isn't Cut Out for Documentation: The Benefits of a Help Authoring Tool