Sign in to follow this  
Followers 0
gesher

apng

5 posts in this topic

es posible usar un png animado con autoit??? asi como el gif

it is possible to use an animated PNG with AutoIt??? like the gif

:)

Share this post


Link to post
Share on other sites



Currently no you can't,

But yes you could do it using GDI+ and file reading.

You would first need to read the APNG data chuncks so you can feed GDI+ the correct frame data.

It would take a little effort, but it would be fully possible from the APNG specifications I just read.

Cheers

Share this post


Link to post
Share on other sites

gesher

This seems a trick, but works:

; Animated Gif
; Author - gafrost

Opt("MustDeclareVars", 1)
#include <IE.au3>

_Main()

Func _Main()
    Local $pheight = 50, $pwidth = 50, $oIE, $GUIActiveX, $gif
    $gif = FileOpenDialog("Select Animated Gif", @ScriptDir, "gif files (*.gif)", 3)
    If @error Then Exit
    _GetGifPixWidth_Height($gif, $pwidth, $pheight)
    $oIE = ObjCreate("Shell.Explorer.2")
    GUICreate("Embedded Web control Test", 640, 580)
    $GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, $pwidth, $pheight)
    $oIE.navigate ("about:blank")
    While _IEPropertyGet($oIE, "busy")
        Sleep(100)
    WEnd
    $oIE.document.body.background = $gif
    $oIE.document.body.scroll = "no"
    GUISetState()
    While GUIGetMsg() <> -3
    WEnd
EndFunc   ;==>_Main

Func _GetGifPixWidth_Height($s_gif, ByRef $pwidth, ByRef $pheight)
    If FileGetSize($s_gif) > 9 Then
        Local $sizes = FileRead($s_gif, 10)
        ConsoleWrite("Gif version: " & StringMid($sizes, 1, 6) & @LF)
        $pwidth = Asc(StringMid($sizes, 8, 1)) * 256 + Asc(StringMid($sizes, 7, 1))
        $pheight = Asc(StringMid($sizes, 10, 1)) * 256 + Asc(StringMid($sizes, 9, 1))
        ConsoleWrite($pwidth & " x " & $pheight & @LF)
    EndIf
EndFunc   ;==>_GetGifPixWidth_Height

:)

Share this post


Link to post
Share on other sites

So you disappear for NINE months and when you come back you tell us you didn't spend the slightest effort to do anything yourself? You must be the laziest man alive.

Anyway, to read files you use FileRead(). To decode it into something useful, read about the technical details in the Wikipedia article you stole that image from.

Share this post


Link to post
Share on other sites

and to get started?

89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52 .PNG........IHDR

00 00 00 01 00 00 00 01 08 02 00 00 00 90 77 53 ..............wS

DE 00 00 00 0E 49 44 41 54 78 DA 62 F8 CF C0 00 Þ....IDATxÚbøÏÀ.

10 60 00 03 01 01 00 66 FD 9F 24 00 00 00 00 49 .`.....fý.$....I

45 4E 44 AE 42 60 82 END®B`.

I have no idea how to read, these data

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0