News:

;) This forum is the property of Proton software developers

Main Menu

www.picgraphic.com

Started by trastikata, Nov 12, 2024, 10:44 PM

Previous topic - Next topic

Mapo

fantastic work trastikata

Stephen Moss

Quote from: trastikata on Nov 19, 2025, 07:35 PMI am not sure if the library is actually being used by other people, but here's a sneaky preview of the new Version 2 that I am working on
I have not had time to do much PIC stuff recently or anything requiring graphics to date, but if I do it looks like it could be very useful, nice work.

JonW

Great work, it takes such a long time to produce these kinds of tools. 

Craig

Beautiful Trastikata Well done!

basparky

Awesome work! many thanks for sharing!

trastikata

#85

Dog.png Bug.png

Sneaky preview ...

"Bug" picture (RGB565 BMP), stored in FLASH as HEX data is overlay on RGB565 BMP "dog" background printed from SD card with addition of some text and the bug is moved around while rotated and applied transparency layer and background blending.

This is done on a 8b MCU - PIC18F67K22  :). How the actual user code looks like without the underlying library code:

Proc LoopVertical()
    wTempX = wOldPositionW
    wTempY = wOldPositionH
    Select bOrientation
        Case 0,1,7
            While wTempY < wNewPositionH  
                SptBmpOverSpt(Bug,BufferBug, wTempX,wTempY, 1,BLACK,0,9)                    'Print bug
                SptReadTft(wTempX,wTempY + bSpriteHeight, bSpriteWidth,1, BufferIn,0,0,0)   'Copy next line to Spt BufferIn
                SptShiftOut(BufferBug, 0,0,1,1, BLACK)                                      'Shift out lower line in BufferBug
                SptMergeOver(BufferIn,BufferBug, 0,bSpriteHeight - 1, 0,0,0)                'Copy over first line from BufferIn to BufferBug
                Inc wTempY                                                                  'Increment Y coordinate
            Wend
        Case 3,4,5
            While wTempY > wNewPositionH
                SptBmpOverSpt180(Bug,BufferBug, wTempX,wTempY, 1,BLACK,0,9)                 'Print bug
                SptReadTft(wTempX,wTempY - 1, bSpriteWidth,1, BufferIn,0,0,0)               'Copy next line to Spt BufferIn
                SptShiftOut(BufferBug, 0,0,0,1, BLACK)                                      'Shift out lower line in BufferBug
                SptMergeOver(BufferIn,BufferBug, 0,0, 0,0,0)                                'Copy over first line from BufferIn to BufferBug
                Dec wTempY                                                                  'Increment Y coordinate
            Wend
    EndSelect
    wOldPositionH = wNewPositionH
EndProc

Proc LoopHorizontal()
    wTempX = wOldPositionW
    wTempY = wOldPositionH
    Select bOrientation
        Case 1,2,3
            While wTempX < wNewPositionW 
                SptBmpOverSpt270(Bug,BufferBug, wTempX,wTempY, 1,BLACK,0,9)                 'Print bug
                SptReadTft(wTempX + bSpriteWidth,wTempY, 1,bSpriteHeight, BufferIn,0,0,0)   'Copy next line to Spt BufferIn
                SptShiftOut(BufferBug, 1,1,0,0, BLACK)                                      'Shift out lower line in BufferBug
                SptMergeOver(BufferIn,BufferBug, bSpriteWidth - 1,0, 0,0,0)                 'Copy over first line from BufferIn to BufferBug
                Inc wTempX                                                                  'Increment X coordinate
            Wend
        Case 5,6,7
            While wTempX > wNewPositionW 
                SptBmpOverSpt90(Bug,BufferBug, wTempX,wTempY, 1,BLACK,0,9)                  'Print bug
                SptReadTft(wTempX - 1,wTempY, 1,bSpriteHeight, BufferIn,0,0,0)              'Copy next line to Spt BufferIn
                SptShiftOut(BufferBug, 0,1,0,0, BLACK)                                      'Shift out lower line in BufferBug
                SptMergeOver(BufferIn,BufferBug, 0,0, 0,0,0)                                'Copy over first line from BufferIn to BufferBug
                Dec wTempX                                                                  'Increment X coordinate
            Wend
    EndSelect
    wOldPositionW = wNewPositionW
EndProc   

trastikata

Hello all,

Just a quick note to let you know that TFT Graphic Library 2 is now available at:

www.picgraphic.com

I hope it will be useful to fellow Positron users.
 

top204

That coding is incredible Dyanko, and many thanks.

The web site is excellent, and I really like the images and videos and demo code listing.

Best regards
Les

Frizie

Must be a lot of work Dyanko!  :o
Ohm sweet Ohm | www.picbasic.nl

Craig

Really a Beautiful Job Dyanko many thanks!

Abdullah

Quote from: trastikata on Feb 08, 2026, 06:13 PM

Dog.png Bug.png

Sneaky preview ...

"Bug" picture (RGB565 BMP), stored in FLASH as HEX data is overlay on RGB565 BMP "dog" background printed from SD card with addition of some text and the bug is moved around while rotated and applied transparency layer and background blending.

