TftBmpScreenshotSd1()

Parent Previous Next

TftBmpScreenshotSd1(sFileName As String * 12, wX_Pos As Word, wY_Pos As Word, wWidth As Word, wHeight As Word), Byte


sFileName: The name of the BMP file to create on the SD card, including the extension. Must be 12 characters or fewer, including the dot and file extension.

wX_Pos: The x-coordinate of the lower-left corner of the screenshot area.

wY_Pos: The y-coordinate of the lower-left corner of the screenshot area.

wWidth: The width of the screenshot area.

wHeight: The height of the screenshot area.


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


Capture a screenshot using bi-directional SDA Pin and save it as a BMP file on the SD card.


This procedure captures a screenshot from the designated area of the TFT screen, specified by (wX_Pos, wY_Pos, wWidth, wHeight), and saves it as a new BMP file on the SD card. The screenshot can be cropped by adjusting the parameters.


Example:

TftBmpScreenshotSd1("PIC001.BMP", 0,0, 320,240)


Note: For TFT screens using SPI transfer lines, not all have separate MISO (Master In Slave Out) and MOSI (Master Out Slave In) lines. Some screens use a single bi-directional SDA (Serial Data) line for both input and output. In such cases, you must use the dedicated bi-directional SDA line functions provided in the library to read data from the screen.



    Clear

    SetCrystal()

    SetPins()

    TftBmpMemSet()

    TftSetUp(0)

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

    TftSetSndFont(4,0)

    TftPrintSndString("Hello Positron World",1,0,14,1,RED,WHITE,1)

    TftSetSndFont(0,0)

    TftPrintSndString("(0;0)",1,1,1,1,WHITE,RED,0)

    TftLineHNG(2,170,2,GREEN,RED)

    TftPrintSndChar("X",1,175,2,0,BLACK,RED,0)

    TftLineVNG(2,2,170,GREEN,BLUE)

    TftPrintSndChar("Y",1,2,175,0,BLACK,RED,0) 

    SPI1STAT = 0x0000 : SPI2STAT = 0x0000  '|Lower SPI baud rate 

    SPI1CON1 = 0x0323 : SPI2CON1 = 0x0323  '|for TFT screen read

    SPI1BUF = 0       : SPI2BUF = 0        '|Clear buffer

    SPI1STAT = 0x8000 : SPI2STAT = 0x8000  '|and SD Card write

    TftBmpScreenshotSd("Screen1.BMP", 0,0, 320,240)

    SPI1STAT = 0x0000 : SPI2STAT = 0x0000  '|Restore SPI baud rate 

    SPI1CON1 = 0x033B : SPI2CON1 = 0x033B  '|to default values i.e. 

    SPI1BUF = 0       : SPI2BUF = 0        '|Clear buffer

    SPI1STAT = 0x8000 : SPI2STAT = 0x8000  '|maximum read speed






Created with the Personal Edition of HelpNDoc: Powerful and User-Friendly Help Authoring Tool for Markdown Documents