Announcement

Collapse

Maintenance

The forum could be offline for 30-60 minutes in the very near future for maintenance (said 3pm Pacific). I was behind on getting this notice. I do apologize.
See more
See less

Ani for custom/owndrawn controls

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ani for custom/owndrawn controls

    today tonight i quickly wrote a fragment, which wanted to do enough long time ago.
    main idea to display ani, first of all, in buttons.

    i found not very detail description of ani at wotsit.
    following code works on my pc under win2000 with some selected ani.
    guys, pls, let me know, if there are problems in any os/with any ani.

    code was moved to http://www.powerbasic.com/support/pb...ad.php?t=22932


    [this message has been edited by semen matusovski (edited february 18, 2001).]

  • #2
    Semen,

    there is no animation of globe.ani under Win98SE.

    Gerhard


    ------------------

    Comment


    • #3
      Nice piece of code, as usual, Semen. Will be fun to play around with.

      Gerhard, change hIcon(Seq(kStep) + 1) to hIcon(kStep) in WM_TIMER, and it
      will rotate, like this: (copy & paste ready)
      Code:
                     SendMessage CBHNDL, %WM_SETICON, %ICON_SMALL, hIcon(kStep)
                     SendMessage GetDlgItem(CBHNDL, 101), %STM_SETIMAGE, %IMAGE_ICON, hIcon(kStep)
      BTW, Semen. Tested in Win98 and with above change, it works.
      ------------------


      [This message has been edited by Borje Hagsten (edited February 17, 2001).]

      Comment


      • #4
        I rewrote it to make it work with my globe.ani.
        Globe.ani is in the binbas below..

        A few errors where solved, like using seg() in the repaint.

        Thanks for the code

        Code:
        #Compile Exe
           #Dim All
           #Register None
           #include "Win32Api.Inc"
        '   #include "PBDebug.Inc"
         
         
           $FileAni = "C:\VBWORK32\ANIICON\GLOBE.ANI"
        '   $FileAni = "C:\VBWORK32\ANIICON\HOURGLAS.ANI"
         
         
         
         
           Type ANIHEADER
               cbSizeOf  As Dword ' // Num bytes In AniHeader (36 bytes)
               cFrames   As Dword ' // Number of unique Icons In this cursor
               cSteps    As Dword ' // Number of Blits before the animation cycles
               cx        As Dword ' // reserved, must be zero.
               cy        As Dword ' // reserved, must be zero.
               cBitCount As Dword ' // reserved, must be zero.
               cPlanes   As Dword ' // reserved, must be zero.
               JifRate   As Dword ' // Default Jiffies (1/60th of a second) If rate chunk Not present.
               flags     As Dword ' // Animation Flag (see AF_ constants)
           End Type
         
           Type ICONDIR
              idReserved As Word ' // Reserved (must be 0)
              idType  As Word    ' // Resource Type (1 For icons)
              idCount As Word    ' // How many images?
           End Type
         
           Type ICONDIRENTRY
              bWidth As Byte         ' // Width, In Pixels, of the Image
              bHeight As Byte        ' // Height, In Pixels, of the Image
              bColorCount As Byte    ' // Number of colors In Image (0 If >=8bpp)
              bReserved As Byte      ' // Reserved ( must be 0)
              wPlanes As Word        ' // Color Planes
              wBitCount As Word      ' // Bits per pixel
              dwBytesInRes As Dword  ' // How many bytes In this resource?
              dwImageOffset As Dword ' // Where In the file is this image?
           End Type
         
           Union DwordString
              d As Dword
              s As String * 4
           End Union
         
           Function ConvertAni (sAni As String, cFrames As Dword, hIcon() As Dword, cSteps As Dword, Rate() As Dword, Seq() As Dword) As Long
              Dim pAniHeader As ANIHEADER Ptr, pAni As DwordString Ptr, pAniM As Dword, kFrame As Dword, Er As Dword
              Dim i As Long, j As Long
         
                             Dim pIconDir As ICONDIR Ptr
                             Dim IconDirEntry As ICONDIRENTRY Ptr
         
              cFrames = 0: cSteps = 0
              For i = 1 To 2
                 pAni = StrPtr(sAni): pAniM = pAni + Len(sAni)
                 Do
                    If pAni >= pAniM Then Exit Do
                    Select Case UCase$(@pAni.s)
         
         
                       Case "RIFF", "LIST": pAni = pAni + 8
        'msgbox "riff'"
         
                       Case "ACON", "INFO", "FRAM": pAni = pAni + 4
                       Case "INAM", "IART": pAni = pAni + 8 + 2 * Fix((@pAni[1].d + 1) / 2)
                       Case "ANIH"
                          pAniHeader = pAni + 8
                          If i = 1 Then
                             cFrames = @pAniHeader.cFrames
                             cSteps = @pAniHeader.cSteps
                             If (cFrames > 0) And (cSteps > 0) Then
                                ReDim hIcon(1 To cFrames) As Dword, Rate(1 To cSteps), Seq(1 To cSteps)
                                For j = 1 To cSteps: Rate(j) = @pAniHeader.JifRate: Next
                             Else
                                Er = 1
                             End If
                          End If
                          pAni = pAniHeader + @pAniHeader.cbSizeOf
                       Case "RATE"
                          If i = 2 Then
                             If @pAni[1].d <> 4 * cSteps Then Er = 1 Else _
                                For j = 1 To cSteps: Rate(j) = @pAni[1 + j].d: Next
                          End If
                          pAni = pAni + 8 + @pAni[1].d
                       Case "SEQ "
                          If i = 2 Then
                             If @pAni[1].d <> 4 * cSteps Then Er = 1 Else _
                                For j = 1 To cSteps: Seq(j) = @pAni[1 + j].d: Next
                          End If
                          pAni = pAni + 8 + @pAni[1].d
         
                       Case "ICON"
         
                          If i = 2 Then
         
                             pIconDir = pAni + 8
         
                             If @pIconDir.idCount <> 1 Then Er = 1: Exit Do
         
                             If kFrame >= cFrames Then Er = 1: Exit Do
                             Incr kFrame
         
                            IconDirEntry = pIconDir + SizeOf(@pIcondir)
         
                             hIcon(kFrame) = CreateIconFromResource(ByVal pIconDir + @IconDirEntry.dwImageOffset, _
                                @IconDirEntry.dwBytesInRes, 1, &H00030000&)
         
        'PBEdit_DebugPrint "kFrame " & Str$( kFrame ) & Str$( hIcon(kFrame) ) & Str$( @IconDirEntry.dwImageOffset )
         
         
                          End If
         
                          pAni = pAni + 8 + @pAni[1].d
         
         
                       Case Else
         
                          Er = 1: Exit Do
                     End Select
                  Loop
                  If cFrames = 0 Then Er = 1
                  If Er Then Exit For
               Next
               If kFrame <> cFrames Then Er = 1
               If Er Then
                  For i = 1 To kFrame
                     If hIcon(i) Then DeleteObject hIcon(i)
                  Next
                  cFrames = 0
               End If
               Function = Er
           End Function
         
           CallBack Function DlgProc
              Dim cFrames As Static Dword, hIcon(0) As Static Dword, cSteps As Static Dword, Rate(0) As Static Dword, Seq(0) As Static Dword
              Static kStep As Long
              Select Case CbMsg
                 Case %WM_INITDIALOG
                    Local lWidth As Long, lHeight As Long
                    Dialog Pixels CbHndl, 32, 32 To Units lWidth, lHeight
                    Control Add Image, CbHndl, 101, "", 5, 5, lWidth, lHeight
         
                    Dim sAni As String
                    Open $FileAni For Binary Shared As #1: Get$ #1, Lof(1), sAni: Close #1
                    If ConvertAni(sAni, cFrames, hIcon(), cSteps, Rate(), Seq()) Then
         
                       MsgBox "Problems"
                       PostMessage CbHndl, %WM_SYSCOMMAND, %SC_CLOSE, 0
         
                    Else
         
                        PostMessage CbHndl, %WM_TIMER, 1, 0
         
                    End If
         
                 Case %WM_TIMER
                    If CbCtl = 1 Then
        Beep
         
                       Incr kStep: If kStep > cSteps Then kStep = 1
         
        'PBEdit_DebugPrint "kStep " & Str$( kStep ) & Str$( hIcon(Seq(kStep) + 1) )  & Str$( hIcon(kStep) )
         
                       SendMessage CbHndl, %WM_SETICON, %ICON_BIG, hIcon(kStep)
        '               SendMessage CbHndl, %WM_SETICON, %ICON_SMALL, hIcon(Seq(kStep) + 1)
                       SendMessage GetDlgItem(CbHndl, 101), %STM_SETIMAGE, %IMAGE_ICON, hIcon(kStep)
                       SetTimer CbHndl, 1, Rate(kStep) * 1000 / 60, ByVal 0&
                    End If
                 Case %WM_DESTROY
                    KillTimer CbHndl, 1
                    Local i As Long
                    For i = 1 To cFrames
                       If hIcon(i) Then DeleteObject hIcon(i)
                    Next
              End Select
           End Function
         
           Function PbMain
              Local hDlg As Long
              Dialog New 0, "Ani", , , 50, 40, %WS_CAPTION Or %WS_SYSMENU To hDlg
              Dialog Show Modal hDlg Call DlgProc
           End Function
        Binbas code:


        Code:
         
        ' File    : GLOBE.ANI
        ' Len     : 6300
        ' Created : 02-18-2001 - 01:47:40 using BinBas v1.01
         
        #Compile Exe
         
        Sub BinBas1( T As String )
         
        Dim a&: For a& = 1 To DataCount: T = T & Read$( a& ): Next a&
         
        Data 524946469C18000041434F4E616E6968240000002400000008000000080000000000000000
        Data 00000000000000000000000A00000001000000726174652000000008000000080000000800
        Data 000008000000080000000800000008000000080000004C495354341800006672616D69636F
        Data 6EFE0200000000020001002020000000000000E80200001600000028000000200000004000
        Data 00000100040000000000000200000000000000000000000000000000000000000000000080
        Data 000080000000808000800000008000800080800000C0C0C000808080000000FF0000FF0000
        Data 00FFFF00FF000000FF00FF00FFFF0000FFFFFF000000000000000000000000000000000000
        Data 00000000004444444400000000000000000000044244444444444000000000000000044422
        Data 24444444444440000000000000444422244444444444440000000000844444222244444444
        Data 44444000000008444444222224444444444442000000844444442222224444444444222000
        Data 008444444422A22224444444442220000844444C442A2A22244444444222220008444444C4
        Data 22A2A22244444442222200084444C4422A2A2A22C444444222220084444C4CC2A2A2A2A224
        Data C44442222220844C44C442AA2A2A22444422422222208C44C4C22AAAA222CC44C2A2222222
        Data 20844C4C2A777AA2CCC4CC2A2A2A2222208CC4C2A7222772CCCCC42AA2A2A2222084CC2A72
        Data CCC22CCCCC4C2A2A2A2222208CCC272CCCCCCCCCCCC422A2A2A222408CC27A2CCC2CCCCCCC
        Data CC442A2A22222008C2AA22222CCCCCCCC4CC4222444400082AAAAAAA2CCCCCCCCC44444444
        Data 440002FAA7AAAAA22CCCCCCC44C4224422000027FAFAAAAAA2CC4CC4CC427A422000002FAF
        Data AFAAAAA2CCCC4CC442A22220000002FAFA227772C4C4C444C42A22000000002FAF2C2224C2
        Data 2CCCC44427200000000002FA2CCCCCC2A2244444222000000000002F2CCCC4427A24444442
        Data 000000000000028CCC4C277A22444880000000000000000888CC4222248880000000000000
        Data 0000000088888888000000000000FFF00FFFFF8001FFFE00007FFC00003FF800001FF00000
        Data 0FE0000007C0000003C0000003800000018000000180000001000000000000000000000000
        Data 0000000000000000000000000000000000000000800000018000000180000001C0000003C0
        Data 000003E0000007F000000FF800001FFC00003FFE00007FFF8001FFFFF00FFF69636F6EFE02
        Data 00000000020001002020000000000000E80200001600000028000000200000004000000001
        Data 00040000000000000200000000000000000000000000000000000000000000000080000080
        Data 000000808000800000008000800080800000C0C0C000808080000000FF0000FF000000FFFF
        Data 00FF000000FF00FF00FFFF0000FFFFFF000000000000000000000000000000000000000000
        Data 00004444444400000000000000000000044444444442444000000000000000044444444444
        Data 22244440000000000000444444444444222444440000000000844444444444442222444440
        Data 00000008444444444444442222244444000000844444444444444422222244444000008444
        Data 444444444444222222244440000844444C44C4C44C442222222444440008444444C44C4444
        Data 4422A22222444400084444C44C44C4C4C22A2A222244440084444C4CC4CC4C4C42A2A2A222
        Data 244440844C44C44CC4CC4C422A2A2A224444208C44C4CCC4CCCCC22AA2A22244444220844C
        Data 4C4C4CCCCC2A2A2A2244444422208CC4C4CCCCCCC2A22222A24C4444222084CCC4C4CCCC27
        Data A2CC422444444427208CCCCCCCCCCC272CCCC4CC4C444422208CCCCC4CCCC27A2CCC2C44C4
        Data 4444442008CCCCCCCCC27A222224CC44C444440008CCCCCCCC27AAA2A22C44444444440008
        Data CCCCCCC27AAAAA2A2224C444444400008CCCCCC27AAAAAA2A2224C44444000008CCCCC27AA
        Data AAAA2A2A22444444400000082CC27AAAAAAA22A222C44444000000002227AAAAAAAA2C2224
        Data 4224400000000002FFA7AAAAAA24C444422220000000000022F77A7A722C44444272000000
        Data 000000022222A22224444422200000000000000008882C42C4448880000000000000000000
        Data 0088888888000000000000FFF00FFFFF8001FFFE00007FFC00003FF800001FF000000FE000
        Data 0007C0000003C0000003800000018000000180000001000000000000000000000000000000
        Data 0000000000000000000000000000000000800000018000000180000001C0000003C0000003
        Data E0000007F000000FF800001FFC00003FFE00007FFF8001FFFFF00FFF69636F6EFE02000000
        Data 00020001002020000000000000E80200001600000028000000200000004000000001000400
        Data 00000000000200000000000000000000000000000000000000000000000080000080000000
        Data 808000800000008000800080800000C0C0C000808080000000FF0000FF000000FFFF00FF00
        Data 0000FF00FF00FFFF0000FFFFFF000000000000000000000000000000000000000000000044
        Data 44444400000000000000000000044444444444444000000000000000044444444444444444
        Data 40000000000000444444444444444444440000000000844444444444444444444420000000
        Data 02444444444444444444444422000000224444444444444444444444222000002244444444
        Data 444444444444442220000224444C44C4C44C444444444422220002244444C44C4444444444
        Data 4444222200022444C44C44C4C4C4C444444222220082444C4CC4CC4C4C4C44C44442222220
        Data 844C44C44CC4CC4C44444444422222208C44C4CCC4CCCCCCCC44C4C222222220844C4C4C4C
        Data CCCCCCC4CC442A222222408CC4C4CCCCCCCCCCCCC442A22222224084CCC4C4CCCCCCCCCC4C
        Data 2A22444224408CCCCCCCCCCCCCCCCCC4222C444444408CCCCC4CCCCCCCCCCCC22A24442444
        Data 4008CCCCCCCCCCCCCCCCC272222224440008CCCCCCCCCCCCCCCC27AA222224440008CCCCCC
        Data CCCCCCCCC27AA2A222222400008CCCCCCCCCCCCC427AAA2A22222000008CCCCCCCCCCCCC27
        Data AAA2A22222200000082CCCCCC22CC27AAA2A22222200000000822CCC2A7227AAA2A2A22420
        Data 0000000002A2CC27AAAAAA2A2A222480000000000022CC2A7772A2A2A22228000000000000
        Data 088CC222242222222220000000000000000888CC4CC4448880000000000000000000008888
        Data 8888000000000000FFF00FFFFF8001FFFE00007FFC00003FF800001FF000000FE0000007C0
        Data 000003C0000003800000018000000180000001000000000000000000000000000000000000
        Data 0000000000000000000000000000800000018000000180000001C0000003C0000003E00000
        Data 07F000000FF800001FFC00003FFE00007FFF8001FFFFF00FFF69636F6EFE02000000000200
        Data 01002020000000000000E80200001600000028000000200000004000000001000400000000
        Data 00000200000000000000000000000000000000000000000000000080000080000000808000
        Data 800000008000800080800000C0C0C000808080000000FF0000FF000000FFFF00FF000000FF
        Data 00FF00FFFF0000FFFFFF000000000000000000000000000000000000000000000044444444
        Data 00000000000000000000044444444444444000000000000000044444444444444444400000
        Data 00000000444444444444444444440000000000844422244444444444444440000000082222
        Data 22224444444444444444000000822222222244444444444444444000008222222222444444
        Data 444444444440000844272A2A24C44C4444444444444400084442A2A72C4444444444444444
        Data 4400084444277A24C4C4C4C444444444440084444C42C2CC4C4C4C44C444444444408444C4
        Data C44CC4CC4C44444444444444408C4C44CCC4CCCCCCCC44C4C444444440824C4C4C4CCCCCCC
        Data C4CC44444444442082C4C4CCCCCCCCCCCCC4444C44444220822CCCC4CCCCCCCCCC4CC44444
        Data 44222022A2CCCCCCCCCCCCCCC4CC4C444422202FAA2C4CCCCCCCCCCCCC44C44442222002FA
        Data 2CCCCCCCCCCCCCC4CC44C442220002FA2CCCCCCCCCCCCCCC44444422220002FAA22CCCCCCC
        Data CCCCCC44C442222200002FFA22CCCCCCCC4CC4CC4C42222000002FAFA222CCCCCCCC4CC444
        Data 222220000002FAFA2CC42CC4C4C224C22222000000002FAFA222722CCC2222222220000000
        Data 0002FFAAAAAA22C42A22222220000000000022222222224C22722222000000000000088CCC
        Data 4CC44442222820000000000000000888CC4CC4448880000000000000000000008888888800
        Data 0000000000FFF00FFFFF8001FFFE00007FFC00003FF800001FF000000FE0000007C0000003
        Data C0000003800000018000000180000001000000000000000000000000000000000000000000
        Data 0000000000000000000000800000018000000180000001C0000003C0000003E0000007F000
        Data 000FF800001FFC00003FFE00007FFF8001FFFFF00FFF69636F6EFE02000000000200010020
        Data 20000000000000E80200001600000028000000200000004000000001000400000000000002
        Data 00000000000000000000000000000000000000000000000080000080000000808000800000
        Data 008000800080800000C0C0C000808080000000FF0000FF000000FFFF00FF000000FF00FF00
        Data FFFF0000FFFFFF000000000000000000000000000000000000000000000044444444000000
        Data 00000000000000044444444444444000000000000000044444444444444444400000000000
        Data 00444444444444444444440000000000844444444444222444444440000000084444444422
        Data 2222224444444400000084444444422A222222444444444000008444444442A2A2A2224444
        Data 444440000224444C44C42A2A2A2444444444440008444444C44C42AAA22444444444440008
        Data 4444C44C44C427AA2444444444440084444C4CC4CC4C424244C44444444440244C44C44CCC
        Data CC4C44444444444444402244C4CCC4CCCCCCCC44C4C444444440244C424C42CCCCCCC4CC44
        Data 44444444408CC4C22CC2CCCCCCCCC4444C4444444084CC2A22C22CCCCCCC4CC44444444440
        Data 82CC2AA22222CCCCCCC4CC4C444444402222AAAAA2A22CCCCCCC44C44444444002FAAAAAAA
        Data 2A2CCCCCC4CC44C444440002FAAAAAAAA22CCCCCCC44444444440002FFAFAAAAAAA22CCCCC
        Data 44C444444400002FFA7AAAAAAA224CC4CC4C44444000002FAFAFAAAAAAA2224CC444444440
        Data 000002FAFA7AAAAAAA24C424C44442000000002FAFAFAAAAAAA222222444200000000002FA
        Data FA7AAAAAAA2A2A22442000000000002FAFAA22222222222248000000000000022AFA2CC444
        Data 44444880000000000000000222CC4CC4448880000000000000000000008888888800000000
        Data 0000FFF00FFFFF8001FFFE00007FFC00003FF800001FF000000FE0000007C0000003C00000
        Data 03800000018000000180000001000000000000000000000000000000000000000000000000
        Data 0000000000000000800000018000000180000001C0000003C0000003E0000007F000000FF8
        Data 00001FFC00003FFE00007FFF8001FFFFF00FFF69636F6EFE02000000000200010020200000
        Data 00000000E80200001600000028000000200000004000000001000400000000000002000000
        Data 00000000000000000000000000000000000000000080000080000000808000800000008000
        Data 800080800000C0C0C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF00
        Data 00FFFFFF000000000000000000000000000000000000000000000044444444000000000000
        Data 00000000044444444444444000000000000000044444444444444444400000000000004444
        Data 44444444444444440000000000844444444444444444442220000000022444444444444444
        Data 2222222200000022224444444444444222222222400000222224444444444442A222222240
        Data 00022A22224444C44C44442A222224440002A2A222C44C4444444442A222244400022A2A22
        Data 4C44C4C4C4C4442A2224440082A2A222C4CC4C4C4C44C44242444440222A2A222CC4CC4C44
        Data C444444444444022A2AAA222CCCCCCCC4C44C444444440272AAAAA2CCCC2CCC2CCCC444444
        Data 444027AAAAA2CCCCC22CC2C44C4C4444444027AAAA242CCC2222C22CC4C44444444027AAA2
        Data C2A2CC2AA22222CC44444444402A222227AA22AAAA2A2224C44444444002CCCC27AAAAAAAA
        Data A2A22C444444440008CCCC2AAAAAAAAAAA2A24444444440008CC227AAAAAAAAAA2A2222444
        Data 44440000827AAAAAAAAAAAAA2A222244444000002FAFAFAAAAAAAAA2A22222224440000002
        Data FAFAFAAAAAAAAA2A22222444000000002FAFAAAAAAAAA2A2222222200000000002FFF77AAA
        Data AA2A2A222222200000000000222227A7A2A2A2222222000000000000088CC2222222222448
        Data 80000000000000000888CC4C222228800000000000000000000088888888000000000000FF
        Data F00FFFFF8001FFFE00007FFC00003FF800001FF000000FE0000007C0000003C00000038000
        Data 00018000000180000001000000000000000000000000000000000000000000000000000000
        Data 0000000000800000018000000180000001C0000003C0000003E0000007F000000FF800001F
        Data FC00003FFE00007FFF8001FFFFF00FFF69636F6EFE02000000000200010020200000000000
        Data 00E80200001600000028000000200000004000000001000400000000000002000000000000
        Data 00000000000000000000000000000000000080000080000000808000800000008000800080
        Data 800000C0C0C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF
        Data FF000000000000000000000000000000000000000000000044444444000000000000000000
        Data 00044444444444444000000000000000044444444444444444400000000000004444444444
        Data 44444444440000000000844444444444444444444440000000084444444224444444444444
        Data 44000000844444442222444444444444422000008444444422222444444444444220000844
        Data 444C422A2222444444444444220008444444C2A2A2224444444444444200024444C4422A2A
        Data 22C4C444444444440022244C4CC2A2A2224C44C44444444440224C4422422A2A2224444444
        Data 444444408C44C22222A2A2A22244C4C444444440844C22AAAAAA2A2A24CC4244424444408C
        Data C42AAAAAAAA2A2CCC4422C4244444084CC27AAAAAAAA2C2C4C2222422444408CCC277AAA77
        Data 72C2A2C42222222244408CCCC2277722222AAA222A222222244008CCCCC222CCCC2AAAAAA2
        Data A22222240008CCCCCCCCCCCC2AAAAAAA2A2222240008CCCCCC22CC222AAAAAA2A222222200
        Data 008CCCC27AC2AAAAAAAAAA2A22222000008CCCC27A2AAAAAAAAAA2A2222220000008CCCC27
        Data AAAAAAAAAA2A2A2222000000008CCC27AAAAAAAAA2A2A222200000000008CC277AAAAAAA2A
        Data 2A22222000000000008CC22777722222222222000000000000088CC2222444422222200000
        Data 00000000000888CC4CC44488800000000000000000000088888888000000000000FFF00FFF
        Data FF8001FFFE00007FFC00003FF800001FF000000FE0000007C0000003C00000038000000180
        Data 00000180000001000000000000000000000000000000000000000000000000000000000000
        Data 0000800000018000000180000001C0000003C0000003E0000007F000000FF800001FFC0000
        Data 3FFE00007FFF8001FFFFF00FFF69636F6EFE0200000000020001002020000000000000E802
        Data 00001600000028000000200000004000000001000400000000000002000000000000000000
        Data 00000000000000000000000000000080000080000000808000800000008000800080800000
        Data C0C0C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF0000
        Data 00000000000000000000000000000000000000000044444444000000000000000000000444
        Data 44444444444000000000000000044444444444444444400000000000004444444444444444
        Data 44440000000000224444444444444444444440000000022224444444444442244444440000
        Data 00222222444444444422224444444000002222222444444444222224444440000222222A24
        Data C4C44C42222222444444000222A2A2A24C444442A2222244444400022A2A2A2244C4C4C22A
        Data 22224444440022A2A2AAA22C4C4C42A2A22244444440222A2AAA22C4CC22422A2A22244444
        Data 4022A2AAA2C4CCC2A222A2A222224444402A2AA24C4CCC2A2A2A2A2A2224444240222AA2CC
        Data CCCC2AAAAAA2A2224444422084C224C4CCCC2AAAAAAA2A24244422208CCCCCCCCCCC27AAAA
        Data A2A242224422208C2CCC4CCCCCC22AAA22222222222220022CCCCCCCCCCCC222C4CC222222
        Data 2200022CCCCCCCCCCCCCCCCC442A2222220002F22CCCCCCCCCCC22CC2222A2222200002AA2
        Data CCCCCCCCC2AAC2AA2A22222000002FA2CCCCCCCCC27AAAA2A2A22220000002F2CCCCC4CCC4
        Data 2AAAAA2A2222000000002CC22CCCC4CC2AAAA2A222200000000008C2A22CCCC427AA2A2222
        Data 20000000000022FA2CC44C4222A22222000000000000022F224CC444422222200000000000
        Data 00000222CC4CC44488800000000000000000000088888888000000000000FFF00FFFFF8001
        Data FFFE00007FFC00003FF800001FF000000FE0000007C0000003C00000038000000180000001
        Data 80000001000000000000000000000000000000000000000000000000000000000000000080
        Data 0000018000000180000001C0000003C0000003E0000007F000000FF800001FFC00003FFE00
        Data 007FFF8001FFFFF00FFF
        
        End Sub
        
        Function PbMain
         
            Dim a As Long, FO As Long, T As String
         
            FO = FreeFile
            ErrClear
            Open "GLOBE.ANI" For Output As #FO
            If Err Then
                MsgBox "Error: " & Str$( Err ), 16, "GLOBE.ANI"
                Exit Function
            End If
            BinBas1 T
            For a = 1 To Len( T ) Step 2
                Print #FO, Chr$( Val( "&H" & Mid$( T, a , 2 ) ) );
            Next a
         
            Close #FO
         
        End Function


        ------------------
        hellobasic

        Comment


        • #5
          Could not resist to rebuild it...
          I used a different approach by finding the first icon and then use the record sizes.


          Code:
          #Compile Exe
           
          Option Explicit
           
          #include "win32api.inc"
          '#include "PBDebug.Inc"
           
          Type TAGANIFILEPREFIX
           
              FileType As String * 4
              FileLen  As Dword
              ACON     As String * 4
           
          End Type
           
          Type TAGANIHEADER
           
              cbSizeOf    As Dword    '// Num bytes In AniHeader (36 bytes)
              cFrames     As Dword    '// Number of unique Icons In this cursor
              cSteps      As Dword    '// Number of Blits before the animation cycles
              cx          As Dword    '// reserved, must be zero.
              cy          As Dword    '// reserved, must be zero.
              cBitCount   As Dword    '// reserved, must be zero.
              cPlanes     As Dword    '// reserved, must be zero.
              JifRate     As Dword    '// Default Jiffies (1/60th of a second) If rate chunk Not present.
              flags       As Dword    '// Animation Flag (see AF_ constants)
           
          End Type
           
          Type TAGICONDIR
           
              idReserved  As Word '// Reserved (must be 0)
              idType      As Word '// Resource Type (1 For icons)
              idCount     As Word '// How many images?
           
          End Type
           
          Type TAGICONDIRENTRY
           
              bWidth          As Byte     '// Width, In Pixels, of the Image
              bHeight         As Byte     '// Height, In Pixels, of the Image
           
              bColorCount     As Byte     '// Number of colors In Image (0 If >=8bpp)
              bReserved       As Byte     '// Reserved ( must be 0)
              wPlanes         As Word     '// Color Planes
              wBitCount       As Word     '// Bits per pixel
              dwBytesInRes    As Dword    '// How many bytes In this resource?
              dwImageOffset   As Dword    '// Where In the file is this image?
           
          End Type
           
          '// "ICON" entry in the ANI file.
          Type TAGANIICONPOS
           
              TAG         As String * 4
              LenIconData As Dword
           
          End Type
           
          Global hANIIcons() As Long
           
          Function LoadIconsFromAni( ByVal sMem As String, hIcons() As Long ) As Long
           
              Dim a           As Long
              Dim pAFP        As TAGANIFILEPREFIX Ptr
              Dim pAH         As TAGANIHEADER Ptr
              Dim pIDIR       As TAGICONDIR Ptr
              Dim pIDIRENTRY  As TAGICONDIRENTRY Ptr
              Dim pAP         As TAGANIICONPOS Ptr
           
              If Len( sMem ) < Len( TAGANIFILEPREFIX ) Then Exit Function
              pAFP = StrPtr( sMEM )
          '    If @pAFP.FileLen <> Len( sMem ) Then Exit Function '< Problem!
           
              a = Instr( UCase$( sMem ), "ANIH" )
              If a = 0 Then Exit Function
           
              '// Skip additional structsize + search offset.
              pAH = StrPtr( sMEM ) + a + 7
           
              ReDim hIcons( 0 To @pAH.cFrames )
              hIcons( 0 ) = ( @pAH.JifRate * 1000 ) / 60
           
              a = Instr( UCase$( sMem ), "FRAMICON" )
              If a = 0 Then Exit Function
           
              '// Remove first stuff.
              sMem = Mid$( sMem, a + 4 )
           
              '// First icon.
              For a = 1 To @pAH.cFrames
           
                  pAP = StrPtr( sMem )
                  If UCase$( @pAP.TAG ) <> "ICON" Then Exit For
           
                  pIDIR = pAP + Len( @pAP )
                  pIDIRENTRY = pIDIR + Len( @pIDIR )
          '        If @pIDIR.idCount <> 1 Then Iterate    '< Problem!
           
                  hIcons( a ) = CreateIconFromResource( ByVal pIDIR + @pIDIRENTRY.dwImageOffset, @pIDIRENTRY.dwBytesInRes, 1, &H00030000& )
           
          'PBEdit_DebugPrint Str$( a ) & ", " & @pAP.TAG & ", " & Str$( hIcons( a ) )
           
                  sMem = Mid$( sMem, Len( TAGANIICONPOS ) + @pAP.LenIconData + 1 )
           
              Next a
           
          End Function
           
          Sub DestroyIconHandles( hIcons() As Long )
           
              Dim a As Long
           
              If UBound( hIcons ) < 0 Then Exit Sub
           
              For a = 1 To UBound( hIcons )
           
                  If hIcons( a ) Then destroyIcon hIcons( a )
                  hIcons( a ) = 0
           
              Next a
           
          End Sub
           
          CallBack Function DlgProc() As Long
           
              Dim a   As Long
              Dim FF  As Long
              Dim R   As Rect
              Dim PS  As PAINTSTRUCT
              Dim T   As String
           
              Static nStep As Long
           
              Select Case CbMsg
              Case %WM_INITDIALOG
           
                  ReDim hANIIcons(1)
           
                  FF = FreeFile
          '        Open "C:\VBWORK32\ANIICON\GLOBE.ANI" For Binary Shared As #FF
          '        Open "C:\VBWORK32\ANIICON\HOURGLAS.ANI" For Binary Shared As #FF
                  Open "C:\VBWORK32\ANIICON\APPSTART.ANI" For Binary Shared As #FF
                  T = String$( Lof( FF ), 0 )
                  Get #FF, , T
                  Close #FF
                  Call LoadIconsFromAni( T, hANIIcons() )
           
                  PostMessage CbHndl, %WM_TIMER, 1, 0
           
              Case %WM_TIMER
           
                  Incr nStep
                  If nStep  > UBound( hANIIcons ) Then nStep = 1
                  If nStep =< UBound( hANIIcons ) Then
           
                      SendMessage CbHndl, %WM_SETICON, %ICON_BIG, hANIIcons( nStep )
                      SetTimer CbHndl, 1, hANIIcons( 0 ), ByVal 0&
           
                  End If
           
              Case %WM_COMMAND
           
                  Select Case CbCtl
                  Case %IDCANCEL
           
                      '// Return 0 for cancel flag
                      Dialog End CbHndl, 0
           
                      '// Cancel further processing
                      Function = 1
                      Exit Function
           
                  End Select
           
              Case %WM_DESTROY
           
                  KillTimer CbHndl, 1
                  DestroyIconHandles hANIIcons()
           
              End Select
           
          End Function
           
          Function WinMain ( ByVal hCurInstance  As Long, _
                             ByVal hPrevInstance As Long, _
                             lpszCmdLine         As Asciiz Ptr, _
                             ByVal nCmdShow      As Long ) As Long
           
              Dim a       As Long
              Dim hDlg    As Long
              Dim Result  As Long
           
              Dialog New 0, "Animated icon",,, 140, 80 _
                  ,  %WS_OVERLAPPED _
                  Or %WS_SYSMENU _
                  To hDlg
           
              If hDlg = 0 Then Exit Function
           
              Dialog Show Modal hDlg Call DlgProc To Result
           
              Function = 1
           
          End Function
          ------------------
          hellobasic

          Comment


          • #6
            Originally posted by Semen Matusovski:
            Guys, pls, let me know, if there are problems in any OS/with any ANI.
            Semen:

            Nice code... compiled and ran on WIN ME but had to make the code change suggested by Borje to get animation.
            Tried numerous ANI files, all ran without any problems.

            Timm

            ------------------
            mailto:[email protected]
            Tsunami Record Manager

            Comment


            • #7
              I tried Semen's code in the 1st message (Win2K) and it worked with the Banana and Metronom ANI files, but most others just displayed a static image (ie, DRUM, FILLITUP, etc). I did not try every one as there are hundreds of 'em!



              ------------------
              Lance
              PowerBASIC Support
              mailto:[email protected][email protected]</A>
              Lance
              mailto:[email protected]

              Comment


              • #8
                thanx, guys.
                from borje's and lance's messages i understood that there are ani files without seq tag.
                i added default (see above):
                for j = 1 to csteps: seq(j) = j - 1: next
                pls, re-check http://www.powerbasic.com/support/pb...ad.php?t=22932

                [this message has been edited by semen matusovski (edited february 18, 2001).]

                Comment


                • #9
                  originally posted by semen matusovski:
                  today tonight i quickly wrote a fragment, which wanted to do enough long time ago.
                  main idea to display ani, first of all, in buttons.

                  i found not very detail description of ani at wotsit.
                  following code works on my pc under win2000 with some selected ani.
                  guys, pls, let me know, if there are problems in any os/with any ani.

                  code was moved to http://www.powerbasic.com/support/pb...ad.php?t=22932


                  semen,

                  i tried your program but i get the message box "problems".
                  where do i get the file
                  $fileani = "c:\winnt\cursors\metronom.ani"
                  this is on windows 98
                  thanks

                  brent

                  ------------------


                  [this message has been edited by brent m. gardner (edited february 18, 2001).]

                  Comment


                  • #10
                    $FileAni is a path to any ANI-file on your PC.
                    Typically ANI are located in Windows\Cursors directory, and (for examp;e) you can specify
                    $FileAni = "c:\Windows\Cursors\Globe.Ani"
                    But again - I can't say valid path for your PC

                    ------------------
                    E-MAIL: [email protected]

                    Comment


                    • #11
                      Originally posted by Semen Matusovski:
                      $FileAni is a path to any ANI-file on your PC.
                      Typically ANI are located in Windows\Cursors directory, and (for examp;e) you can specify
                      $FileAni = "c:\Windows\Cursors\Globe.Ani"
                      But again - I can't say valid path for your PC

                      SEMEN,

                      Your program works just fine.

                      Thanks,

                      BRENT



                      ------------------

                      Comment


                      • #12
                        Semen,

                        Maybe all the follow ups skipped my code but:

                        The tags your looking up are not consistent.
                        Try several files and you know...
                        There are incorrectly created ANI files.
                        But only there headers seem to be incorrect, not the data itself.

                        What do you think of my simple instr() method?

                        ?

                        ------------------
                        hellobasic

                        Comment


                        • #13
                          Edwin --
                          > The tags your looking up are not consistent.
                          That's why I use two crosses
                          > There are incorrectly created ANI files.
                          That's why I am interesting to see real files, which could no be processed.
                          > What do you think of my simple instr() method?
                          Theoretically this is incorrect way, because you can find a string inside the data.

                          I have no plans to write graphic editors.
                          Actually I will to include ANI as DB-sequences directly into a program without any tags, like ready arrays.

                          Just now I "struggle" with GIF.
                          There are some programs, which are able to convert GIF to sequence of BMP (native and RLE).
                          To include native format is easy (to take pixels only), but files are too big.

                          I think about two variants - 1) RLE (as DB) / 2) zipped "native" BMP.
                          Variant 2 is not bad, but I want to avoid external DLL.
                          Variant 1 - I do not try to interpretate BMP file directly. Do you ?

                          ------------------
                          E-MAIL: [email protected]

                          Comment


                          • #14
                            Semen,

                            1) Only globe does it correctly
                            2) I didn't understand your question.
                            3) What's wrong with instr (see my code), a backwards -1 search could be better too.

                            Code:
                             
                            ' File    : ANIS.ZIP
                            ' Len     : 3771
                            ' Created : 02-21-2001 - 20:24:59 using BinBas v1.01
                             
                            #Compile Exe
                             
                            Sub BinBas1( T As String )
                             
                            Dim a&: For a& = 1 To DataCount: T = T & Read$( a& ): Next a&
                             
                            Data 504B0304140000800800E7B66327A100FA134D030000522000000C00000041505053544152
                            Data 542E414E49ED56416B1341149E64DBDD50C5ED452988EC1E443C08C68360A11843A11AB12D
                            Data B43D79DA50DC36509390465B419C39696EFEA52DFD23911EEAAD0B42D9D225E37BD9A8F3C6
                            Data 24506BD3D2EE6CBE9DBE796F6766A7DFF7DE2E95E6E65EBA8C156717175E9596575E33C64A
                            Data 0B738BA585E23C0CB362BDBE51592D372BB5AABBDC2C379A95EA9AFBA2F6AEE13EDF286F6E
                            Data B2527169E51EC4CD57561BB5CD9ADF74676B8D7AADD17DE20118F50F8DCADA7AD37D343DFD
                            Data 9895AB95F5BB108D98E8416F93800C00A67873BF67F703FAC615E0EE85C398DF28BFADACD6
                            Data AA4FC770B62C5CAE9BCCFC3DCB18EE15ED7166B13C2C73C34866C29067DD95C7926088EDDF
                            Data 44F7C784483ABC70086E4110C088ECFE98944987170EE1EDFF34DFF789CD65EB44B625059D
                            Data 705B5B20A7D9218DE7360DA82B7E3BA4EBA1AD36380413F6EF29B6DA68B8ADDB210DB7B533
                            Data 055BAA0FD8DAA1DBD4DDE779E2069B0DD91DEEEF644DAA2D32A48C2D8A0EEED849807FC358
                            Data E7A325E39904D1B621B7B9947988980464F0FD209415001C09978CC1CC126693BF6603B704
                            Data B7A43CCFB01E9B07ED75F8CB5C4738824D413F352158FEA6C8E66F0BC3B399D13699116799
                            Data 11411F5E03FB8E3002471802D095963368D9C1E7A5B61F806FC2E9625738C7BB41E1E84B50
                            Data 88103680B5799409E188A1B77A630EA000E0C289A4708E00C77278C32CD2C926C92043B2C8
                            Data 2DD63F6B884B9435C233CE1ACA7C69D6B8C059E372AB4063F9E85540599FAA2055C1E85550
                            Data 3F6715E8AC4F5590AAE03C542046AB0299AA2055C18557817DD62A185C7B5215A42AB8282A
                            Data D072F56955A0C5A72A4855307A1598BA0A34B727A83B47586C7A5424BEAD7DD058FACEB678
                            Data 4B974D8B4C01FF0FB2074B1E7A8428DCA7C4313DCA7A5355C555540170B203880111703404
                            Data AEB60181D3530772598043F00E17322EEC00F664C4F7410507692D38BD864C1449EBB3E217
                            Data 22A7DAB69DFB2A0F155B869CDA48FB3FB6B505C279FF9B2874BD3EB560987D856A81DA0E80
                            Data A46D38E5B607600A3CDEF1421E3F943C062A4740E52BFC45F417933D6A735A1E94DC3C2077
                            Data B7047980E47E2B0C69EDA01F58A6A77D10F939C506A290DA84C451D796DADB5C51151C00F6
                            Data 017B801DCCFB08DECDFF5807B01E04497DE8D41D193F81E1192EA34F1C54C0FF59053F0150
                            Data 4B0304140000800800E7B663279736026E8B0600009C18000009000000474C4F42452E414E
                            Data 49ED98318B1CC712C75B63C15B9C2833CE3C140D730C039738F7B85F2324186CB0FD0584B1
                            Data B102CBB0180E2679CB71C105F7115ED4896092FB0AA299B03F8443874289CC62B4FE5755F7
                            Data CC9E25E3C0E0B3E1E634DAFB77D5F5F4F6D4AFABBABF78FCF0E1FF3F34E6D3FF7EFED99367
                            Data 4FBFB3C618BE37F9FEFDF53EEE7BB8B74F7EFCA63EF2FBA37B78FCE5571FA3FF6FB74FBE7F
                            Data FAF50FCFDE54DC4B853EEA5A7BFC192D1FE0F3043737F5F284FB6AACDE3104B976F2CFEC76
                            Data FAC13FF8E5C58B17F8E49683FC3387837EF00F37F17FEFBC3CAE55DD77AC7D5FA4277BDCE0
                            Data 8BD63FB98026BF386C3C6B75706A865607AAB30EEA000DF7C1B7AD6847247F3E5308B4EAD9
                            Data B57098555FF8618801979D59D71703EC13ECE88DF5959F633B054A3E0612FBD09E8D21CD89
                            Data 3B817D8ECFA9D9A634B7E804F6D46E53EC521AB23D3510B8781081FAAB3876495ABCD83771
                            Data 22623D2787679A4D3B4D93DA6546AAFDF3690ADC80AFE1C99866BF47431AE03F3A7CFFD3EB
                            Data 6BD6687081E7A3DAEFE96C3BCFB39F5BE2F93CBDEEC86244B36F6AD6D51EBDC56075FAD801
                            Data 36375A9D5E76B84A4333927FB4CB2F6C7389B1D9CBDDFA462F71E96F87970F0E87DDBDC31B
                            Data 63FEF7AB319FFC62CC472F8D79F09331FF7961CC7B7CE30FEF95DBFCC975EC5BFE9EFBE23E
                            Data B96F7E063F8B9FC9CFFE175120117C448144AC5D29C87AA14034AD14F842C26A5612FA1B9A
                            Data 7B140AE67950ED9582414921D5333B448E4168A6604EC3E03846D10153C00D428AF74C0102
                            Data 34C55640724CC130A4A456CF14C09A989030B0BE48DCD084E498C30614F00512D0A7F8235E
                            Data 9390E0C1A1AF376C8E23069BB8C1886EA6103AA56023E66902D7B34CEA956A0C6790EF7FC5
                            Data EE9372CB7AD3B179C2D79D754289CD1348705626BC3A80AB49A0AF65C2E9F5386EF138B7D5
                            Data F75191AE2AD9CC14746EF6973B7347C15FA5E03817F81B0D7EB98E29E0ABE631AF92974243
                            Data C7BA7E4B573653A064B0F659152D1460AD945C709E2940DB920B068958B1170A78298E3917
                            Data 300568F3C0086BBB50C00D8E7345AF1424CE05E411774A81E4028EEB5E2890C86FAD07759B
                            Data 628F5BC6D62CBA996EE83822EEC94AD4F3E5C68953C9A2191CD11B5EE999041E1ECFE77987
                            Data F4C4E6606B098250B0B13B99704AEDD9961781137D1F9BAB4896888E2840A6B9A3E06FA6A0
                            Data 14489A0BA8D43FEA707EACFBB7F4C6376D6B97B88776E179B73E01B9A019AD52E03517B898
                            Data 29E00E2E18A14C8144EDE00B05ECD09FAF1408A7E70B05A00FB9E2BC4B998259B0A45028D0
                            Data 5C703A754A4112EC6AA94FD48E528CCCA253A6761FBAE2CFD49AD33D69F7C857241551C80D
                            Data 9E7245D4CD1D929D8D942BA240DB2E2D615D1D3855CCED12E66CA181B6EACE1470678E4E6A
                            Data 7347C1EDE6022161A9884AA467B36BB3EEB30E5AF8436B2E40C16297A8C7E2EEA6B06ACE05
                            Data CD64170A24A05CA6C0722E482B05B4E68259ED6E702B05C8055878170A3C72414BBC2D500A
                            Data 404D6AB146170AD01F7135D32905D0D59ED7E54E29907DC054F60132BEEA709D1BBC5644A7
                            Data 7B297894D43EEF0BB07191E7F542C128150FD73CC6AC0E98D1DA98C5814BA85AF705D79380
                            Data 408FF47D542D3842678F76A694487714DC5E45246B5565FD52F84B4594177EC7BA67AD0E5A
                            Data 90E015B203E782562A8A0A7CCC4376608DB79F2B22DE429B73B66B2E00098852D83B8EB039
                            Data 5310A6BCD66AD4362D6F5E237E244CFB46B6A620611E86AC2D2FBCB1536A508AC4A024883F
                            Data 46855A67A9F3FB4ACBFAB211E00A88F7C770B059D3A876F99EC87D22B9033AA240EA21CA14
                            Data ECB3DDFA1CE4C55E6B2E783D0A046B2E689E07B1AF1511EFAA1EEDCC9A0B884E76E68E82DB
                            Data D817945CE0ECEA70E1D7332457CE880A097A46E4DAE2A0674431670A3E05A9F48C884A4544
                            Data 56CE88A85444F8855C3E6392B5DE232424D568545F0C240BA94DCE3BC905ADC418F6059D93
                            Data 5CA09BD10E718361F738231AA7B36D0CB3E433E8D89C11B51371185ADE174492C8D7BA3FEF
                            Data 03DA1CC7A22951B613EF03E2180B07B5EAB6C439F426632571CEF37955300B1AF51B1E919A
                            Data 459B2B8C684B7483022B9B22735711DD160547DBDD5ED2718E705D0ACD724A9ACF44282320
                            Data 1F3D1F70605B801A48FDA0F1FA074D15A2E57487CF8854C38C7A43CE88A443E40214CDA990
                            Data 20B960E633A0201DF46D1BB02F68F9E250817F482588E50C29DA3907B1B57A26247B57D871
                            Data 120ADDF1EE1887AF5A84D49556FD919FC97158956D81EEBE4DF54A1B40029F721923CF4B71
                            Data 8A998253D56309F3EA155757CC66A6A0E353528C68A120A2BE4249B850402880305FA15050
                            Data 9D72797544C13FB922FA0D504B0304140000800800E7B66327AED7AC1FA7030000702F0000
                            Data 0C000000484F5552474C41532E414E49ED9A3F6F1A4B10C007E3DC9D12C5B84A0B4514A588
                            Data F2A74861E9E925962512A4D8961C172941562E202580B09F702A6F1A673B7F83A4CD474889
                            Data 9422A5BF02922594CA424A73912C6F666E0FB373BED83C3FC0E0B703C3313B73BBCB32BF59
                            Data 0E582BE4F3E507008B4BAB2B2F0A2FD7F3005058C9AF165616976FE0F3E7B57F1AB9676F4B
                            Data 9B9BD8BEB8B67E07DB962B1B8DDA66CDDFCA2DD51AF55AA3B455A955EFA1517FDFA8BC296F
                            Data E51E2D2C3C8652B552BE8DD1A49948E332879A42C52E5EFF15D983EA5DD46B86D2EC3FDD07
                            Data F01BA577958D5AF5EF591A61066FB91CC03C8EFF630680E6AFED79788843CFA5754FD8044F
                            Data C3D9CCEAA9616CB288F00E42E803DDA8091F5AAD16B6A8F00E4AE903DDA8891EC621FEE1A1
                            Data EFFB7DDB41CB2FF66D772F90525CDC866D25A539A0BBC7DC18C0DC18C0DD7AF90CF1BC985B
                            Data B000CF6301AEE8B28073E72F259FFF39EBE58702A3109524AD94D676FAB4765DA5828C5247
                            Data 59A58E9F68A5E7D446BEA4737AFD2508CFF31424BC17E65C931D99401FAF7F01B8F90A01FA
                            Data 8A6DDBB8CE5D8074113B6E45BDA2A670A4741B7D751D47F1747EAF8FDE71D0F5EABDB641D6
                            Data 6BD075FAC35A915015399ED1C520C5AAC82D48AE1AC2A81AF391DAAA915C353CD33D86AA21
                            Data 6DD5B850D5B014FC170A3CD3BE7C0A024B81A560F814B02C9F060AA411602918130557EC3A
                            Data AA3BDD14FCDBBDCC5260F782240A8414534581B414580A864C81983E0ACC0E2D059682E150
                            Data 10BBBA9C700AA4A5C05230720ABC49A340B2004B81A5602C14781345412C692D0596824BA0
                            Data E0ECEF904640412CDE52602998000ACEBC7A1EC13F4E2C059682218B538CBDCBDC767CFEF9
                            Data C32FB26B51A7C3BF9DAF1619324E27E39949EB14F1FF0C2C894F33A2027300683677785A83
                            Data CBD336B459DEA3BD6BE4A58B43C47E0734DD3487AAE1C680DD0E30E16E5C04E012738F9482
                            Data 9FA807A8DF503F509660B2C38E3A420D2255A422CAF0E330201BE99330984E0A4FA64EBEA3
                            Data EEFFDF291811524E646B46300D7B14D08BF7FA760891647EE119B68C24B2DB7B4A0A22A7DA
                            Data B7891CD5B705A5F5891DF2E19EC4179B4D8D969F38DFC91235A0FC52EA7390E96603B79D0D
                            Data D2AD6C9012D900A0AF64533BF9318EE207E9378982F9AB4341BC96C56B9DC36BA12B78C0B6
                            Data 72CC1EB0B60A566B3149CD80B076C7EC78ED16E6BF364D377E20EB7E6CD6FB6367CCBDC7F1
                            Data F1F398796EB52CD96F664E27B6915080693B3E1B1BD7A60C67EE95A32AFC0353B01FD5EFD8
                            Data 66A0EB7CAFE6EB7D80F603638F380AC376F8567010ED2F09F21B504B010214001400000008
                            Data 00E7B66327A100FA134D030000522000000C00000000000000000020000000000000004150
                            Data 5053544152542E414E49504B01021400140000000800E7B663279736026E8B0600009C1800
                            Data 00090000000000000000002000000077030000474C4F42452E414E49504B01021400140000
                            Data 000800E7B66327AED7AC1FA7030000702F00000C00000000000000000020000000290A0000
                            Data 484F5552474C41532E414E49504B05060000000003000300AB000000FA0D00000000
                            
                            End Sub
                            
                            Function PbMain
                             
                                Dim a As Long, FO As Long, T As String
                             
                                FO = FreeFile
                                ErrClear
                                Open "ANIS.ZIP" For Output As #FO
                                If Err Then
                                    MsgBox "Error: " & Str$( Err ), 16, "ANIS.ZIP"
                                    Exit Function
                                End If
                                BinBas1 T
                                For a = 1 To Len( T ) Step 2
                                    Print #FO, Chr$( Val( "&H" & Mid$( T, a , 2 ) ) );
                                Next a
                             
                                Close #FO
                             
                            End Function

                            ------------------
                            hellobasic

                            Comment


                            • #15
                              Edwin --
                              > Only globe does it correctly

                              You are about 2 from 3 Win95 *.ani ?
                              They are simply incorrect: in some ICON there are two icons, unlike really used one only (I tested Seq).
                              Note that ani with the same names in Win2000 are correct.

                              But anyway I changed a code (see Source code) and now it works with them also.

                              > What's wrong with instr (see my code), a backwards -1 search could be better too.

                              1 search, of course, is better than two. But it's not reliable way.
                              Don't think that you need explanations

                              > I didn't understand your question.
                              Probably in future I'll post some code and it will be more clear.

                              ------------------
                              E-MAIL: [email protected]

                              Comment

                              Working...
                              X