Powerbasic Museum 2020-B

IT-Consultant: Patrice Terrier => SDK Programming => Topic started by: Patrice Terrier on November 09, 2016, 05:58:18 PM

Title: Animated PNG
Post by: Patrice Terrier on November 09, 2016, 05:58:18 PM
PNGanim

Is a WinLIFT/GDImage visual utility to display and adjust the animation speed of ani_PNG FILES.

(http://www.objreader.com/download/demo/PNGanim.png)

The animation speed could range between 1 to 100 milliseconds (GetTickCount).

Note: The whole concept of this new PNG animation format is explained here. (http://www.objreader.com/index.php?topic=69.0)
with plainty of PNG animated files there. (http://www.objreader.com/index.php?topic=67.0)


The PowerBASIC 32-bit code is attached to this post altogether with 1 PNG animation file.

Title: Animated PNG (updated)
Post by: Patrice Terrier on November 10, 2016, 06:59:26 PM
I just post a new version of the PNGanim.exe utility to display and adjust the animation speed of ani_PNG FILES.

New feature:
- Frame count display

Fix:
- To avoid unespected resizing when moving the PNGanim.exe window to the edges.
Handling of WM_MOVING message has been added, to keep the window within the bounds of the working area

    case %WM_GETMINMAXINFO
         pMM = lParam
         @pMM.ptMinTrackSize.x = gP.MinTrackSizeW
         @pMM.ptMinTrackSize.y = gP.MinTrackSizeH
         function = 0: exit function

    case %WM_MOVING '// Keep the window into the working area
         hMonitor = MonitorFromWindow(hWnd, %MONITOR_DEFAULTTONEAREST)
         lpr = lParam
         if (@lpr.nTop < 0) then @lpr.nTop = 0
         @lpr.nRight = @lpr.nLeft + gP.MinTrackSizeW
         @lpr.nBottom = @lpr.nTop + gP.MinTrackSizeH
         tmi.cbSize = sizeof(tmi)
         if (GetMonitorInfo(hMonitor, tmi)) then
             if (@lpr.nBottom > tmi.rcWork.nBottom) then
                 @lpr.nBottom = tmi.rcWork.nBottom
                 @lpr.nTop = @lpr.nBottom - gP.MinTrackSizeH
             end if
         end if
         function = %TRUE: exit function;


The 64-bit version is available there. (http://www.objreader.com/index.php?topic=69.msg309#msg309)

If you have questions or comments about it, please post them here.

...