This is done on a 8b MCU - PIC18F67K22  :). How the actual user code looks like without the underlying library code:

Proc LoopVertical()
    wTempX = wOldPositionW
    wTempY = wOldPositionH
    Select bOrientation
        Case 0,1,7
            While wTempY < wNewPositionH   
                SptBmpOverSpt(Bug,BufferBug, wTempX,wTempY, 1,BLACK,0,9)                    'Print bug
                SptReadTft(wTempX,wTempY + bSpriteHeight, bSpriteWidth,1, BufferIn,0,0,0)   'Copy next line to Spt BufferIn
                SptShiftOut(BufferBug, 0,0,1,1, BLACK)                                      'Shift out lower line in BufferBug
                SptMergeOver(BufferIn,BufferBug, 0,bSpriteHeight - 1, 0,0,0)                'Copy over first line from BufferIn to BufferBug
                Inc wTempY                                                                  'Increment Y coordinate
            Wend
        Case 3,4,5
            While wTempY > wNewPositionH
                SptBmpOverSpt180(Bug,BufferBug, wTempX,wTempY, 1,BLACK,0,9)                 'Print bug
                SptReadTft(wTempX,wTempY - 1, bSpriteWidth,1, BufferIn,0,0,0)               'Copy next line to Spt BufferIn
                SptShiftOut(BufferBug, 0,0,0,1, BLACK)                                      'Shift out lower line in BufferBug
                SptMergeOver(BufferIn,BufferBug, 0,0, 0,0,0)                                'Copy over first line from BufferIn to BufferBug
                Dec wTempY                                                                  'Increment Y coordinate
            Wend
    EndSelect
    wOldPositionH = wNewPositionH
EndProc

Proc LoopHorizontal()
    wTempX = wOldPositionW
    wTempY = wOldPositionH
    Select bOrientation
        Case 1,2,3
            While wTempX < wNewPositionW 
                SptBmpOverSpt270(Bug,BufferBug, wTempX,wTempY, 1,BLACK,0,9)                 'Print bug
                SptReadTft(wTempX + bSpriteWidth,wTempY, 1,bSpriteHeight, BufferIn,0,0,0)   'Copy next line to Spt BufferIn
                SptShiftOut(BufferBug, 1,1,0,0, BLACK)                                      'Shift out lower line in BufferBug
                SptMergeOver(BufferIn,BufferBug, bSpriteWidth - 1,0, 0,0,0)                 'Copy over first line from BufferIn to BufferBug
                Inc wTempX                                                                  'Increment X coordinate
            Wend
        Case 5,6,7
            While wTempX > wNewPositionW 
                SptBmpOverSpt90(Bug,BufferBug, wTempX,wTempY, 1,BLACK,0,9)                  'Print bug
                SptReadTft(wTempX - 1,wTempY, 1,bSpriteHeight, BufferIn,0,0,0)              'Copy next line to Spt BufferIn
                SptShiftOut(BufferBug, 0,1,0,0, BLACK)                                      'Shift out lower line in BufferBug
                SptMergeOver(BufferIn,BufferBug, 0,0, 0,0,0)                                'Copy over first line from BufferIn to BufferBug
                Dec wTempX                                                                  'Increment X coordinate
            Wend
    EndSelect
    wOldPositionW = wNewPositionW
EndProc   

Hello sir
It's very beautiful good luck
Abdullah

trastikata

#91
Here's a guide how to use the SD section only of the TFT Library:

The PIC TFT Library is a library for TFT screens and the SD support is only part of the Library. You can download the entire library from the link at the top of the home page here.

- After downloading and unzipping it, the main folder "TftLib" should be in the main project folder. You can remove the font files from the font folders to reduce the total folder size, but keep the folders because the set-up tool will complain if those are missing, however it will still work.

TFT_LIB_SD_SETUP2.jpg

- In the main folder "TftLib" you can find the set-up tool "TFT_Graphic_Lib.exe", start it.
-- select the type of MCU being used i.e. 8b or 16b
-- select which sections you'd like to use i.e. "SD Card"
-- select "FAT System" to FAT16/32
-- select the communication method i.e. hardware SPI (SPI1 or SPI2) or software SPI
-- fill the required pin fields

TFT_LIB_SD_SETUP1.jpg

This will generate the required includes, which you can copy and paste at the top of the program listing after the "Declare" statements.

TFT_LIB_SD_SETUP3.jpg

After that you can use it as you have used the original FileSys24, and this library version supports 8b MCU too - note that hardware SPI is supported only for the older 8b devices, adding HW SPI for the newer 8b devices is on the "to do list", until then you can use the SD part in Software SPI mode when used with newer 8b PICs.

At the Library website you can find help how to use each command with some explanation. Here's an example listing file.

SD_Demo.zip


Frizie

Very nice Trastikata!
What a lot of work this must have been.  :o
I do not use TFT screens (yet), but I am adding this to my Favorites.
Ohm sweet Ohm | www.picbasic.nl