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