home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD59525202000.psc / AnimatedGifCtl.ctl (.txt) next >
Encoding:
Visual Basic Form  |  2000-05-21  |  81.8 KB  |  2,284 lines

  1. VERSION 5.00
  2. Begin VB.UserControl AnimatedGifCtl 
  3.    BorderStyle     =   1  'Fixed Single
  4.    ClientHeight    =   2880
  5.    ClientLeft      =   0
  6.    ClientTop       =   0
  7.    ClientWidth     =   3840
  8.    PaletteMode     =   1  'UseZOrder
  9.    PropertyPages   =   "AnimatedGifCtl.ctx":0000
  10.    ScaleHeight     =   240
  11.    ScaleMode       =   3  'Pixel
  12.    ScaleWidth      =   320
  13.    Begin VB.Timer Timer1 
  14.       Left            =   1680
  15.       Top             =   1080
  16.    End
  17. Attribute VB_Name = "AnimatedGifCtl"
  18. Attribute VB_GlobalNameSpace = False
  19. Attribute VB_Creatable = True
  20. Attribute VB_PredeclaredId = False
  21. Attribute VB_Exposed = True
  22. Attribute VB_Description = "Animated Gif Ctl Ver 2.0"
  23. Attribute VB_Ext_KEY = "PropPageWizardRun" ,"Yes"
  24.  Option Explicit
  25.  'Note:
  26.  'The Unisys Corporation has a patent that it alleges
  27.  'covers certain aspects of GIF-LZW compression technology,
  28.  'which the PictureBox and Image controls use.
  29.  'Microsoft Corporation obtained a license
  30.  'to the Unisys LZW patents in September, 1996.
  31.  'Microsoft's license does not, however,
  32.  'extend to software developers or third parties
  33.  'who use any Microsoft toolkit, language development,
  34.  'or operating system products to provide
  35.  'GIF read/write and/or any other LZW capabilities
  36.  'in their own products (for example, by way of DLLs and APIs).
  37.  'If your commercial application uses either of these controls
  38.  '(and thus, the LZW technology), you may wish to '
  39.  'obtain an independent legal opinion on the effect
  40.  'of the patent, or contact
  41.  'Unisys USA at http://www.unisys.com/ for more information.
  42.  ' Please make sure you understand the implications of the
  43.  ' above notes if you release a Commercial product
  44.  ' using these Gif functions.
  45.  ' I am NOT responsible for the use of this software.
  46.  ' Stephen Lebans
  47.  ' May 20, 2000
  48.  ' ************************************************
  49.  ' Sorry, there are several declaration and portions of code
  50.  ' that are not used in this version. They are used in
  51.  ' a version of the code for VBA in Microsoft Access.
  52.  ' I'm wasting too much time trying to support 2 versions
  53.  ' specific for each environment. So if you like, help
  54.  ' yourself and commment out the unused stuff.
  55.          
  56.  ' Animated Gif Class Module
  57.  'Copyright Lebans Holdings 1999 Ltd.
  58.  'You may freely use and redistribute this code providing
  59.  'the one line copyright notice is left intact.
  60.  'You may not resell this code as part of a collection or by itself.
  61.  'Please feel free to use this code within your own applications,
  62.  'whether private or commercial, without cost.
  63.  'Contact   Stephen@lebans.com    or visit    www.lebans.com"
  64.  ' Declare our structures for this module
  65.  Private Type RECTL
  66.      Left As Long
  67.      Top As Long
  68.      Right As Long
  69.      Bottom As Long
  70.  End Type
  71.  Private Type SIZEL
  72.      cx As Long
  73.      cy As Long
  74.  End Type
  75.  Private Type POINTAPI
  76.      x As Long
  77.      y As Long
  78.  End Type
  79.  Private Type PALETTEENTRY
  80.      peRed As Byte
  81.      peGreen As Byte
  82.      peBlue As Byte
  83.      peFlags As Byte
  84.  End Type
  85.  Private Type LOGPALETTE
  86.      palVersion As Integer
  87.      palNumEntries As Integer
  88.      palPalEntry(1) As PALETTEENTRY
  89.  End Type
  90.  Private Type RGBQUAD
  91.      RGBBlue As Byte
  92.      RGBGreen As Byte
  93.      RGBRed As Byte
  94.      rgbReserved As Byte
  95.  End Type
  96.  Private Type BITMAP
  97.      bmType As Long
  98.      bmWidth As Long
  99.      bmHeight As Long
  100.      bmWidthBytes As Long
  101.      bmPlanes As Integer
  102.      bmBitsPixel As Integer
  103.      bmBits As Long
  104.  End Type
  105.  Private Type BITMAPINFOHEADER '40 bytes
  106.      biSize As Long
  107.      biWidth As Long
  108.      biHeight As Long
  109.      biPlanes As Integer
  110.      biBitCount As Integer
  111.      biCompression As Long
  112.      biSizeImage As Long
  113.      biXPelsPerMeter As Long
  114.      biYPelsPerMeter As Long
  115.      biClrUsed As Long
  116.      biClrImportant As Long
  117.  End Type
  118.  Private Const NUMPICCOLORS = 255
  119.  Private Type BITMAPINFO256
  120.      bmiHeader As BITMAPINFOHEADER
  121.      bmiColors(255) As RGBQUAD ' 8 bit RGB
  122.  End Type
  123.  Private Type BITMAPINFO2
  124.      bmiHeader As BITMAPINFOHEADER
  125.      bmiColors(0 To 1) As RGBQUAD ' 2 Color RGB
  126.  End Type
  127.  Private Type BITMAPINFO
  128.      bmiHeader As BITMAPINFOHEADER
  129.      ' No Colors 24 bit RGB
  130.  End Type
  131.  ' Below reTyped - easier to write
  132.  Private Type BITMAPFILEHEADER    '14 bytes
  133.      bfType As Integer
  134.      bfSize(3) As Byte 'Long
  135.      'bfSize As Long
  136.      bfReserved1 As Integer
  137.      bfReserved2 As Integer
  138.      'bfOffBits As Long
  139.      bfOffBits(3) As Byte
  140.  End Type
  141.  Private Type DIBSECTION
  142.      dsBm As BITMAP
  143.      dsBmih As BITMAPINFOHEADER
  144.      dsBitfields(2) As Long
  145.      dshSection As Long
  146.      dsOffset As Long
  147.  End Type
  148.  Private Const OFS_MAXPATHNAME = 128
  149.  ' OpenFile() Structure
  150.  Private Type OFSTRUCT
  151.      cBytes As Byte
  152.      fFixedDisk As Byte
  153.      nErrCode As Integer
  154.      Reserved1 As Integer
  155.      Reserved2 As Integer
  156.      szPathName(OFS_MAXPATHNAME) As Byte
  157.  End Type
  158.  Private Type SECURITY_ATTRIBUTES
  159.  nLength As Long
  160.  lpSecurityDescriptor As Long
  161.  bInheritHandle As Long
  162.  End Type
  163.  Private Declare Sub InitCommonControls Lib "comctl32.dll" ()
  164.  Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
  165.  Private Declare Function ReleaseCapture Lib "user32" () As Long
  166.  Private Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long
  167.  Private Declare Function CreateBitmapIndirect Lib "gdi32" (lpBitmap As BITMAP) As Long
  168.  Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
  169.  Private Declare Function CreateBitmap Lib "gdi32" _
  170.    (ByVal nWidth As Long, _
  171.     ByVal nHeight As Long, _
  172.     ByVal nPlanes As Long, _
  173.     ByVal nBitCount As Long, _
  174.     lpBits As Any) As Long
  175.  Private Declare Function LockWindowUpdate Lib "user32" (ByVal hWndLock As Long) As Long
  176.  'Private Declare Function GetPixel Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long) As Long
  177.  Private Declare Function GetPaletteEntries Lib "gdi32" (ByVal hPalette As Long, ByVal wStartIndex As Long, ByVal wNumEntries As Long, lpPaletteEntries As PALETTEENTRY) As Long
  178.  Private Declare Function RealizePalette Lib "gdi32" (ByVal hdc As Long) As Long
  179.  Private Declare Function GetDIBColorTable Lib "gdi32" _
  180.  (ByVal hdc As Long, ByVal un1 As Long, ByVal un2 As Long, pRGBQuad As RGBQUAD) As Long
  181.  Private Declare Function GetCurrentObject Lib "gdi32" _
  182.  (ByVal hdc As Long, ByVal uObjectType As Long) As Long
  183.  Private Declare Function GetStockObject Lib "gdi32" (ByVal nIndex As Long) As Long
  184.  Private Declare Function SetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
  185.  Private Declare Function GetNearestColor Lib "gdi32" (ByVal hdc As Long, ByVal crColor As Long) As Long
  186.  Private Declare Function GetNearestPaletteIndex Lib "gdi32" (ByVal hPalette As Long, ByVal crColor As Long) As Long
  187.  Private Declare Function CreateHalftonePalette Lib "gdi32" (ByVal hdc As Long) As Long
  188.  Private Declare Function SelectPalette Lib "gdi32" (ByVal hdc As Long, ByVal hPalette As Long, ByVal bForceBackground As Long) As Long
  189.  Private Declare Function SetBitmapBits Lib "gdi32" ()
  190.  Private Declare Function FillRect Lib "user32" _
  191.  (ByVal hdc As Long, lpRect As RECTL, ByVal hBrush As Long) As Long
  192.  Private Declare Function GetTempPath Lib "KERNEL32" _
  193.  Alias "GetTempPathA" (ByVal nBufferLength As Long, _
  194.  ByVal lpBuffer As String) As Long
  195.  Private Declare Function GetTempFileName _
  196.    Lib "KERNEL32" Alias "GetTempFileNameA" _
  197.    (ByVal lpszPath As String, _
  198.    ByVal lpPrefixString As String, _
  199.    ByVal wUnique As Long, _
  200.    ByVal lpTempFileName As String) As Long
  201.  Private Declare Function GetMapMode Lib "gdi32" (ByVal hdc As Long) As Long
  202.  ' CHange to allow NULL for PaletteEntry struct.
  203.  ' Function will Return total number of palette entries
  204.  Private Declare Function GetNumSystemPaletteEntries Lib "gdi32" _
  205.  Alias "GetSystemPaletteEntries" _
  206.  (ByVal hdc As Long, ByVal wStartIndex As Long, _
  207.  ByVal wNumEntries As Long, lpPaletteEntries As Long) As Long
  208.  Private Declare Function GetSystemPaletteEntries Lib "gdi32" (ByVal hdc As Long, ByVal wStartIndex As Long, ByVal wNumEntries As Long, lpPaletteEntries As PALETTEENTRY) As Long
  209.  Private Declare Function CreatePalette Lib "gdi32" (lpLogPalette As LOGPALETTE) As Long
  210.  Private Declare Function SetDIBColorTable Lib "gdi32" (ByVal hdc As Long, ByVal un1 As Long, ByVal un2 As Long, pcRGBQuad As RGBQUAD) As Long
  211.  Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
  212.  'changed lpbits from ByRef as Any
  213.  Private Declare Function StretchDIBits Lib "gdi32" _
  214.  (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, _
  215.  ByVal dx As Long, ByVal dy As Long, ByVal SrcX As Long, _
  216.  ByVal SrcY As Long, ByVal wSrcWidth As Long, _
  217.  ByVal wSrcHeight As Long, ByVal lpBits As Long, _
  218.  lpBitsInfo As BITMAPINFO, ByVal wUsage As Long, _
  219.  ByVal dwRop As Long) As Long
  220.  Private Declare Function WindowFromDC Lib "user32" (ByVal hdc As Long) As Long
  221.  Private Declare Function SetMapMode Lib "gdi32" _
  222.  (ByVal hdc As Long, ByVal nMapMode As Long) As Long
  223.  'Private Declare Function GetStockObject Lib "gdi32" (ByVal nIndex As Long) As Long
  224.  Private Declare Function GetStretchBltMode Lib "gdi32" ()
  225.  Private Declare Function GetBoundsRect Lib "gdi32" _
  226.  (ByVal hdc As Long, lprcBounds As RECTL, ByVal flags As Long) As Long
  227.  Private Declare Function RestoreDC Lib "gdi32" (ByVal hdc As Long, ByVal nSavedDC As Long) As Long
  228.  Private Declare Function SaveDC Lib "gdi32" _
  229.  (ByVal hdc As Long) As Long
  230.  Private Declare Function GdiFlush Lib "gdi32" () As Long
  231.  Private Declare Function GetDeviceCaps Lib "gdi32" _
  232.  (ByVal hdc As Long, ByVal nIndex As Long) As Long
  233.  Private Declare Function SetFocus Lib "user32" (ByVal hwnd As Long) As Long
  234.  Private Declare Function GetClientRect Lib "user32" _
  235.  (ByVal hwnd As Long, lpRect As RECTL) As Long
  236.  Private Declare Function GetWindowRect Lib "user32" _
  237.  (ByVal hwnd As Long, lpRect As RECTL) As Long
  238.  Private Declare Sub Sleep Lib "KERNEL32" (ByVal dwMilliseconds As Long)
  239.  ' Create an Information Context
  240.   Private Declare Function apiCreateIC Lib "gdi32" Alias "CreateICA" _
  241.    (ByVal lpDriverName As String, ByVal lpDeviceName As String, _
  242.    ByVal lpOutput As String, lpInitData As Any) As Long
  243.   ' Close an existing Device Context (or information context)
  244.   Private Declare Function apiDeleteDC Lib "gdi32" Alias "DeleteDC" _
  245.    (ByVal hdc As Long) As Long
  246.   Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
  247.  Private Declare Function SetBkMode Lib "gdi32" _
  248.  (ByVal hdc As Long, ByVal nBkMode As Long) As Long
  249.  Private Declare Function apiCreateCompatibleBitmap Lib "gdi32" _
  250.   Alias "CreateCompatibleBitmap" _
  251.   (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
  252.   Private Declare Sub apiCopyMemory Lib "KERNEL32" Alias "RtlMoveMemory" _
  253.       (Destination As Any, Source As Any, ByVal Length As Long)
  254.   Private Declare Function apiGetStockObject Lib "gdi32" Alias "GetStockObject" _
  255.   (ByVal nIndex As Long) As Long
  256.       
  257.   Private Declare Function apiSelectObject Lib "gdi32" _
  258.    Alias "SelectObject" (ByVal hdc As Long, ByVal hObject As Long) As Long
  259.   Private Declare Function apiSetTextAlign Lib "gdi32" Alias "SetTextAlign" _
  260.   (ByVal hdc As Long, ByVal wFlags As Long) As Long
  261.   Private Declare Function apiSetTextColor Lib "gdi32" Alias "SetTextColor" _
  262.   (ByVal hdc As Long, ByVal crColor As Long) As Long
  263.   Private Declare Function apiSetBkColor Lib "gdi32" Alias "SetBkColor" _
  264.   (ByVal hdc As Long, ByVal crColor As Long) As Long
  265.   Private Declare Function apiGetDC Lib "user32" _
  266.     Alias "GetDC" (ByVal hwnd As Long) As Long
  267.   Private Declare Function apiReleaseDC Lib "user32" _
  268.     Alias "ReleaseDC" (ByVal hwnd As Long, _
  269.     ByVal hdc As Long) As Long
  270.   Private Declare Function apiCreateCompatibleDC Lib "gdi32" _
  271.     Alias "CreateCompatibleDC" (ByVal hdc As Long) As Long
  272.    Private Declare Function apiBitBlt Lib "gdi32" _
  273.     Alias "BitBlt" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, _
  274.     ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, _
  275.     ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
  276.   Private Declare Function apiDeleteObject Lib "gdi32" _
  277.     Alias "DeleteObject" (ByVal hObject As Long) As Long
  278.   Private Declare Function apiGetObject Lib "gdi32" Alias "GetObjectA" _
  279.   (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
  280.   Private Declare Function apiGetDeviceCaps Lib "gdi32" _
  281.     Alias "GetDeviceCaps" (ByVal hdc As Long, ByVal nIndex As Long) As Long
  282.  Private Declare Function ExtFloodFill Lib "gdi32" _
  283.  (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, _
  284.  ByVal crColor As Long, ftype As Long) As Long
  285.   Private Declare Function apiMoveToEx Lib "gdi32" Alias "MoveToEx" _
  286.   (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, lpPoint As Any) As Long
  287.   'above was lpPoint as POINTAPI, changed to Any to allow NULL
  288.   Private Declare Function apiCreateDIBSection Lib "gdi32" Alias _
  289.   "CreateDIBSection" (ByVal hdc As Long, pBitmapInfo As BITMAPINFO, _
  290.   ByVal un As Long, lplpVoid As Long, ByVal handle As Long, _
  291.   ByVal dw As Long) As Long
  292.    Private Declare Function apiCreateDIBSection2 Lib "gdi32" Alias _
  293.   "CreateDIBSection" (ByVal hdc As Long, pBitmapInfo As BITMAPINFO2, _
  294.   ByVal un As Long, lplpVoid As Long, ByVal handle As Long, _
  295.   ByVal dw As Long) As Long
  296.    Private Declare Function apiCreateDIBSection255 Lib "gdi32" Alias _
  297.   "CreateDIBSection" (ByVal hdc As Long, pBitmapInfo As BITMAPINFO256, _
  298.   ByVal un As Long, lplpVoid As Long, ByVal handle As Long, _
  299.   ByVal dw As Long) As Long
  300.   Private Declare Function apiFillRect Lib "user32" Alias "FillRect" _
  301.   (ByVal hdc As Long, lpRect As RECTL, ByVal hBrush As Long) As Long
  302.           
  303.   Private Declare Function apiCreateSolidBrush Lib "gdi32" Alias "CreateSolidBrush" _
  304.   (ByVal crColor As Long) As Long
  305.   Private Declare Function GlobalLock Lib "KERNEL32" (ByVal hMem As Long) As Long
  306.   Private Declare Function GlobalAlloc Lib "KERNEL32" _
  307.     (ByVal wFlags As Long, ByVal dwBytes As Long) As Long
  308.   Private Declare Sub CopyMemory Lib "KERNEL32" Alias "RtlMoveMemory" _
  309.   (hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)
  310.  Private Declare Function CreateFile Lib "KERNEL32" _
  311.  Alias "CreateFileA" _
  312.  (ByVal lpFileName As String, _
  313.  ByVal dwDesiredAccess As Long, _
  314.  ByVal dwShareMode As Long, _
  315.  lpSecurityAttributes As SECURITY_ATTRIBUTES, _
  316.  ByVal dwCreationDisposition As Long, _
  317.  ByVal dwFlagsAndAttributes As Long, _
  318.  ByVal hTemplateFile As Long) As Long
  319.  Private Declare Function CloseHandle Lib "KERNEL32" _
  320.  (ByVal hObject As Long) As Long
  321.  Private Declare Function WriteFile Lib "KERNEL32" _
  322.  (ByVal hFile As Long, _
  323.  lpBuffer As Any, _
  324.  ByVal nNumberOfBytesToWrite As Long, _
  325.  lpNumberOfBytesWritten As Long, _
  326.  ByVal lpOverlapped As Long) As Long
  327.  ' For asynchronous operation, change to
  328.  ' lpOverlapped as OVERLAPPED.
  329.  Private Declare Function GetDiskFreeSpace Lib "KERNEL32" _
  330.  Alias "GetDiskFreeSpaceA" _
  331.  (ByVal lpRootPathName As String, _
  332.  lpSectorsPerCluster As Long, lpBytesPerSector As Long, _
  333.  lpNumberOfFreeClusters As Long, lpTotalNumberOfClusters As Long) As Long
  334.  Private Declare Function ReadFile Lib "KERNEL32" _
  335.  (ByVal hFile As Long, _
  336.  lpBuffer As Any, _
  337.  ByVal nNumberOfBytesToRead As Long, _
  338.  lpNumberOfBytesRead As Long, _
  339.  ByVal lpOverlapped As Long) As Long
  340.  ' For asynchronous operation, change to
  341.  ' lpOverlapped as OVERLAPPED.
  342.  Private Declare Function SetFilePointer Lib "KERNEL32" _
  343.  (ByVal hFile As Long, _
  344.  ByVal lDistanceToMove As Long, _
  345.  lpDistanceToMoveHigh As Long, _
  346.  ByVal dwMoveMethod As Long) As Long
  347.                   
  348.   ' Constants GDI
  349.   Private Const SM_CXVSCROLL = 2
  350.  ' File Constants
  351.  Private Const MAX_PATH = 260
  352.  'Private Const OF_PROMPT = &H2000
  353.  'Private Const OF_READ = &H0
  354.  'Private Const OF_READWRITE = &H2
  355.  'Private Const OF_CREATE = &H1000
  356.  Private Const FILE_SHARE_READ = &H1
  357.  Private Const FILE_SHARE_WRITE = &H2
  358.  Private Const GENERIC_READ = &H80000000
  359.  Private Const GENERIC_WRITE = &H40000000
  360.  Private Const FILE_FLAG_RANDOM_ACCESS = &H10000000
  361.  Private Const FILE_ATTRIBUTE_NORMAL = &H80
  362.  Private Const INVALID_HANDLE_VALUE = -1
  363.  Private Const CREATE_NEW = 1
  364.  Private Const CREATE_ALWAYS = 2
  365.  Private Const OPEN_EXISTING = 3
  366.  Private Const OPEN_ALWAYS = 4
  367.  Private Const TRUNCATE_EXISTING = 5
  368.  Private Const FILE_BEGIN = 0
  369.  Private Const FILE_CURRENT = 1
  370.  Private Const FILE_END = 2
  371.  ' GetObject constants
  372.  Private Const OBJ_DC = 3
  373.  Private Const OBJ_METADC = 4
  374.  Private Const OBJ_PAL = 5
  375.  Private Const OBJ_FONT = 6
  376.  Private Const OBJ_BITMAP = 7
  377.  Private Const OBJ_REGION = 8
  378.  Private Const OBJ_METAFILE = 9
  379.  Private Const OBJ_MEMDC = 10
  380.  Private Const OBJ_EXTPEN = 11
  381.  Private Const OBJ_ENHMETADC = 12
  382.  Private Const OBJ_ENHMETAFILE = 13
  383.  ' constants for the biCompression field
  384.  Private Const BI_RGB = 0&
  385.  Private Const BI_RLE8 = 1&
  386.  Private Const BI_RLE4 = 2&
  387.  Private Const BI_bitfields = 3&
  388.  ' Stock Logical Objects
  389.  Private Const WHITE_BRUSH = 0
  390.  Private Const LTGRAY_BRUSH = 1
  391.  Private Const GRAY_BRUSH = 2
  392.  Private Const DKGRAY_BRUSH = 3
  393.  Private Const BLACK_BRUSH = 4
  394.  Private Const NULL_BRUSH = 5
  395.  Private Const HOLLOW_BRUSH = NULL_BRUSH
  396.  Private Const WHITE_PEN = 6
  397.  Private Const BLACK_PEN = 7
  398.  Private Const NULL_PEN = 8
  399.  Private Const OEM_FIXED_FONT = 10
  400.  Private Const ANSI_FIXED_FONT = 11
  401.  Private Const ANSI_VAR_FONT = 12
  402.  Private Const SYSTEM_FONT = 13
  403.  Private Const DEVICE_DEFAULT_FONT = 14
  404.  Private Const DEFAULT_PALETTE = 15
  405.  Private Const SYSTEM_FIXED_FONT = 16
  406.  Private Const STOCK_LAST = 16
  407.  Private Const CLR_INVALID = &HFFFF
  408.  ' OpenFile() Flags
  409.  Private Const OF_READ = &H0
  410.  Private Const OF_WRITE = &H1
  411.  Private Const OF_READWRITE = &H2
  412.  Private Const OF_SHARE_COMPAT = &H0
  413.  Private Const OF_SHARE_EXCLUSIVE = &H10
  414.  Private Const OF_SHARE_DENY_WRITE = &H20
  415.  Private Const OF_SHARE_DENY_READ = &H30
  416.  Private Const OF_SHARE_DENY_NONE = &H40
  417.  Private Const OF_PARSE = &H100
  418.  Private Const OF_DELETE = &H200
  419.  Private Const OF_VERIFY = &H400
  420.  Private Const OF_CANCEL = &H800
  421.  Private Const OF_CREATE = &H1000
  422.  Private Const OF_PROMPT = &H2000
  423.  Private Const OF_EXIST = &H4000
  424.  Private Const OF_REOPEN = &H8000
  425.  '  Ternary raster operations
  426.  Private Const SRCCOPY = &HCC0020 ' (DWORD) dest = source
  427.  Private Const SRCPAINT = &HEE0086        ' (DWORD) dest = source OR dest
  428.  Private Const SRCAND = &H8800C6  ' (DWORD) dest = source AND dest
  429.  Private Const SRCINVERT = &H660046       ' (DWORD) dest = source XOR dest
  430.  Private Const SRCERASE = &H440328        ' (DWORD) dest = source AND (NOT dest )
  431.  Private Const NOTSRCCOPY = &H330008      ' (DWORD) dest = (NOT source)
  432.  Private Const NOTSRCERASE = &H1100A6     ' (DWORD) dest = (NOT src) AND (NOT dest)
  433.  Private Const MERGECOPY = &HC000CA       ' (DWORD) dest = (source AND pattern)
  434.  Private Const MERGEPAINT = &HBB0226      ' (DWORD) dest = (NOT source) OR dest
  435.  Private Const PATCOPY = &HF00021 ' (DWORD) dest = pattern
  436.  Private Const PATPAINT = &HFB0A09        ' (DWORD) dest = DPSnoo
  437.  Private Const PATINVERT = &H5A0049       ' (DWORD) dest = pattern XOR dest
  438.  Private Const DSTINVERT = &H550009       ' (DWORD) dest = (NOT dest)
  439.  Private Const BLACKNESS = &H42 ' (DWORD) dest = BLACK
  440.  Private Const WHITENESS = &HFF0062       ' (DWORD) dest = WHITE
  441.  Private Const DIB_RGB_COLORS = 0 '  color table in RGBs
  442.    ' Background Modes
  443.  Private Const TRANSPARENT = 1
  444.  Private Const OPAQUE = 2
  445.  Private Const BKMODE_LAST = 2
  446.  '  Mapping Modes
  447.  Private Const MM_TEXT = 1
  448.  Private Const MM_LOMETRIC = 2
  449.  Private Const MM_HIMETRIC = 3
  450.  Private Const MM_LOENGLISH = 4
  451.  Private Const MM_HIENGLISH = 5
  452.  Private Const MM_TWIPS = 6
  453.  Private Const MM_ISOTROPIC = 7
  454.  Private Const MM_ANISOTROPIC = 8
  455.  ' Brush Styles
  456.  Private Const BS_SOLID = 0
  457.  Private Const BS_NULL = 1
  458.  Private Const BS_HOLLOW = BS_NULL
  459.  Private Const BS_HATCHED = 2
  460.  Private Const BS_PATTERN = 3
  461.  Private Const BS_INDEXED = 4
  462.  Private Const BS_DIBPATTERN = 5
  463.  Private Const BS_DIBPATTERNPT = 6
  464.  Private Const BS_PATTERN8X8 = 7
  465.  Private Const BS_DIBPATTERN8X8 = 8
  466.  '  Device Parameters for GetDeviceCaps()
  467.  Private Const DRIVERVERSION = 0      '  Device driver version
  468.  Private Const TECHNOLOGY = 2         '  Device classification
  469.  Private Const HORZSIZE = 4           '  Horizontal size in millimeters
  470.  Private Const VERTSIZE = 6           '  Vertical size in millimeters
  471.  Private Const HORZRES = 8            '  Horizontal width in pixels
  472.  Private Const VERTRES = 10           '  Vertical width in pixels
  473.  Private Const BITSPIXEL = 12         '  Number of bits per pixel
  474.  Private Const PLANES = 14            '  Number of planes
  475.  Private Const NUMBRUSHES = 16        '  Number of brushes the device has
  476.  Private Const NUMPENS = 18           '  Number of pens the device has
  477.  Private Const NUMMARKERS = 20        '  Number of markers the device has
  478.  Private Const NUMFONTS = 22          '  Number of fonts the device has
  479.  Private Const NUMCOLORS = 24         '  Number of colors the device supports
  480.  Private Const PDEVICESIZE = 26       '  Size required for device descriptor
  481.  Private Const CURVECAPS = 28         '  Curve capabilities
  482.  Private Const LINECAPS = 30          '  Line capabilities
  483.  Private Const POLYGONALCAPS = 32     '  Polygonal capabilities
  484.  Private Const TEXTCAPS = 34          '  Text capabilities
  485.  Private Const CLIPCAPS = 36          '  Clipping capabilities
  486.  Private Const RASTERCAPS = 38        '  Bitblt capabilities
  487.  Private Const ASPECTX = 40           '  Length of the X leg
  488.  Private Const ASPECTY = 42           '  Length of the Y leg
  489.  Private Const ASPECTXY = 44          '  Length of the hypotenuse
  490.  Private Const LOGPIXELSX = 88        '  Logical pixels/inch in X
  491.  Private Const LOGPIXELSY = 90        '  Logical pixels/inch in Y
  492.  Private Const SIZEPALETTE = 104      '  Number of entries in physical palette
  493.  Private Const NUMRESERVED = 106      '  Number of reserved entries in palette
  494.  Private Const COLORRES = 108         '  Actual color resolution
  495.  ' StretchBlt() Modes
  496.  Private Const BLACKONWHITE = 1
  497.  Private Const WHITEONBLACK = 2
  498.  Private Const COLORONCOLOR = 3
  499.  Private Const HALFTONE = 4
  500.  Private Const MAXSTRETCHBLTMODE = 4
  501.  Private Const TWIPSPERINCH = 1440
  502.  ' ExtFloodFill style flags
  503.  Private Const FLOODFILLBORDER = 0
  504.  Private Const FLOODFILLSURFACE = 1
  505.  ' How many total bytes in our ColorTable
  506.  ' 256*3 RGB Triplets
  507.  Private Const SizeOfMaxLocalColorTable = 768
  508.  ' ** START OF OUR VARIABLES **
  509.  ' Handle to our Bitmap
  510.  Dim hBMap As Long
  511.  ' Screen Compatible DCs
  512.  ' Handle to Access Application Device Context
  513.  Dim hDCApp As Long
  514.  Dim hDCbuffer As Long
  515.  ' Not need for this version
  516.  ' Was for version using DIB
  517.  ' Leave in case we want File Save
  518.  Dim bmh256 As BITMAPINFO256
  519.  ' I put in then took out support for
  520.  ' palette's to look after 256 Color Mode.
  521.  ' Used in Access Version.
  522.  Dim pal256(0 To 255) As PALETTEENTRY
  523.  ' handle to System generated Halftone palette
  524.  Dim hpalHalfTone As Long
  525.  ' hold handle to original bitmap selected into a DC
  526.  Dim hBmpOrig As Long
  527.  ' Array holds starting Byte offset for begining of each Gif Frame
  528.  Private mGifStart() As Long
  529.  ' Array holds starting Byte offset for begining of each Gif Frame
  530.  Private mGifEnd() As Long
  531.  ' *********** CHANGE*********
  532.  ' Change to as Object before release
  533.  ' as it is the only DLL Reference
  534.  ' in this module.
  535.  ' Array of StdPicture objects
  536.  Dim hStdPicture() As Object 'StdPicture
  537.        
  538.  ' Saves declaring Temp vars in every function/sub
  539.  Private lngRet As Long
  540.  Private blRet As Boolean
  541.  Private lngTemp As Long
  542.  Dim hDCtemp As Long
  543.  Dim bTemp As Byte
  544.  Dim x As Integer
  545.  'Assorted GDI handles
  546.  Private mImageCtl As Object
  547.  Private mhDCImage As Long
  548.  Private mBitmap As Long
  549.  Private mBitMapAdd As Long
  550.  Private hOrigBitmap As Long
  551.  Private hOrigFont As Long
  552.  Private hBrush As Long
  553.  Private hOldBrush As Long
  554.  Private hOrigBrush As Long
  555.  Dim mForeColor As Long
  556.  Dim mBackColor As Long
  557.  ' Need some GDI structures
  558.  ' mainly for Access version.
  559.  Private lpBmih As BITMAPINFO
  560.  Dim rc As RECTL
  561.  Dim bm As BITMAP
  562.  Dim bmap As BITMAP
  563.  ' Byte array to hold entire Original Animated Disk file.
  564.  Dim bArray() As Byte
  565.  ' Logical Screen Descriptor packed bits field
  566.  ' since we will also use this variable in
  567.  ' our processing for each Gif frame.
  568.  ' Don't really need to store this field for
  569.  ' each frame but good idea for debugging
  570.  ' and in case this field is extended or
  571.  ' used for additional purposes.
  572.  Dim PackedFields() As Byte
  573.  ' Logical Screen Descriptor
  574.  ' Background color Index
  575.  Dim BackgroundColorIndex As Byte
  576.  ' Logical Screen Descriptor
  577.  ' Pixel Aspect Ratio
  578.  Dim PixelASpectRatio As Byte
  579.  ' Logical Screen Descriptor
  580.  ' number of bits per primary color in orig pic
  581.  Dim ColorResolution As Byte
  582.  ' Logical Screen Descriptor
  583.  ' Is there a Global Color Table immediately
  584.  ' following this Block
  585.  Dim GlobalColorTableFlag As Boolean
  586.  ' Max 256 Colors of 8bitx3 RGB triplets values
  587.  Dim GlobalColorTable(0 To 767) As Byte
  588.  ' Logical Screen Descriptor
  589.  ' Image Max Width
  590.  Dim LogWidth As Integer
  591.  ' Logical Screen Descriptor
  592.  ' Image Max Height
  593.  Dim LogHeight As Integer
  594.  ' Logical Screen Descriptor
  595.  ' Is Global Color table Sorted?
  596.  Dim GSortFlag As Boolean
  597.  ' Logical Screen Descriptor
  598.  ' raise 2 to the (value of this field + 1)
  599.  ' to get actaul size of Global Color Table
  600.  Dim SizeOfGlobalColorTable As Byte
  601.  ' Arrays to store the value for each
  602.  ' individual frame of the Animated Gif.
  603.  Dim ImageLeft() As Integer
  604.  Dim ImageTop() As Integer
  605.  Dim ImageWidth() As Integer
  606.  Dim ImageHeight() As Integer
  607.  Dim LSortFlag() As Boolean
  608.  Dim LocalColorTableFlag() As Boolean
  609.  Dim InterLaceFlag() As Boolean
  610.  Dim SizeOfLocalColorTable() As Byte
  611.  Dim LocalColorTable(0 To 767) As Byte
  612.  Dim LZWMinimumCodeSize() As Byte
  613.  Dim DelayTime() As Integer
  614.  Dim TransparentColorIndex() As Byte
  615.  Dim DisposalMethod() As Byte
  616.  Dim UserInputFlag() As Boolean
  617.  Dim TransparentColorFlag() As Boolean
  618.  ' ********* FIX !!!!!!!!!!!!!!!!   *********
  619.  ' Will come back and add more support for
  620.  ' LocalColorTables
  621.  'Dim arrayLocalColorTables() As LocalColorTable()
  622.  ' Loop counter
  623.  Dim ctr1 As Long
  624.  ' Holder for temp RGB values
  625.  Dim bTemparray(0 To 2) As Byte
  626.  ' Another Holder for temp BackGround RGB Value
  627.  Dim bBGarray(0 To 2) As Byte
  628.  ' Another Holder for temp Transparent RGB Value comparison
  629.  Dim bTransparentarray(0 To 2) As Byte
  630.       
  631.  ' For createDibSection
  632.  ' Used in Access version
  633.  'Dim bmh As BITMAPINFO256
  634.  ' User Defined Delay Property
  635.  Dim mUserDelay As Long
  636.  ' Some older Gifs use the Transparent Color
  637.  ' in the actual Image. This property turns on
  638.  ' a function to change the Transparent Color
  639.  ' to a Color not currently used in the Image.
  640.  Dim mChangeTransparentColor As Boolean
  641.  ' Prop to Signal Stop Rendering
  642.  Dim mStopRender As Boolean
  643.  'Default Property Values:
  644.  Const m_def_strGifFileName = ""
  645.  'Property Variables:
  646.  Dim m_strGifFileName As String
  647.  Dim m_hDC As Long
  648.  'Event Declarations:
  649.  Event Resize() 'MappingInfo=UserControl,UserControl,-1,Resize
  650.  Event Paint() 'MappingInfo=UserControl,UserControl,-1,Paint
  651.  ' Number of Frames in this Animated Gif file
  652.  Dim m_NumberOfFrames As Long
  653.  ' Current Frame Number we are rendering
  654.  Dim m_CurrentFrame As Long
  655.  ' Is there a valid stored FileName prop to display
  656.  Dim m_DisplaySavedGifFileName As Boolean
  657.  ' Create instance of MS Common Dialog CLass
  658.  Dim clsDialog As Object 'New clsCommonDialog
  659.          
  660.  'DEVELOPED AND TESTED UNDER MICROSOFT VB6 ONLY
  661.  'Copyright: Stephen Lebans - Lebans Holdings 1999 Ltd.
  662.  'Name:      AnimatedGifCtl
  663.  'Version:   2.0
  664.  'Purpose:   Allow for display of Animated Gif files.
  665.  '           I've stuck the code in an ActiveX
  666.  '           control just to make it easier to use.
  667.  '           You can pull the code back out and
  668.  '           use the handle to the Device Context
  669.  '           of a PictureBox control instead of the
  670.  '           UserControl. You would also have to
  671.  '           use the PictureBox BackColor prop instead
  672.  '           of the UserControl BackColor prop.
  673.  'Why?:      Because I have never seen complete source code
  674.  '           in Visual Basic to play Animated Gifs.
  675.  'Author:    Stephen Lebans
  676.  'Email:     Stephen@lebans.com
  677.  'Web Site:  www.lebans.com
  678.  'Date:      May 20, 2000, 10:14:25 PM
  679.  'Called by: Wherever. :-)
  680.  'Calls:     Bunch of API stuff
  681.  'Inputs:    FileName prop. See Inline Comments for explanation.
  682.  'Output:    See inline Docs for each Function call
  683.  'Credits:   Dev Ashish, Terry Kreft, the MS KB
  684.  '           and others mentioned directly
  685.  '           in the code comments. :-)
  686.  'BUGS:      No serious ones that I've noticed but something always pops up.
  687.  '           Most problems I have seen relate to Video Drivers,
  688.  '           specifically Hardware Acceleration.
  689.  '           Please report any bugs to my email address.
  690.  'What's Missing:
  691.  '           The actual Gif Render function needs to run in its own
  692.  '           seperate thread. Not really possible in this version of VB.
  693.  '           I may revisit this issue when VB7 arives.
  694.  '           Proper Error handling :-(
  695.  '           An AutoBackColor feature. Remember a lot of
  696.  '           Animated Gif files do nto have Transparent Backgrounds.
  697.  '           Please send me a copy of any enhancements/bug fixes you create for this
  698.  '           function at Stephen@lebans.com
  699.  'Enjoy
  700.  'Stephen Lebans
  701.  '********************************************
  702.  '***************** CODE START ***************
  703.  Property Get UserDelay() As Long
  704. Attribute UserDelay.VB_ProcData.VB_Invoke_Property = "PropPage1"
  705.  UserDelay = mUserDelay
  706.  End Property
  707.  Property Let UserDelay(lngDelay As Long)
  708.  ' Amount of extra Delay to add to add
  709.  ' to amount specified directly in Gif file
  710.  If IsNumeric(lngDelay) Then
  711.      mUserDelay = lngDelay
  712.  Else
  713.      mUserDelay = 10
  714.  End If
  715.  ' Boundary checking for Max/Min Delay
  716.  If mUserDelay > 1000 Then mUserDelay = 1000
  717.  If mUserDelay < 1 Then mUserDelay = 1
  718.  End Property
  719.  Property Get StopRender() As Boolean
  720. Attribute StopRender.VB_ProcData.VB_Invoke_Property = "PropPage1"
  721.  ' Flag to tell us to stop rendering Gif Frame
  722.  StopRender = mStopRender
  723.  End Property
  724.  Property Let StopRender(blS As Boolean)
  725.  mStopRender = blS
  726.  End Property
  727.  Property Get ChangeTransparentColor() As Boolean
  728.  ' Flag to tell us to change current
  729.  ' Transparent color to a value not used
  730.  ' in the current Image.
  731.  ChangeTransparentColor = mChangeTransparentColor
  732.  End Property
  733.  Property Let ChangeTransparentColor(blC As Boolean)
  734.  mChangeTransparentColor = blC
  735.  End Property
  736.  Property Get NumberofFrames() As Long
  737.  ' How many individual frames make up
  738.  ' this Animated Gif file.
  739.  NumberofFrames = m_NumberOfFrames
  740.  End Property
  741.  Property Let NumberofFrames(nframes As Long)
  742.  m_NumberOfFrames = nframes
  743.  End Property
  744.  Property Get CurrentFrame() As Long
  745.  ' The current Frame number we are rendering.
  746.  ' This is a ZERO based index
  747.  CurrentFrame = m_CurrentFrame
  748.  End Property
  749.  Property Let CurrentFrame(curframe As Long)
  750.  m_CurrentFrame = curframe
  751.  End Property
  752.  Property Get DisplaySavedGifFileName() As Boolean
  753.  ' Did user set the FileName prop in Design View
  754.  DisplaySavedGifFileName = m_DisplaySavedGifFileName
  755.  End Property
  756.  Property Let DisplaySavedGifFileName(blSF As Boolean)
  757.  m_DisplaySavedGifFileName = blSF
  758.  End Property
  759.        
  760.  Private Sub ClearControl()
  761.  ' Repaint the background of the Control
  762.  Dim rc1 As RECTL
  763.  Dim hNewBrush As Long
  764.  ' For Access Version
  765.  ' Let's use mBackColor
  766.  'lngRet = apiFloodFill(hDC, 0, 0, mBackColor)
  767.  If hdc = 0 Then Exit Sub
  768.  rc1.Right = ScaleWidth
  769.  rc1.Bottom = ScaleHeight
  770.  lngTemp = ConvertSystemColor(BackColor)
  771.  hNewBrush = apiCreateSolidBrush(lngTemp)
  772.  'holdbrush = apiSelectObject(hDC, hnewbrush)
  773.  'lngRet = apiDeleteObject(holdbrush)
  774.  lngRet = apiFillRect(hdc, rc1, hNewBrush)
  775.  lngRet = apiDeleteObject(hNewBrush)
  776.  End Sub
  777.       
  778.  Public Sub SetBackColor()
  779.  ' Call Color Dialog to select
  780.  ' a new color for the Control's Background
  781.  Dim lngTemp As Long
  782.  ' Call the Color Dialog
  783.  clsDialog.ShowColor
  784.  lngTemp = clsDialog.Color
  785.  If lngTemp <> UserControl.BackColor Then
  786.      UserControl.BackColor = lngTemp
  787.      ClearControl
  788.  End If
  789.  ' For Access Version
  790.  'mImageCtl.BackColor = mBackColor
  791.  'lngRet = apiSetBkColor(hDC, mBackColor)
  792.  End Sub
  793.               
  794.               
  795.  Private Function GetUniqueFilename(Optional Path As String = "", _
  796.  Optional Prefix As String = "", _
  797.  Optional UseExtension As String = "") _
  798.  As String
  799.  ' originally Posted by Terry Kreft
  800.  ' to: comp.Databases.ms -Access
  801.  ' Subject:  Re: Creating Unique filename ??? (Dev code)
  802.  ' Date: 01/15/2000
  803.  ' Author: Terry Kreft <terry.kreft@mps.co.uk>
  804.  ' SL Note: Input strings must be NULL terminated.
  805.  ' Here it is done by the calling function.
  806.    Dim wUnique As Long
  807.    Dim lpTempFileName As String
  808.    Dim lngRet As Long
  809.     Dim FileHeader As BITMAPFILEHEADER
  810.    wUnique = 0
  811.    If Path = "" Then Path = CurDir
  812.    lpTempFileName = String(MAX_PATH, 0)
  813.    lngRet = GetTempFileName(Path, Prefix, _
  814.                              wUnique, lpTempFileName)
  815.    lpTempFileName = Left(lpTempFileName, _
  816.                          InStr(lpTempFileName, Chr(0)) - 1)
  817.    Call Kill(lpTempFileName)
  818.    If Len(UseExtension) > 0 Then
  819.      lpTempFileName = Left(lpTempFileName, Len(lpTempFileName) - 3) & UseExtension
  820.    End If
  821.    GetUniqueFilename = lpTempFileName
  822.  End Function
  823.                  
  824.  Private Function fCreateBitMap() As Boolean
  825.  ' Function to create a Temp Bitmap.
  826.  ' We use this as an off screen buffer
  827.  ' so we elimate screen flashing during redraws
  828.  ' Temp handles for GDI objects
  829.  Dim hBrush As Long, origBrush As Long
  830.  ' Fill in our Bitmap structure
  831.  bmap.bmBitsPixel = 24
  832.  bmap.bmHeight = LogHeight
  833.  bmap.bmPlanes = 1
  834.  bmap.bmWidth = ((LogWidth + 31) And &HFFFFFE0)
  835.  bmap.bmWidthBytes = bmap.bmWidth * 3
  836.  hBMap = CreateCompatibleBitmap(hdc, bmap.bmWidth, bmap.bmHeight)
  837.  ' THis is deleted when Class exits
  838.  hBmpOrig = apiSelectObject(hDCbuffer, hBMap)
  839.  ' Fill in our Rectangle structure
  840.  rc.Top = 0
  841.  rc.Bottom = bmap.bmHeight
  842.  rc.Left = 0
  843.  rc.Right = bmap.bmWidth
  844.  ' Let's fill our new Bitmap with the Background Color
  845.  ' Make sure we can handle System colors(MSB is set)
  846.  lngTemp = ConvertSystemColor(BackColor) '.BackColor)
  847.  hBrush = apiCreateSolidBrush(lngTemp)
  848.  lngRet = apiFillRect(hDCbuffer, rc, hBrush)
  849.  lngRet = apiDeleteObject(hBrush)
  850.  End Function
  851.          
  852.     Private Function fGifBreakOutFrames() As Boolean
  853.     ' This is the main function. Missing final
  854.     ' support for Local Color Tables. Hopefully
  855.     ' will be included with next revision.
  856.     ' Break an Animated Gif file up into the seperate
  857.     ' GIF frames  that make up the entire animation.
  858.      
  859.     Const Pathlen = 256
  860.      
  861.      ' GIF Block Extension Label Values
  862.      Const ExtensionIntroducer = &H21
  863.      Const ApplicationExtension = &HFF
  864.      Const CommentExtension = &HFE
  865.      Const GraphicControlExtension = &HF9
  866.      Const ImageDescriptor = &H2C
  867.      Const PlainTextExtension = &H1
  868.      Const Trailer = &H3B
  869.      ' Intel Byte ordering
  870.      Const GIF89 = &H38464947
  871.      
  872.      ' Length of Logical Screen Descriptor Block
  873.      Const lenLogicalScreenDescriptor = 7
  874.      
  875.      ' Length of Graphic Control Extension Block
  876.      Const lenGraphicControlExtension = 7
  877.      
  878.      ' Length of Image Descriptor Block
  879.      Const lenImageDescriptor = 10
  880.       
  881.      ' Generally use Hex values but
  882.      ' Decimal is clearer for educational purposes.
  883.      Const Bit8 = 128
  884.      Const Bit7 = 64
  885.      Const Bit6 = 32
  886.      Const Bit5 = 16
  887.      Const Bit4 = 8
  888.      Const Bit3 = 4
  889.      Const Bit2 = 2
  890.      Const Bit1 = 1
  891.      
  892.     ' Length of Gif File Header
  893.     Const lenGifHeader = 6
  894.     ' Current Position in our Byte Array
  895.     Dim lngCurPosition As Long
  896.      ' Starting offset to  current GIF frame
  897.      Dim lngGifStart As Long
  898.      ' Ending offset to current GIF Frame
  899.      Dim lngGifEnd As Long
  900.      ' Temp var to  check our Constants against
  901.      Dim varTemp As Variant
  902.      ' Need Flag so we can init arrays properly
  903.      ' first time through loops
  904.      Dim blFirstTime As Boolean
  905.      blFirstTime = True
  906.      ' Saves typing and necessary logic to
  907.      ' init and Redim our storage arrays
  908.      ' Loop Counter
  909.      Dim lc As Long
  910.      ' Self explanatory
  911.      Dim strPath  As String * Pathlen
  912.      Dim strPathandFileName  As String
  913.      Dim lngStartLocalColorTable As Long
  914.      Dim lngStartGlobalColorTable As Long
  915.      Dim lngNewTransparent As Long
  916.      Dim lngIndexDuplicate As Long
  917.      Dim lngMax As Long
  918.      Dim lngMaxPrevious As Long
  919.      ' FileHandle Number
  920.      Dim Fnum As Integer
  921.      
  922.      ' Length of file
  923.      Dim FLength As Long
  924.      
  925.      ' Initialize our Class arrays
  926.      ' Most importantly we release all of our handles
  927.      ' to the StdPicture objects that were created the
  928.      ' last time we ran this function.
  929.      CleanUp
  930.      
  931.                  
  932.      ' Is there a valid Filename
  933.      If Len(strGifFileName & vbNullString) < 1 Then Exit Function
  934.                        
  935.       ' Get next avail file handle
  936.      Fnum = FreeFile
  937.      
  938.      Open strGifFileName For Binary As Fnum
  939.      FLength = LOF(Fnum)
  940.      ' Animated Gifs are relatively Small
  941.      ' Read in Entire File!
  942.      ReDim bArray(1 To FLength)
  943.      Get Fnum, , bArray
  944.      Close Fnum
  945.          
  946.           
  947.      ' We need to handle the PackedFlags array seperately
  948.      ' since it is the only array used in this part of the function
  949.      ReDim PackedFields(0)
  950.      
  951.      ' Let's check and make sure we are an Animated Gif!
  952.      apiCopyMemory lngRet, bArray(1), 4
  953.      If lngRet <> GIF89 Then GoTo err_NoGif
  954.         
  955.      ' OK let's fill in our variables we derive from
  956.      ' The Logical Screen Descriptor Block that always follows
  957.      ' the 6 byte File Header with the GIF Signature
  958.      apiCopyMemory LogWidth, bArray(lenGifHeader + 1), 2
  959.      apiCopyMemory LogHeight, bArray(lenGifHeader + 3), 2
  960.      apiCopyMemory PackedFields(0), bArray(lenGifHeader + 5), 1
  961.      apiCopyMemory BackgroundColorIndex, bArray(lenGifHeader + 6), 1
  962.      apiCopyMemory PixelASpectRatio, bArray(lenGifHeader + 7), 1
  963.            
  964.      
  965.      ' update our current position in the buffer
  966.      lngCurPosition = lngCurPosition + lenGifHeader + lenLogicalScreenDescriptor
  967.      
  968.         
  969.      ' Let's derive our props from the packed Bit fields
  970.      If PackedFields(0) And Bit8 Then GlobalColorTableFlag = True
  971.      ' ColorResolution variable is a Byte with really only 3 bits significant
  972.      If PackedFields(0) And Bit7 Then ColorResolution = Bit3
  973.      If PackedFields(0) And Bit6 Then ColorResolution = ColorResolution Or Bit2
  974.      If PackedFields(0) And Bit5 Then ColorResolution = ColorResolution Or Bit1
  975.      
  976.      If PackedFields(0) And Bit4 Then GSortFlag = True
  977.      
  978.      ' SizeOfGlobalColorTable variable is a Byte with really only 3 bits significant
  979.      ' SizeOfGlobalColorTable variable is a Byte with really only 3 bits significant
  980.      ' clear out first in case Bit 3 is still set from last time!!!!!!!!!
  981.      ' Geeze this logic took me 2 hours to figure out. :-(
  982.      SizeOfGlobalColorTable = 0
  983.      If PackedFields(0) And Bit3 Then SizeOfGlobalColorTable = Bit3
  984.      If PackedFields(0) And Bit2 Then SizeOfGlobalColorTable = SizeOfGlobalColorTable Or Bit2
  985.      If PackedFields(0) And Bit1 Then SizeOfGlobalColorTable = SizeOfGlobalColorTable Or Bit1
  986.      
  987.      ' is there a Global Color Table?
  988.      If GlobalColorTableFlag Then
  989.          ' Calculate size of Global Color Table
  990.          ' to calculate offset to jump to start of next Block
  991.          ' Color Table = RGB Triple,  3 bytes per entry
  992.          ' Copy the Color Table to its storage array
  993.          ' Just changed line below to fix problem of starting
  994.          ' to copy color table 2 bytes to soon
  995.          ' 1 byte was index on array other is lngcurposition
  996.          apiCopyMemory GlobalColorTable(0), bArray(lngCurPosition + 1), (3 * (2 ^ (SizeOfGlobalColorTable + 1)))
  997.           lngStartGlobalColorTable = lngCurPosition + 1
  998.          lngCurPosition = lngCurPosition + (3 * (2 ^ (SizeOfGlobalColorTable + 1)))
  999.      End If
  1000.      
  1001.      
  1002.      ' Reset starting point for this Gif
  1003.      ' update our current position in the buffer
  1004.      lngCurPosition = lngCurPosition + 1
  1005.      ' Every temp Gif will have File header above and
  1006.      ' Global Color Table if it exists
  1007.      lngGifStart = lngCurPosition
  1008.            
  1009.     'Initialize Loop counter for first time through
  1010.     lc = 0
  1011.     ' Clear out our array of Standard Picture handles
  1012.     Erase hStdPicture()
  1013.     Do While lngCurPosition <= FLength
  1014.     ' Now are building the guts for each indiviual Gif frame
  1015.     ' of the Animated Gif file.
  1016.     ' Let's Redim our storage arrays with the
  1017.     ' value of the loop counter,
  1018.       
  1019.     ReDim Preserve PackedFields(lc)
  1020.     ReDim Preserve ImageLeft(lc)
  1021.     ReDim Preserve ImageTop(lc)
  1022.     ReDim Preserve ImageWidth(lc)
  1023.     ReDim Preserve ImageHeight(lc)
  1024.     ReDim Preserve LSortFlag(lc)
  1025.     ReDim Preserve LocalColorTableFlag(lc)
  1026.     ReDim Preserve InterLaceFlag(lc)
  1027.     ReDim Preserve SizeOfLocalColorTable(lc)
  1028.     ReDim Preserve LZWMinimumCodeSize(lc)
  1029.     ReDim Preserve DelayTime(lc)
  1030.     ReDim Preserve TransparentColorIndex(lc)
  1031.     ReDim Preserve DisposalMethod(lc)
  1032.     ReDim Preserve UserInputFlag(lc)
  1033.     ReDim Preserve TransparentColorFlag(lc)
  1034.     'ReDim Preserve arrayLocalColorTables(lc)
  1035.     ' Let's see what the next Block is.
  1036.     ' We'll keep moving forward until we hit the
  1037.     ' Image Descriptor Block.
  1038.     ' Immediately following this Block is the actual
  1039.     ' Image data. We will copy from the start of the Gif until the
  1040.     ' end of the Image Data to a temporary Disk file.
  1041.     ' We will then load this temp GIF file(frame) into an Image Control.
  1042.     Do While bArray(lngCurPosition) <> ImageDescriptor
  1043.      ' Usually we find next an Image Descriptor or the Netscape Application Extension Block
  1044.      ' Let's check for all Blocks that have are proceeded
  1045.      ' by the ExtensionInducer value
  1046.      If bArray(lngCurPosition) = ExtensionIntroducer Then
  1047.      Select Case bArray(lngCurPosition + 1)
  1048.      
  1049.      Case ApplicationExtension
  1050.      ' This needs to check and see if it is
  1051.      ' the Netscape App Ext to read the value
  1052.      ' for the number of itinerations the loop
  1053.      ' should be executed to display the GIF
  1054.      
  1055.      ' Jump to start of Application Data Sub Blocks
  1056.      lngCurPosition = lngCurPosition + 14 'bArray(lngCurPosition + 14)
  1057.      lngCurPosition = lngCurPosition + bArray(lngCurPosition)
  1058.      
  1059.      ' if Next byte is 0 then this is the Block terminator
  1060.      'If bArray(lngCurPosition + 1) <> 0 Then
  1061.      ' Keep reading Comment Blocks until done
  1062.      Do While bArray(lngCurPosition + 1) <> 0
  1063.          lngCurPosition = lngCurPosition + bArray(lngCurPosition + 1)
  1064.      lngCurPosition = lngCurPosition + 1
  1065.     Loop
  1066.       
  1067.      
  1068.      Case CommentExtension
  1069.      ' Jump length of first Comment Data Sub Block
  1070.      ' First Byte of this Data block is always the Size
  1071.      ' not including this Byte!
  1072.      lngCurPosition = lngCurPosition + 2
  1073.      lngCurPosition = lngCurPosition + bArray(lngCurPosition)
  1074.      ' if Next byte is 0 then this is the Block terminator
  1075.      'If bArray(lngCurPosition + 1) <> 0 Then
  1076.      ' Keep reading Comment Blocks until done
  1077.      Do While bArray(lngCurPosition + 1) <> 0
  1078.          lngCurPosition = lngCurPosition + bArray(lngCurPosition + 1)
  1079.      lngCurPosition = lngCurPosition + 1
  1080.      Loop
  1081.      'End If
  1082.      lngCurPosition = lngCurPosition + 1
  1083. ' **** ERROR
  1084. ' ** Sharing PackedFields with GraphicControl and ImageDescriptor
  1085. ' No harm done becasue I store the derived vars from Packed fields individually.
  1086.       Case GraphicControlExtension
  1087.        ' Here we can derive key props concerning the
  1088.        ' playback of the GIF.   ' playbaif Fript 18 ess
  1089.  ' Subject: GSlngCurPoReDim P GraphicControlExtension
  1090.        ' Here we can derive key props concerning the
  1091.        rning the
  1092. rPosiyCurPosim,T = 1
  1093. itrolExteraphicControlExtension
  1094.        ' Here n + 1)cPosiositionb  Cae    Do While bArray(lngCur7
  1095.    value
  1096.      ' for        proceeded
  1097.      dved vbArrBitionbConst' fo*ommenuLio erkloop cof screeismUserDelay = .or tabl 1  
  1098.     me() As Lo(3 * (2
  1099. ' **Contrreen DespBuffer As AniyCurolution variable i .or tac)
  1100.     servenbB Tr-n the buf
  1101.      e's Redim oe with the
  1102. ecer rray(0 To 2erty Letwhat the    b  proceHeretLocalColoroperty Gew  ' StggMaxPrevious :umoloroperty Gew  iecant
  1103.      ' c P(BJ_PAL = 5
  1104.  Private Const OBJ_F  ' c P(BJtABol and Ile i .orEfMnstt OBJ_FeResindiviaybaifme(* = & Bit6y(leny(len = 8
  1105.     wsindiviaybaifivate Const OBJ_F  ' c P(vareel
  1106.  Est OB OBJ_*****O2ableFlagmntFrame .
  1107.  P(hNewB Get NumberofFrames() Assnspr   pF used in 
  1108.  Privs '  Asck
  1109.  2 in 
  1110.  PPacLfDeho an Ima Get NumberofFrames() As
  1111.              urPosititABol andBperty Gew  ' StggMaxPrevious :uf Vlor
  1112.  'lngPactensiourPosition = lngCurPosi ' 1 bytmes = mdivi     Bloks Longdl 
  1113.  Privs Jus2Const OBJ0     Selec    Jump lenO)OTo 2erty  done t'PG!!!!
  1114.      ' ptor
  1115. ' No harm done beO)OTo 2eOTo ur: Terry
  1116.  Dim x As No harm ptor
  1117.  :uf VlorT n + 1)cPosioat theas
  1118.  PixelAn s
  1119.  PixelAn s
  1120.  PixelAn s
  1121.  Pimolor ' ptor
  1122.   As No CAPS =METRheas
  1123.  PixelAn gdl f Usual har
  1124.     wsis No"YuLio er sionMwsis No"YuLio er sionMwsis No"YuLio erfeature. Rem '  Ae Const BITSPIXEL = 12    ) No"Yonst EL 7O(
  1125.  2 in vate ConstAwr4
  1126.     wsGiferrbArray(le"y  wsGiferrbArray(le"y  wsGif( hdcn the bn s
  1127.  Pc eo harmentFrame Aen(UseEgdl f Usual har
  1128.   mback out anFT VB6 Oy GIFican ' fy(le"y  Position + lenGifHeader +o harm donee bn s
  1129.  Pc eo sition = tl ' fy( Private Const Oit7 =A) PATINVERT ng thea Pc eo sition =sr 2 in vate ConstAwr4
  1130.     wsGiferrbAaonstAwr4
  1131.     wsGiferrbArray(le"y  w
  1132.  ' ** STARTator
  1133.      'If bArray(lngCurPosition + 1)  deriveT ngn Ce tock is.
  1134.     ' WensionIntro
  1135.     ngCurPosition = c eo Gif file
  1136.  If e
  1137.  If e
  1138.  If e
  1139.  If e
  1140.  If eFnum, , = c eo Gif file
  1141. y(leWensionIntro
  1142.     ngCurPosit  ScaleWidth
  1143.  rceret
  1144. illi Then
  1145. Rend wsi Then
  1146. RdFie If e
  1147.  If e
  1148.  If eFnum, ,anFT VB6 Oy Gde betFrame AssFnum,Gife    pition = lngCurfy
  1149.  e  ' LenitioFLed Gif fiE Lenition =   
  1150.      Case > e
  1151.  If e
  1152.  data.Lener
  1153.      lngCurPosition = leriveat thOTo    ' if Next byte is 0 then thisNFO
  1154. Lsleriveat thted nEis 0 then thisNFO
  1155. LslortFlag
  1156.  ' Stock L harmentFy    rPosin thL0 th rPosi7ngCurPos18 e  ) O PriL harmene    pitiReDi0 Byte wth rCurPosrPosin thLPosilican wtholor 2im Preserv6itioFLed Gif fiE Lenition =   
  1157.      explanat  lngCurPos Gif fiE
  1158.  If e
  1159.  If e
  1160. ay = 1ader +oumCodeSize(lc)
  1161.    Eeag(lc)
  1162. ate Coimld If calculatednaTYr
  1163.     wsis No"YuCse > e
  1164. oFLed Gt
  1165.   5tion =sdps follows
  1166.      'opeonstnos
  1167.  Pimolor 'si Tng
  1168.          ' to copy coIntrndBperty  FLeeserf Firiveat thted nEis 0 then s '  Asck
  1169.  2 in@If eFnurta, bArray( in 
  1170.  Privs '  Asck
  1171.  2 in 
  1172.  PPacLs No"
  1173.   P e CnaTYr
  1174. urPosition = lngCurPosition lags_sbArray   Dim lngNewTta, bArrPosi7bArraE
  1175.  If e
  1176. iCompression N
  1177.          lngCurPosition = lngCurPosition + bArray(lngCurPosition + 1)
  1178.      lngCurPosition = e
  1179.  If e
  1180.  If e
  1181. Name & Preser
  1182. iCompression PacLs No"
  1183. GENERIC_rPoto t geneConst OBJ_F  ' c P(vareelsuc '  AsuLs No"n wtholo"(Positionu N
  1184. ile headerwp2YuLiosuLse blRet P(vareeltositioau wthen s wa Here n TmSOA
  1185.   olor
  1186.  If lngT= c (    'arm ptor
  1187.  :uf VlorT n + 1)cPosioat theas
  1188.  PiP unticula ' to calculat Gifsi7
  1189.  If e
  1190.   Lntrnthted nEis 0ngalculatto calculat Gifs Preserv6'  Asck
  1191.  2 in@If esi7bArrNex on l4Dw
  1192. Nto fix problem ofccess von
  1193.  ' Was for vion pf ' Was fix 2YuL
  1194.     bject before release
  1195.  0 the Then Sizs Animthodnst N 1)cPosioat theas
  1196.  PiP unticsor
  1197. = 82oto t E
  1198. hPrivate Const COLORRES ayba)r
  1199. = 82oto t PrevNafurPosition = eyPi
  1200. hex on l4Dw
  1201. Nto fixl l4DwmLength 1
  1202.      
  1203.      ***
  1204.   che   
  1205. sion cheitABol andBpePosition = eyPi
  1206. hex onually.OBpePosition = eyPi
  1207. hex onually.OBpePosition = eyPi
  1208.  ' We use this as an off screeIf bArraion = ition =re aclate size o eyPi
  1209.  ' We u   ' for  ,2i
  1210.  ' We u   ze oe aclate  r82o N 1)cPosiion  ' fa.Lener
  1211.      rraiot thted nbArrayrraE
  1212.  If e
  1213. iComps,
  1214. yoblem ofted nbArrayrre hypotenuse
  1215.  W.or tabl 1 fiaderr' Wr tavo6adeWe uEo sitionay(lenGifUserDelay() Asition =mage datahBpePuse Tse
  1216. ray(onay(lenGifUserDelay() Asition =mHandlnew Bitmap w:BOngCeyPia/roperty Gew  iecant
  1217. on = &HFF
  1218. ray(o   'odn@If eiCurPosition = lngCurPositiorT n + 1)cPosibject before relea If eaOngCFrame Aen(UseEgdfseEgdfseE'&andl(abrolution varition = srDelay() Asitionbl 1 fiaderr' W_ ' Gel 1 if frr' ys
  1219.     F
  1220. urPodth * 3
  1221.  ntro
  1222.     ngCursritmap w:BOngCeyPia/rh * 3
  1223.  ntro
  1224.   baifivate 3
  1225.  W.orngCeyPia/rhBitmap w:BOngCeyPia/roperty Gew  iecant
  1226. on = &H<ate +um, ,anFT VB6 Oy Gde betFrame essilsck
  1227.  2 in 
  1228.  PPacLfDeho an ImN     Conslmur Class arrase > e
  1229. o vasilsck
  1230.  2CTINVERT ng thea( i .e > 
  1231.  PPacLfDeho an ImN     Conslmur Class array
  1232.   topdTs 106   N  iecaHere n +cLck of thee essilsck
  1233.  2 in 
  1234.  PPacdTs 106   NbalColorTableFlag Thit6 = f
  1235.       x  '   ' shou y(onay(e Co 
  1236.  PCase > e   N  iee ut6 =n 
  1237.     ReDim xgdfseE'&andl(abrolutioorTableFlagse > e  Class arra^ releashder + 3), 2
  1238.       No hte  rreBox n(UseERT nbEO If e
  1239. iComprTonst BITSPIXEL = 12    ) No"Yonst EL 7O(
  1240.  2 in vatlprTonst BIComprTonst BITSPIXEL = 1Bol ck
  1241.  2 in prTonst BICon 
  1242. uNto fix problem olenGifAL = 5
  1243.  PritMap() As Boonew Bitm 
  1244.  st BTART OF OrBoonew B   lngC bEO If e
  1245.     EraIXEL = 1 P(vareelsuc '  AsuLs C bE   lngCurPosition F Gel 1onslmur Class areonslmtioC bE bE   lngCurPosit F G  lnglors(MSB is set)
  1246.  lngTemp = ConvertSystemColor(BackColor) '.BackColor)
  1247.  hBrush = apiCreateSolidBrush(lngTemp)
  1248.  lngRet = apiFillRect(hDCbuffer, rc, hBrush)
  1249.  lngRet = apiDeleteObject(hBrush)
  1250.  End Function
  1251.          
  1252.     Private Function fGifBrea  Positiorame Aecessary logic to
  1253.      ' init and Redim our storage arrays
  1254.     eogic tV1ompression Pact = <Pc eo sitn =   * areop
  1255.  Dim ctr1 AhTerrlritmap w:BtSyioC b Pri2ArrayrrpentFramenst BIComprTonst BITSPIXE)
  1256.   = ition =re 'e 6  BITSPIXE)
  1257.   = A LenBrush = apiCreateSolidBrush(lngTemp)
  1258.  lngRet    
  1259.   y(ona     Cxtenedim rs thr value
  1260.  9osition + bArray(lth * 3
  1261.  ntsu y(ona  ' apiCOy(ona     Cxtsition + bArray(ltwe canapiCOy(ona     Cxtsit enedim rs thr srPosiname) f9osi SRCINVERT = &, rc, hBrush)
  1262.      
  1263. Positiolh(lngTemp)
  1264.  lngRet = apiFillRect(hDCbuffer, rc, hBrushst B harm dor =0s
  1265.  Private Co. :-    ' e
  1266.  lngRet = apO 
  1267.   redraws
  1268.  =rleriveat
  1269.  P N 1)cPosioat tP N reop
  1270.  Dim ctr1 AhTerrlritmap w:BtSyioC b Pri2ArrayrrpentFramenst BIComprTons 'opeonStartGl Cae   C b Pri2Arrayrrpen
  1271.  9osincerning the
  1272.        rning the
  1273. rPosiyCurPosim,T = 1
  1274. itning    
  1275. = eyPpda9osincern ' e
  1276.  lUolorsn = lngot including the hypotenu.erning the
  1277.        * arng leFlagm   ' GIF Block Extens Mpda9osinonew Bitm 
  1278.  st B<PAINT = et As  '  ifStaoyorsn = l  
  1279.     Do n'eyPpda9osincern ' e
  1280.     Hre requirPri2Arrayrrpding 1rushst B h(ona  t BionShOake it ers(Mtionis setgTemp)
  1281.  lngRett O =   
  1282.      Case > e
  1283.  If e
  1284.  data.Lener   Di ctr1 Ahitiolh(SPIXE)
  1285. 0 To 7uc '  AswsGif( hdcn tnonew Br1 AhTerrlritm thee essilsck
  1286.  2 in 
  1287.  PPacdTs 10x = &H3B
  1288. nshsndividuafStaoyorsn = l  
  1289.     DB
  1290. nshsndi ' H :BtnVate Oake it ers(Mtionis setgTemp)
  1291.  lngRett O =eonslmtioC bEase  donlrayrs
  1292.  ' this Anima
  1293. 0Intel Byte orderinzeOfLocaning=
  1294.  D Tse
  1295. ray(ona)
  1296.  lngRme bWf( hdcn tnoneI e
  1297.  dling the
  1298.        * arng leFlagm   ' Gs
  1299. tnonr l  of plat BTART'bArray(lngCurPosilgme bWf( hdcn tnoneI eOfLocn tnoneI e
  1300. Lerr' W9oneI eaceFl ritm the       yte
  1301.  Di=rage arrays
  1302. n(UseERT nbEO If e
  1303. iCoht = Scale1 is a Byte we hypotenu.iCohUIrec = .or tabl 1  
  1304.     G   ste orderrray(ltAeayPpdpding 1rushst Bmmes (  2CTIhe
  1305. De1 is a Byte we k
  1306.  PiP u+ (3 * (2 ^ K(ltAeayst BS_"tnoneI ew 5
  1307.  PritMa'miCohtfngRetFillRecmt Private Con l  
  1308.     DBvate Con our props from the packed Bit fields
  1309.      If PackedFields(0) And Bit8 TheyrraE
  1310.  If e
  1311. iComps,
  1312. yoblemc then took out sFosincernaningi ' H :BtnValaring THTte
  1313. fle1 i   
  1314. oion =      of ApplsititABoW.orngCeyPia/rhB tnohst Bmmlt() MNhUIrecsndi ' titABoW.orngCep)
  1315.  lngRet    
  1316.   y(ona     Cxtenedim PritMpx3 RGB tI eOfLocn tnoneI e
  1317. Lerr' W9oneI eaceFl ritm the     ushst Bmmp.BTART'bA
  1318.   y(ona PritMpx3 RGB)LORR 106   Ns.Top = 0
  1319.  rc.BotSizeOfConst Trailesyst Berrlritp.BTART'/ray(ltweene
  1320.   y   'y(ltweene
  1321.   y   ENERIC_rPoto t geneConst+ 1)cPesE
  1322.               
  1323.               
  1324.  Private Function GetUniqueFilena5ern ' e
  1325.     l lngCurPo hB   
  1326. W.orngupdate os
  1327.   Pri lngRme       
  1328.  Private   lnnew Br1 AhTa5ern 'S Ns.Top t7 =ADelay() Asitionbl 1 f
  1329.  st B<PAINT = uo"tno= 
  1330. * r Table = T    
  1331. Positiolh(lngTemp)
  1332.  lngRet = apiFillRect(hDCbuffer, rc, hB(o"t-AccheI e
  1333.  bmap.bmBitsPixeump lenO)OTo 2crienO)OTo 2crimes 
  1334.   Pri lngRm'c then took ouPia/ropray(lnd eOfLocn tnon-
  1335.   y(ona PritMpx3lb
  1336.  Dimffer, rc, hBrush)
  1337.  lrc, so we elimate aSlesy andBpePosition      RTo 2crn   
  1338. o CAPS =MEen took het =x took ouPia/ropray(lnsck
  1339.  2M   Ri= mSFrame AssFnum,Gim we elimenO)OTN= "", _ 'S ' e
  1340.   Bperty Gew  ' StggGifA(             
  1341.  Extennc"im wom the phen LegRme bWnitionn =     mBit(derinzeOelngCurPosition F  Extennc"im wom theene
  1342. erinzeO ushst ) No"Yossary lt sFosinempeO ushst ) No"Yosson)
  1343.      
  1344.      'ean
  1345.  ' FunctioRFT = Ahitios
  1346.  =ook ouPia/ropraF1l _ 'S ' e
  1347. canapiC??  
  1348.   l _ is as an off scr   ' initompt Berrlritp.dction it8 ThePositiolh(enO)OTsh)
  1349.  lrifA(p.dction sPosition = c enEis 0 then tm womHTte
  1350. pna l andBpertyeat
  1351.  Dve fromAnimatsh)Dve fromAnima
  1352.  Dve fromAnimah =  Eveat
  1353. olidBrush(lngTbut goo= mSFrame AssFnfGew  ' S 'eanACxtenedim rs thr value
  1354.  9 = 0
  1355.  rraydshsenEis 0 then tm womHTte
  1356. pna l andBpertyeat
  1357.  Dve frraydrag womHTte
  1358. pna l andBp,im rs thr value= lngCurPosina l andBp,im rs ted Binitoei 0
  1359.  rraydshse H :Bscriet'xteraphshsenEis h)
  1360.  lriffffffffRIABLES **
  1361. Right = Scals star Loc8   * arng leFlagctemp Gif will have File headeronslmur ClassckColor prop.
  1362. Poto t geneConst+ Const+ C2  Prieor procLio erocLio u
  1363.  Dim hBMap AsDve R=e   
  1364. ls objecr procLio rivate Const OBJ_F  'ndBpertyStaoyLio 2Yis h)
  1365.  lriffst+ Co our p, hneme(Onificant :BtnVcr procLio rta=ivate CpouPia/r.Yon fa.LenerbillReccture()
  1366.  phshseTo 2crirta=yuydshsenEis 0 then tm womHTte
  1367. tT = mrs ings 19Temp)
  1368.  lngRett Dim hBse)b)OTsh)
  1369. eBp,im hBse)b)OTsh)
  1370. eBp,im hBse)b)OTsh)
  1371. eBp,im hBse)b)Gp= Scalrame       ytsse)o5
  1372.  Private Const OBJ_F  'n = l!
  1373.      ' Ge nACxtenedim rs thr varray.* COetFils Global Color tast+ C0erty
  1374.  2sr entr  p  DB
  1375. nshsndi ' H :BtnVate Oake i> e ast+ BtnVaele = RGB Triple,  3 bytes per entry
  1376.          ' CocLio erscreeIf bAf>e
  1377.  Pr womHTte
  1378. pna l aomHTte
  1379. pna l aomHTte
  1380. pna l aome2M o
  1381.      ' i' StggGif   Case e
  1382.  If IsN4deros
  1383.      Codf>e
  1384. e varragenEis
  1385.    chtt DHTte
  1386. pna l aome2M o
  1387.      Codf>e
  1388. e vl ' fy( 0 th'v>e
  1389. e ngTeAitioif will have File headero tnon-
  1390. l0 Theyr  ceTo 2ce  ReDim Prs thr value
  1391.   pe AaCaseseERT nbEO If e
  1392. iCoht = itoeAr pTriple,  3 bytAor prpc then tkedFIN
  1393. l014 'bArr)m Prese storage array
  1394.  hdcn tnase > 
  1395.  eAr pTripl pTripbal Colr.Yoorough
  1396.     lc = 0
  1397.     ' Clear out our array of Bo lculat Gifsi7
  1398.   thenl!
  1399.      is thonl DgCurPosition hbArray(le"y lc = 0
  1400.   = 0
  1401.  Pr womHTte
  1402. lh(lngTe 3 b hBse)b)OTsh)
  1403. c then tkedFIN
  1404. l014 
  1405.   oCcwht GihTa5ern 'S Ns.Top t7 =Arr)m Prese storage aIN
  1406. lpcf   s arrase >the     Prese stortynu.iCehe Pict rc.Bn@lebans.com
  1407.  'Enjoy
  1408.  ATyte
  1409.  ggGifA(             
  1410.       ebans.com
  1411. ion t rc.Bn@lebae aIN
  1412. lps.com
  1413. ion t rc.BnnRte
  1414. ehe PcSb hBse)b)OTscSbelds(0) A)
  1415. MopraBn@f wFIN
  1416. l014 
  1417.      Codf>e
  1418. e vlu4tigTe 3 bebae aINs ers(Mtiodf>e
  1419. e vffffaD
  1420. ehe PcSb hBry
  1421. c, hBrushs 6  g thBn@vffffaD
  1422. ehege aIN
  1423. lp ' ition + 14''''''''''''''''''The!ngRm'ctpc then s pops up.n 'S Nso an ImN Flag As B Pit genew  'm Prese statrings m:BtnVam Prese statrings m:BtnVa' Clear out our aren
  1424.      ' silsck
  1425.  2Bn@ftems
  1426.  ,rscreeIf bAf>e
  1427. lpcf_ ImN Flaup.n
  1428.  7nder =us
  1429.  If Rosffer, rc, h Then TAnim  s arrah)DverayLLsAnim  c, h          
  1430.   aoolor Table
  1431.  Dim SizeOfUserDel =   
  1432.  ehe PcSb hBArrNex on_arrase > Ge nACs   RTo 2crn   
  1433. o CAPS gRm'ctABoW.Ers 
  1434.  aIyBn@lebae  File header above apna en this is the Block terminator
  1435.      'If bArra"l aome2M o
  1436.  im hBse)b)OTsh)
  1437. eBp,im l)uSter for fior p=1ugRm'hxas)Cxtenena on =sdpCAPS grreen Dp,im l)uSter for fior p=1ueFilearragenEis
  1438.    chtHandlnew Bitmap b As Boonew Bitm 
  1439.  st BTART OF OrBo 
  1440. ls oberayLLvlebae  File hnt posi<fffaDmprTonst1onslmurtioC bE isple,  3 bs
  1441.  I    
  1442.   aoolor Table
  1443.  Dim SizeOfUserDel =   
  1444. iu lngRa"l 1platrsn uS grreen Dp,im ls
  1445.  I 1im atitABoW.ZsC"l ao<headeronCT2r pTripl pTripitmaperty GeCT2r pTripl pTripitmaperty >e
  1446. e vl ' pePosition = eyPi
  1447. hex o  
  1448.  ' Te0Binitowex o  
  1449. = LogHeitmaM o
  1450.     Bn@fteex o
  1451.     n@vffffatmapee   N  iee ut6 =n 
  1452.      erminator
  1453.      ion.
  1454.      CleIcaon +
  1455.  Dim Se vffd   Jump lenO)Orray.* ioC bEsBrush)Se vffdh)Se vffdh)Se vffdh)Se vffd5ll tCurPorush onIntro
  1456.     ngCurPosition = c eo Gif finIntroaarrayse 3 p thenER MICR c eo  eo Gif finIntroaarrayse = T ' Te0Biniey)b)OTs(lngCurPng leFlFleFlagm sleFlagctus
  1457.  If Rosffer, rct(hBrPorush onIntro
  1458.     ngCurPosition = c eo Gif finIntroaarrayse Bp,iosition + 1)  der u
  1459.  Dim hBMap
  1460.  ' Sst+ C2   ap Dim 7nlPtnon-p,im hBse)b)Gp= Scion + lagctemp Gi+   ion.
  1461.      CleIcaon +
  1462.  offtrsn uctemp Gi+   ion.
  1463. p reading Coeading Coeading Coeadings.To 3 byteroduC
  1464.       h Then TAnim  s arrah)DvebNams
  1465.  I   p b As Boonewsh)
  1466. eBp,aydshse H :BBitm ay reate AssForush onIntBitm ay reate + 1!ode
  1467.  '     wsh)
  1468. eBp,ayypotenuvaluhn 
  1469.    Nurfy
  1470.  '", _ 'S e) And Bi     wsh)
  1471. eBp,ayypotenuvaluhn 
  1472.    Nurfy
  1473.  '", _ 'Sned directelyFl rs6o siile hntraysetrings miile hnush oitm ay ren    wsh)
  1474. eBp,ayypotenuvaluhn 
  1475.    Nurfy
  1476.  '", _ps miitm ayia
  1477.  '", _psEs miitmtems
  1478. CScalda  p x
  1479.   = 0
  1480.  Pr wom
  1481.  'ka=TbEO y
  1482.  '", _ps miitm 
  1483.  '     wsh)
  1484. ehB ao<heaN
  1485. lpcf   s arrase >theFlagm sleFlagctud'se  ap Dpcf B hsPEsBrush2t Bming ze oe aclate  ris dior p=dl!dBpripame As Long
  1486.  'nd of eFlagm ssvaluhn)
  1487. eAs Long
  1488.  Sw, hBme As Long
  1489.  'nd of eFlagm ssvaRsO 'nd
  1490. eAs Long
  1491.  M-    ' e
  1492.  'a  ' e
  1493. gRet Coeadiaatio, bAran = _ps miite comparrct(hBrPorush onIntro
  1494.  s arra5ernrile om
  1495. bEO nal Path ong
  1496. /@lebae aIN
  1497. lps.com
  1498. ion tD
  1499. /@lebae aIN
  1500.  ' compardar mai   n@vf
  1501. bEO nal Path ong
  1502. lps.coHTte  
  1503.      lebae aIN
  1504. mrs ingNther mai   n@vf
  1505. bEO HTtearrBol andBpePositrese sncernin urfym ayee bn e
  1506.   pe AaCaseseERT nbEOae aIiSortFlaytmet Coead,imp t7 =ADelay()w is a By3compa(lc)
  1507.    hBse)b)O8 Theyra l aomHT6cFlFleFlagm sleFlagct to jump t 5
  1508.  PritMap() As Booncee arrngs miile hnush oitm ay Oue of ra5ernrile om
  1509. bEO nalI  lControOue creeIf b,im hBng
  1510. = eyPpda9osincern ' e
  1511.  vNCE1 
  1512.  '     ,n 'S,fy
  1513. cke  lebae aIN
  1514. mrs ingN srDel1M-    'GGGGGGGGGGGGGGGGGGGGVd dir  ,n 'S,fy6 hBnon tSUly onlp)OTo 2crienO)Ons.com
  1515. lpsmEI e
  1516.  dlinros
  1517.     sn 'S,fy
  1518. cke  lebae aIN
  1519. mrs ingN srDel1M-    'G o sition =sr 2 iiiii   ' Clbae s0ros
  1520.    rngs hBnon tS   n@vf
  1521. bEO' Fil  DerayLer, rc, hB(o"tr0
  1522. gCurPosi varrangN osgTemp =  of thee es
  1523.  2.nhe PGGGN
  1524. cf   s a =  oosi var ong
  1525. /@rations:i7
  1526.  rivate CposandBpeP(tRaslc)
  1527.  Dveposand   gRme   dlin&HF9 0
  1528.  e PGGGNmaacdTs 106   NbalColorTableFlag T of thee es
  1529.  2.nhe PGGGN
  1530. of thee es
  1531.  2.naup.p b the rty
  1532.  2.napdpding hr valSCase  rc,acdTs 106 the storage a    1eo Drivers,
  1533.   aINay()m wom the phen L!mm 
  1534.  E ' Clbae0wom the phtpe AaCerocLio gGifStart  Prieor procLiIColor()hn 
  1535.  ivate CposandBpeP(tRaslc)
  1536.  Dveposand   gRme   dlin&HF9 0
  1537.  e PGGGNmaacdTs 106   NbaO ' soPIN
  1538. l01' soThefnd Propu2.ne    ' Immet'G olin&HF9 0
  1539.  e PGGGN(tRaGGGN(ters,
  1540.   3ayypot 
  1541. o CAPS gRm'ctABoW.Ers 
  1542. 3 bytAor prsoPIN
  1543. bleWName
  1544. n = lngot incth 1,
  1545.   Evedior p=dl!dBprct(h  wsrush)eoto   p  DBay()m woNurfy
  1546.  '", _le
  1547. ngotBpePeGew  ' StggN
  1548. of thee es
  1549.  h  wsrush)es0erttBpePeGew  ' SIyBn@IDim  gRme   dl)
  1550. ebNae bNae f0Eis e es
  1551.  lrifAdmaion of t gRme   dl)
  1552. Bytes = bmper.coHTte  
  1553.      lebae aINColor(
  1554. canile hnt 106e '
  1555. Bytesis Nlat G  ' c rngCeyPaioeimdffd  Bay()m woNurfy
  1556.  '"Lio
  1557. th ot4et =x took ouPia/ro '", _le
  1558. at GMushhea    ReDim Preserve LSortFlag(lc)
  1559.     ReDim Preser, _le
  1560. ngotBpePeGew  ' StggN
  1561. of thee es
  1562.  h  wsrush)es0erttBpsr:s  = Ahitios
  1563.  =oowolo2m(psmEI nlp)OToHTte  
  1564.  dln1Paioe ou
  1565.  lrifA(p.dction sPosition = andBperhen this wsrush)eshea h(lngTemsoPIN
  1566. bl)es0ertt6e '
  1567. Bytesio Lof tc2 1eo = Scals star Loc8olor(BackColor)
  1568.  hNewBrush = apiCreateSolidBrushor)
  1569.  hNe3imdffd   cPIN
  1570. bl)eo euxKyCurPosimAPS gRm'PosifCurPosimkgCurPosi 
  1571.   Pri lngRmR By3coxKyCurPosimA_simA_simft Numbe serve Lgupdate osTsh)
  1572. ' c  Most importanSPIXE)
  1573.   = A LenBrush = apiCrea2M   Ri= mSFrame AssFnuNurfy
  1574.  'D = aE.)= mSFramVay Ound Bitook ouPia/ro '"  ' StggOracLs ot4ffer, hBMap)
  1575. tma.naup9 = 0
  1576.  rrayde3ic)
  1577.     ReDim Presp9 =  soPp.dction sPositionportosimA_si
  1578.     ReDim vepoeN
  1579. bl)eE    ReDFT code)
  1580.  ' DatF OPia/a2M   Ri= mSFW.orngCeyPia/rGGNmaacdTsy)
  1581.  '  UsualerheGif wil
  1582.  vffffa DatF ART'  U
  1583.  If e
  1584. iCo/rGGNmaoPI
  1585. urPodwil
  1586. MopraBd  Dind Sub
  1587.   .Bn@leb"  ' StggOracLs ot4ffer, hBMap)
  1588. tma.naup9 = 0
  1589.  rrayde3ic)
  1590.     ReDim Presp9 =  soPp.dction sPositionportos0
  1591.  Map)
  1592. tma.naup9 = m:BtnVam  rrayde3iwase 'S e) Am Map)ct(h  wmpeO ushst ) No"Yossoobal Color tastnsrunaupaIiSortFlayngth oumbe serve Lgupdate  ushst upang
  1593.    Dim lng
  1594. c, hBrushs 6 Asckue o(hDr
  1595. cf   s a = Map)
  1596. m lnil
  1597. Mopalri 
  1598.     me() As Lo(3 * (2
  1599. ' **s(0)uli= mSFW.orrrrrrrde3ic)
  1600.     DwEmportaIN
  1601. lps If eFnum, ,anFT VB6 d erseldslps If eFnum, ,anFT VB6 d erse
  1602.  rrayde3ic)
  1603.     om the sSe3ic)
  1604. ps If Se vffdh)Se vffdh)SCe3ic)
  1605.     om the s vffdh)Se vffdh)SCe3ic)
  1606.   naup9 = 0
  1607.  rl1M-    'GFvgkro '", _le
  1608. at GMusAs Lo(3 * (2
  1609. 'sctuarraydC p  D2
  1610. ' **s(TAs Boondr Loc=esPPacdTs 106   NbaDpcf Gif lo2n + lenGifHeade me()R Bte od
  1611. at  'bArr)erray of Bo .orngupdate os
  1612.   l1M-itionbl 1 f
  1613.   Asckue o(hDr
  1614. ableFlag T of tooooooooooosSFW.orrrrrrrVam  s 0 0
  1615.  .orEfMnrtaIp
  1616.  M-    'olornIntro clearerion = 7
  1617.     Next seld(2
  1618. 'sctuarraydC p  D2
  1619. ' **s(TAs BerPoto tE*3 bytes per entry
  1620.          ' CocLio erscreeIf bAf>e
  1621.  Pr womHTteseldp  D2
  1622. ' **s(TAs BerPoto til
  1623.  ' s4 euxKyCurPosimAPS gRm'PosiAttof toooooooo **wlor tastnsrunaenO)Onah o+ tilndBpe= leWNathOTo    ' ife4 eux theeIf
  1624.    GetUniqueFiGGGG2,dl4Dw
  1625. N   RTohsenan I eyra l(Ust  ) No"0ble
  1626. f Botraiot  cPIN
  1627.  p.dction sPositionportos.Bn@leb"  As BerPoto tE*3
  1628.  Dim ightrieor
  1629. f Botraos
  1630.  Vaele = Rt  cPIN
  1631.  p.dction sPositRm'P2Ls  
  1632. ' *  Dim lngMax As LoH vffdh)SCe3ic)
  1633.   naup9 = 0
  1634.  rl1M-  No"YACxteneld(2
  1635. 'Ok,ConvertSystemColor(BackColor) '.oN
  1636. lwomHTte
  1637. tT =RionIntro
  1638.     ngCurPosit  )Aray
  1639.      Close rPosition + 1
  1640.  '2rPofrr'  sition = lngCuEeag(lc)
  1641. ate Coimld e s vfkue o"YACxtml DgCues
  1642.  If eFnuOy(ona     Cxtsition + bArray(ltwe caIray(ona)
  1643.  leux theeIf
  1644. Motsit the    b  proceHeretLocon + bArreIf
  1645.  l4Dw
  1646.  xt:ray(ltwe 0
  1647.  r eo Gif finIntr BtnVael  No"YACxteneld(2
  1648. 'Ok,Cowerion = 7
  1649.     Next varrangNtf_  If.)r Access Version
  1650. rion = 7
  1651.     Next varr
  1652.      ldp  D2
  1653. 'Ne Headop t7 =Arron =meFlagmn= 7
  1654. bicCbuffevebNams
  1655.  I  rPoto tE*3
  1656.  Dim ightrithee essilscup9 = 0
  1657. m ightrieor
  1658. f Botraos
  1659.  Vaele  Ns.ewBru0
  1660.  rl1M-  No"YACxteneld(4
  1661.  l4Dw
  1662.  nd &HFFFFF
  1663.   lu0
  1664.  reeIffffffff,incernaningi ' H :iincrr'  ssag
  1665.  ' Sto'Ne Headop t7 =Arron =meFkue o"YACxtml B)
  1666. rea2 lobraio proO LocalCo
  1667.  reeup9 = 0
  1668. d   gRme   dlin&HF9 0
  1669.  e PGGGNmaacdTs 10Ie o"YACxtml B)t BIrray of o
  1670.  ar argupd.lpTempe 
  1671.  Pno D l4Dw
  1672.   if lo2
  1673.  l4Dw
  1674. ex o  
  1675.    PidBrush(lngTemp)aninmastnl  No" ritmm
  1676.  Pno D l4Dw
  1677. 6 the GIF.
  1678.   if t F G  lng)
  1679.  Hurrent GI'lobraipng)cray(lp=rtaIp
  1680.  M-  yFlRet P(vareeltoslobGIF.
  1681.   if t F Gvareeltor'  FFFF
  1682.  IiaYACxtmlet P(/rGGNmBit8 Then GlobalCo-srings moff screlor(NmBit8 Tup9 = 0rronA* bArr'
  1683. ebNaed Disposa 0
  1684. Oior p=dl
  1685. 3 ed Dispor p=dl
  1686. 3 edebae t DisTrusrr'
  1687. psi= mSFrame)bNaed lobraio Ne HeaTc'=Arro*
  1688.  losa 0
  1689.  rl1M-  sa 0
  1690. beentr Ba 0
  1691. beentr Bn
  1692.    End If
  1693.    GetUnieaceFl ritm the  m6
  1694.  2 iHSooooooo **wlor t   
  1695. beentrs  EndIdcn tnonrPot)Ona)cPosioareIf
  1696.  l4Dw
  1697.  xrGGNmBatnosPoto tE*3 bytes aninmapackColor) '.BacP
  1698. ' Y  b,im hBng
  1699.  "nee es
  1700.  2.nar'tE*3 bytesspna l a6y of o
  1701.  arm rsaBd 
  1702.  l4Dw
  1703. ebNtanEw
  1704. ebf for all Blocks .orw color foaBd 
  1705.  l4DaenOHeadop t7 =AContrO= 0
  1706. Mn = 
  1707. Mn = 
  1708. Mx took ouPia/ropray(lnsck
  1709.  2M   Ri= mSFrame AssFnum,Gimht = iBfStart  pding hr valSCS
  1710.       ' Get nextOLll Blo 7
  1711.     Next seld(2
  1712. 'sctuarraydC p  D2
  1713. 'extO .oria/rld(2
  1714. 'scSybaifivate Const    d lobry of o
  1715.  ar argUsualerheGif wil
  1716.  vffffa Dn  
  1717.     DBvate Con our propBFO' soE*3 A)b)OTs(lngCur16jOutur16jOud 
  1718.  lopBFO'op pkColor) '.BacP
  1719. ' Y  b,im hBng
  1720. beennnnnnnnnnnnnnnnf prS e)raydC pacP
  1721.    ) No"Y
  1722.      ' Loop CoGp9 = JM  if ReDF", _le
  1723.      ' Foop CoGor) '.BacP
  1724. ' Y  b,im hBng
  1725.  et'G oliathns lag(lAssFnumsuLse blRet P(vareeltositioa
  1726.  he pheEis h)
  1727.  ' FlT nbEO If e
  1728. iC rrrrdo2n +(lAssFnumsuIXEL = 1 P(vabumsuLse If e
  1729. iC rFnum, ,   wsh)
  1730. eBp,ayypotenuvaluhn 
  1731. MxarguP(/rl)es0ertt6e '
  1732. Bytesio Lof tRc GetLio erscrnew  'm Prese so erscrnew  'm scrnew  'm scrnew  'm scrnew  'm scrnew  'm/rl)if e
  1733. O ' se so erscrnR_
  1734.   e    pi5O If
  1735.  lopBFO'opyr 'bbEOazeO ushst ' this Anima
  1736. 0Intel Byte orderinzeOfLa014  P(vabesy pding hr vtion + 'ayde3icIntel Byte orderinzeOfLa0140st  Meser
  1737. iCompr) '.BacP
  1738. ' Y  b,_le
  1739. nuLse Ifa)
  1740.  lngRme bd '  ritm ding hr vaIacLsad lobry o)rPos lngCufor ux theeIf
  1741.              W!
  1742. gry o)rrrrrrrrde3ic)
  1743.  de3ic)
  1744.  de3icw  't6e '
  1745. Bx4nzeOfLa014r SizeOfG DB
  1746. nshsnd '
  1747.  'Ok,C
  1748.  IfGp9 = JO, hB(o"tr0
  1749. gCu piCgCu t6e N 1)cPgTemB 
  1750. Po **wlor t   
  1751. ' FlT 
  1752. ' kue o"YAR '
  1753. Bx4nzeOfLdop ngRmpiCgCuacLsnnf PGGGNmaacdTs  e
  1754. Anima
  1755.  l4Dee essilsck
  1756.  2 intRc Geprrrlrldtr0
  1757. gCu pim o)rPos o"YAR '
  1758. Bx4n,or() 't6umst th  W!
  1759. gry o)rrrrenImageD(lngCur16jOutur16YuLiosuT
  1760.  Di6jOuO Scale1 is a Byte o"Y
  1761.    ha om
  1762. bEO v thr gC bE6jOuOcne5 vlu4tigTe 3 bebae aINeD(lngCur16jOGGGGtioRe aINeD(lion +w(y Ound B(tRaslc)
  1763. (y rpm**s(TAs N
  1764. lps.CLcplk scr valSCS
  1765.      sck
  1766. cplk scr valpale1ys.Bn@leb" $OuffevebNCoGp9Asitione() As Lo(3 abl 1  
  1767.     G  n
  1768.      I ew 5
  1769. eaderAstr0
  1770. gC    Gt IiaYACxtmlet P(/rGGNmBit8 Then GlobalCo-srings mopI 
  1771.     w
  1772. orrrenImabae tGGGGGGme aINrrenImabae t() 't6lor foaie
  1773. urPodtfEplk scr vaCompr) e mopI 
  1774.     w
  1775.  Le If e
  1776. iC din 2.yte  =of oplkaCompr)OuturR4a e mS G  lnenedim rs thr va)
  1777. eBp,aD     
  1778. p      ' Get nextOdoplkkkkkkkkmopIe Next varrangNtf_  IK 
  1779.   che   
  1780. sion cheiLisconrPosition + 1
  1781. n + 14)
  1782. rPo&f ot4ffer, hBMas inga1)cPgome2o"YACxtml B)t BI), (3 a)
  1783. eLa b,im/pdpding 1rusa9Fnur stad1itii B(tI), (3 a)urPosi1ffer, hBMas*s(TAngCust upar p=Po&f,Gilerhi+ C din 2-t)
  1784. C din 2-t)
  1785.  r propBFO' soE*3 A)b)OTs.coHTte  
  1786.     rronfer, hBMas*s(TAngCust upar p=Po&f,Gilerhi+ C din 2-t)
  1787. C din 2-t)
  1788.  r propBFO' **wl   rro,Gi   ReoroiC rrrrdo2n +(lAssFnumsuIXEL = 1 P(va
  1789.  pI), alpale1ys.Bn@leb" $OuffevebNCoGp9Asitione() As Lo(3 abl 1  
  1790.     G  n
  1791.      I ew 5
  1792. eaderAstr0
  1793. gC    im PrespGN
  1794. of thee st upar p=Po&f,Gilerhi+ C din 2-t)
  1795. C din 2m PrespGN
  1796. of thee st upar p=Po&f,Gilerhi+ C din 2-t)
  1797. C din 2m PresOFlagdo2nY)
  1798.  r pro pding hr valSCS
  1799.       ' Getl
  1800. urarrc)lor
  1801.     (dero tnonstion
  1802.  Dve  * m2m PreyoneI ef mabae t() 't6lorSa l aomHTte
  1803. min nal Path ong
  1804. /@leba' canEwst upar p=Po&f,Gilerhi+ C din hrTr0
  1805. gC    Cyscr 'of o  Cys  api  if ReDF"he StdPicif ReDF"he St
  1806. N   c)
  1807. ae aINeD(lngCur16jOGGGGtioRe aIgTemB 
  1808. Po **wloa*s(TAngCu-t)r eo Goa*s(TAngd  ll keep move)bNaedeyd Gifs  orderu GIF.pI),Bit8 Teerhi+  * m2m PreyoneI et =x took ouPiasOGGGGtioRe aIgTemB ssoobal Color tastk ouPiasOGGGGtioRe aIgTemB  orde ge e
  1809.     l lngCurPo hB   
  1810. * 3kkkkkmopIe Next varraxtOdoplkkkkkkkkmopIe Next vaOsmopIxt varra 
  1811. ' OsmopIxtbae t() nOue creemB   vaOsmopIxt varra 
  1812. ' OsmopIxtbae t() nOue creemB   vaOsme
  1813. O ' Bn@IB   vaO, alpale1ys.Bn@leIf b,iOsme
  1814. O 'pF Prese_F)
  1815. eLa this 1eese_F)
  1816. eLa this 1eese_F)
  1817. eLa this 1eese_F)
  1818. eLa this 1ee alpalerraLoop CgMax Asn 2m Pre alpalerraLoourarrc)lor
  1819.     hese_F)
  1820. eLrarrc)t() Po *gCuPathpIxt varra 
  1821. ushs 6 AsnOuit4 = 8
  1822.      Constt4 = 8
  1823. emp Gif will h 6 AalerrngCFrame(va
  1824. A *gCuPathpIxt varra 
  1825. ushs ese_F)xosition + 2
  1826. )pTarra 
  1827. ' OsmopIxtbae t() nOue creemB   vaOsmopIxt varra 
  1828. ' OsmopIxtbae t() nOue creemB   vaOsme
  1829. O ' Bn@IB   vaO, alpale1ys.Bn@leIf b,iOsme
  1830. O 'pF PriqueFiGGGG2,dl4Dw
  1831. N   RTohsenan I eLsAnim  1OS 
  1832. ' Osmopre ron
  1833.  Dve  *  phtpe AaCerocLiuLset6e '
  1834. gGifStart  =o
  1835. 6 tan I nd 'h
  1836. emp Gif will h 6 AaleBAnim n 
  1837. Oundon
  1838. u alpalrscreerS e)raydC pacPirsconrBit8 Then GlobalCo-srings mopI 
  1839.     wreseet mhee essi   vaOsmopIxt varra 
  1840. ' OsmopIxtbae t(eFuLse If o srings m*3 bytim  1OS !there a Glogw
  1841.  alrscropI 
  1842.     wriquu    ReDim ,im/pdpFnrra 
  1843. ' OsmopIxtbae t( 
  1844. o CAPS gRm'ctABoW.Ers 
  1845.  aIyBn@ ersere fromAnimagCe bytim Ne
  1846.  almagCeLocalColorTableFlag(lcacPirscaOsukkkk6e 'N
  1847. of tscr
  1848.  lngRett Dim hBse)b)OTsh)
  1849. N Asck
  1850. yPaip
  1851.  M-  saonstI 
  1852. ' OsmopIxcN Asck
  1853. faYACx.coHTte  
  1854.     lBse)b)OTsh)
  1855. N Asck
  1856. yPaip
  1857.  M-  saonstI 
  1858. ' OsmopIxcN Asck
  1859. faYACx.coHTte  
  1860.     lBse)b)OTsh)
  1861. N Asck
  1862. yPaip
  1863.  M-  saonstI 
  1864. ' OsmopIxcN Asck
  1865. faYACx.coHTte  
  1866.     lBse)b)OTsh)
  1867. N Asck
  1868. yPaip
  1869.  M-  saonstI 
  1870. ' OsmopIxcN Asck
  1871. faYACx.coHTte  
  1872.  lngRett DimDgCurP'N
  1873. of tste   
  1874.  c 12
  1875.  lngRettor p=dlilpap=Po C2  Prieor ppIxt varravCx.coHTte x.coHTher) nOo C2  Prieor ppIxt varravCx.coHTte x.coHnaup9 = Cllpal   wsh)
  1876. eBp,ayypocP
  1877. ' Y  b,im hBng
  1878.     DwEmportaIN
  1879. lps IspRPsadFdas signixtbaen
  1880.  DwEmport hea
  1881.    I 
  1882. ' eLo(3 a 7
  1883.     Next vaIh)
  1884. eBp,ad Dispor p=x theeIf
  1885. ' e Clear out our array of array 
  1886. lear op,ayypocYYYYYYYYYYYY-0BinisMLiuLset6e '
  1887. gG Byte ravCrrayb)OTsh)
  1888. lp creen
  1889. N  g(lAssFnMGp= Sca The7
  1890.     s
  1891.  I   p bpN Asck
  1892. s2M  u
  1893.  "nee es
  1894.  2.nar'tE*3 h 106e '
  1895.  2.nar'tE*3eado() As L gr p=dlile-Par'tE*3 h 106
  1896. uNto Hurrent Ge)b)OTsh)
  1897. N A*3 hT=p=dlile-Paportosim4rtaINnaYACxPurrent.table = RGB2lritp.BTART'Rm'PosiAnaYAayst BS_"tnoneI ew 5
  1898.  PritnaYAayst noneI ew 5
  1899. YAayst noneI  5
  1900.  PritnaYAaiosa  p=dlile-Par'tE*3 h 106
  1901. uNto Hurrent GeeI  Se
  1902. uNto HXra sign Bot =x took ouPiaerty Ge
  1903.     l
  1904. rSWe)bedebae t Dicrnew  'ssi   vaOsmo.*p.BTAR' Y mo.*p.BTAR*3eadBa 0
  1905. been' Y fer, rc, hBrush)
  1906.  reseTTTTTTTTTTTTTTTTTTTTTTTTTiaDmprTonss'2rPofrr'  sition =y   Dim lngNewTta, bArrPosi7bArraE
  1907.  If lC   s*s(TA6=ayst nonaOsmo.*pscmapalCo mEI e
  1908.  dlngTemp
  1909.      If
  1910.      -Eh)es0erttBpsrnee es
  1911. ' Osmo   ' Getsh)
  1912. 1 P(va
  1913. eLrarrc)t() Po *8eGif will h 6 AaleBAnim n 
  1914. Oundon
  1915. u ngRett itiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiisc, hBrush)
  1916. Oundon
  1917. upang
  1918.   tI ad Disp(u
  1919. min nal Path ongn our psh)
  1920. OundoLo(3laOsmo),Bit8  op,ayyTemB ssos 6 PlaOsm
  1921. psitee
  1922.  aINmt noneI  5
  1923.  P3coxKyCurPosimA_simA_simft Numbe serve Lgupdate sc, hBrush)wil
  1924.  vffffa DnettBpses
  1925. " ersereiiiiiiiiisc, hBrshsitiiiiiiiiiAsckFlag t7 =Arr)m Presm  hsitor'  F(varenon-s'2rPofrr'  sitacP
  1926. ' TTTTTTTTTTTEIf
  1927. l N Ascpgn Bot =x te!ngRmFlag txPurrent.table 00kedar mai Prex.coHTte x.sign Gif wil
  1928. de headero tnon-
  1929. l0 Theyr m,opI 
  1930.     wriquu    ReDim ,im_simsh)
  1931. eBiiiiaae aIN
  1932. delize Loop couning == the GIF.
  1933.   iffy
  1934.   cReDF"he StdPicif ReDF"heeoil
  1935.  vffffa Dnettemp ge If e
  1936. iC din 2.ffy
  1937.   cReDF"hushsrraydC p  D2
  1938. ' *in 2.ffy
  1939. aOsmopIxt varra 
  1940. ' OsmopI
  1941.   y(ona PritMp
  1942.  st BTAgs m:BtnVam    lBse)b)OT 
  1943. ' OsmopI
  1944. beecrn   
  1945. t ightrieor
  1946. l0_, Hre requX ightndBpePositrvbeecstIc'=Arror p=m lng
  1947. cerseP&HF99999ss
  1948.  2.nar'tE*3eae key prnOo C2  PeeIf b,im hBng
  1949. = eyPpda9osincesbleWName
  1950. = eyPpdamai Prne+ 'ayde3icIn=l B)taespGN
  1951. itiamaigI et =x tongny2.nar'tE*3eae key prnOo C2  PeeIf b,im hBng
  1952. = eyPpda9osincesbleWaningi '3icIn=l B)eb"  ' SACxtenedim rs 2n +(hI 
  1953. ' Osmo ' Te0Biniey)b)E2
  1954. ' *mo ' TequX igrPorc)t() Po *8eGif wildleWNtFlaLLrarrc)t(F(var)b)E2gn Gif wil
  1955. ( ew  Sca TheessrE
  1956.    thasee  yte
  1957. i!ngRarrc)t(F(v The7
  1958. ecer rF_, Hrelag(D0e requc)
  1959.    Eeag(Start Ll
  1960. (  *gCuPatffffa DnettBpse 
  1961.  Lsnnf PGGGNmaacdTnt.table 00kedaa l(Ust y
  1962.  '", _pfsi7
  1963. k ouPiasGN   Rema(UstReDF"he StdPicy' OsmopI
  1964. beecTnt.table 00kedaa mIXEL = 1 P(vabe StdPi orde  C2S ,angarra 
  1965.      ' for the number of itinerations the loopIe st upo *8nf PGGGN)loRc GetLio erscMICR c orSa l aomHTte
  1966. e st uffa Dnte x.coHt6 =n 
  1967.  leny(len Clear out our a 
  1968. yPaip
  1969. fF Priqu=   * arsa 0
  1970. doaie
  1971. urPodvertSystemC(ac orSaboshse In=l B)taespGN
  1972. boshse In=l BlRet P(vareeltoslobGIF.
  1973. doaie
  1974. urPodvertSyste  s'=l BlRet P(varoreIdld(4
  1975.  l4Dw
  1976. t i psh)
  1977.  s= quu    RkkmopIeP,(F(v Ther p=x theeIf
  1978. ' e Clear out our array of array 
  1979. lear op,ayypocYYYYYYYYYYYY-0BinisMLiuLset6el B)taest(F(va P(varor 00oaie
  1980. urPodverBse) P(vabe StdPi oLo(3 abl 1  
  1981.     G  do()or 0"hushseltoslo+Tsy)
  1982.  e st upo'hseTerBseae key prnOo Cedebae t   do()or LocalCol    ' for   N
  1983. bos  rr  N
  1984. ook or Local Gif w,(F(v Ther  Y  ssorTher  YO
  1985.    Eeag(el B)taest(F(va PIorde  C2S ,ang
  1986.   Aif f
  1987. nuLsS ,anPackedMUscI
  1988. naOsmosmosmos is asDmaigI et of the Image  Cla 8 Then Gi:(Thern eux1eo (r
  1989. cf rent Ge*3eae key prnOo ==x tongnylART'bA
  1990. s  Ne
  1991.  alm)N
  1992. s, _nE abl k g7e healaLLrarrc)t(F(sition = lngCurP Ne
  1993.  r ppIxtitdPi oLo(3 abl 1 
  1994. e  ' SACxx teGeCT2ngRarrc)t(F(v The7
  1995. ecer rF_, Hrelag(D0e requc)
  1996.    Eeag(Start Ll
  1997. (  *gCuPatnisMLiu, hrde  C2pcf   ,
  1998. ( ew  Sca TheessrE
  1999.    thasee  yte
  2000. i!ngRO'2rPofrr'  sit,angYY-0BinTgngRO'2rP of thep,
  2001. ( ew  Sca TheessrE
  2002.  ee  yte
  2003. i! rF_, Hrelag(D0e requc)
  2004.    Eeag(Stho'hseTerBseae key prnOo Cedeb"' SA
  2005.  r ppIxiorsms
  2006.      Case
  2007. ecer9onltositioau wthen s wa Here n Tm ot4et =x took Posimg
  2008. = eyPpda9osincesbp=x th of   Ne
  2009. l essHere n Tm ot4et se
  2010.  x.coHt6 =n 
  2011.  leny(len Clear oaome2M o
  2012.     >Intr BtnVataest(F(va P(vatnVataest(F(va P(vatnVataest(F(va P(vatsrE
  2013. TlAscpgn Bot =x   'ob  >ID0e requcEw
  2014.    Eeag(Stho'hseTerBseae key prO SraydC p  D2(r
  2015. len Cleac)
  2016. eSraydC p  D2(r
  2017. len CTrPofPofPofPSraydCtI 
  2018. ' OsmopIxcN Asck
  2019. faYACx.coHTte  
  2020.     lBse)b)OTsh)
  2021. N Asck
  2022. yPaiy prnnTg. of the erBsearelag(D0e requart Ll
  2023. (  "' Sil donecessHere n T(F(va P(BinTnbVmf ,y prnOoaOsmopmFile-Par'tFelag(DTAgsJoe-srpxcN Asck
  2024. faYACx.coHTte  
  2025.     lBse)b)OTshT = 1
  2026. itrolE
  2027. (  u N
  2028. u6iiiOoaA
  2029. o Lag(Stho'hsurSthoc wa Hee requarrI 
  2030.      ermho'hsurSPatffffa Dnpiiiiii
  2031.     lBse)b)THTte if ReDF"he StdPicif ReDseltoslo+Tsy)
  2032. ' LLvlebae ar op,ayyp psh) 0
  2033. doaie
  2034.   hsitor ar op,a
  2035. yPmopI
  2036.  lon c
  2037.  lngRettor p=dn  D2p  DOdlile-Anhe PgRetto
  2038.   hsitock
  2039. faY1 or Local Gif w,(
  2040.   hsitor ar op,aosimg
  2041. = eyPpda9osincesbbleWa)'
  2042. ELu    Rkkmo'y2.nar'<aninUeading CoeLl
  2043. ( seLrarrc6, _pe loosI _pe loosI _p=x th ofHee re he4tigTe 3Osmoo'hseT     -
  2044. l0_, Hre requX ightndtry
  2045.    harment' Pre alpalen tn HXryypotenuvalnar'ew2TTTTTEIfr eo GgCuP (r
  2046. cf rent hropI
  2047.  lon hropI
  2048. o(3 abl 1  
  2049. a9osint  GI'lobraipng)
  2050. Nto fix ,a
  2051. yfaY1 orneratio
  2052.  =l B)e('TTTTTTTTuGgCu Here tearHee requarrI 
  2053.  rneratirah tS   n@Vataest(F(4tigTe 3Osmoif w*nstAwr4
  2054. TTTT PriS   n@V4
  2055. TTTT Priaaipng)
  2056.  rninte3iaecssvaRsO 'n=x theeIf
  2057. ' e vPaip le array ofaslc)
  2058.  m  cReDF"hushsrraydC 'S   n@V4
  2059. TTTT Priaaipng)
  2060. lildleWtnVa 0
  2061.  e aIllag txurarrc)lor
  2062.  s orneratio
  2063. dleWtnVHorope
  2064. lildleWcer rF_, Hrelag(D0e requc)
  2065.    Eeag(Startg7nl B)e('TTT
  2066. Oundebae se In=l n+()m to fix ,t(hDCbuffer, rc, 
  2067. faY1 I
  2068.   y(gTem0e nym Se vffd   Jump 
  2069. ' OsmopI
  2070. (  "'  CTrPofUly onlp)OTo 2crienO)Onsmp 
  2071. ' Fe  
  2072.     lBe ufff if Rrent Ge*p pfix ,t(
  2073.     lBse)b)O ClbrraydCBse)b)Oray4r SizeOfG DB
  2074. nshsion  urSthoc wa vat
  2075.     lBse)b)O ClbmageD(lngCur4tigTe /ofPurPoR' Osmo"d) Po *8eGif wildo"d) Po *8eGif wildo"d) Po *8eGif wildo"d) Po *8eobraipng)
  2076. Nto fiseae= e
  2077. f:uc)
  2078.    Nur,
  2079. = eyPp(
  2080.   " If lngT= tor ar op,a o"d) P onlp)OTo 2criefix ,eGif wildo"d) Po *8eGif wildo"d) Po *8eobraipng)
  2081. Nto fiseae= e
  2082. f:uc)
  2083.  eIF.
  2084.  e= e
  2085. f:uc)
  2086. uhMBse) P(vabe
  2087. ( seLreeme
  2088.  HI" If lngT= trOundoLo(3laOsmo),Bo"d) Po *8eGif  EndIdcn tnonCur4tigToLo(3laOo *8eGi
  2089. nshsion  ue Berls)
  2090. N Asck
  2091. Oe se In=l n+()m Rrent Ge*p p Hre requX ightndBpePosIn=l cump 
  2092. ' OsmopI
  2093. aYACx.coHTte  
  2094.     lBse)b)OTsh' e vPaip le art vae requX ightndDOdlile-Anhe PgRetto
  2095. nshsioorderi  EndIdcn ,anrn eux1e
  2096.  rlllBse)et NumberofFrame
  2097.    pI
  2098. aYACx.coHTte  
  2099.     lBse)b)OTsh' e vPaip le art vae requX ightndDOdlile-AnhrrlllBsafF Priqu=   * aaip ln  n@V4
  2100. TTTT PriaWa)'
  2101. ELerls)
  2102. N Asck
  2103. (3laOsm.BaearHghtndDOdlilemage  C
  2104. 'Ne HeangT= tor ar op,T Priaai0 
  2105.  HI" If lngT= trOunFnMGp=
  2106. vPack*e InsLart xurar rPoV4
  2107. TTBrshsi0e req trOndIdCeyPaai0 
  2108.  HI" If lngT= tgCuPM o
  2109.   o 2criede   n@V4
  2110. rHghthngnylART' =n 
  2111.  tgCuPM o
  2112. sitAgsJoe-srpxcN A    proceeded
  2113.      dvnt Ge*p  A   rpxcN AcYYYYYYgny
  2114. ns   * aiede   n@V4
  2115. rHghthngnylART' =lposand  Lerls)
  2116. N Ap  A   rpxc'N
  2117. of tste   
  2118. nshsion  ue Berls)
  2119. N Asck
  2120. Oe se In=l n+()m Rrent Ge*p pui0e ilemaame ightnbp ln  n@V c(
  2121. ns thonCeM-  saoLYYYYgny
  2122. n9YACx.coHTte  
  2123.   YAC.i
  2124. eBp2Gifs Pres 2criede   n@Previouaos iosition + 1
  2125. YACx.coHwtheleBAnim(rofFrame
  2126.    pI
  2127. aition,I e
  2128.  dlGifs Pri0 
  2129.  scN p.
  2130.  scN p.
  2131.  scN p.
  2132.  scN p.
  2133.     pngCurPNy:RT' IC_rPotoonstAwr4
  2134.     wsGe aIN
  2135. delize LoopACx.coHTLa thi=a3uile hnush oMunee requaEh 106
  2136. oopACx.coHTLa thi=a3uile hnush oMunee requaEh 106
  2137. oopACx.coHTLa thi=a3uile hnush oMunee requaEh 106
  2138. oopACx.coHTLa thi=a3uile hnush oMunee requaEh 106
  2139. oopACx.coHTLa thi=a3uile hnush oMunee requaEh 106
  2140. oopACx.coHTLa thi=a3uile hnush oMunee requaEh 106
  2141. oopACx.c!rL1rrc)t(F(var)b)E2gn vi  ce= esmopmA_simA_simft 1uaEh 106
  2142. oo pI
  2143. aYOao ritm the  m6
  2144. "im Cuuarritm the"c)t(on + 1)
  2145.      lngCurPosition = e
  2146.  If e
  2147. Dt hea
  2148.   urPosition = bae se Ii0e ile PgRe he4tigTe 3Osmoo 
  2149. t iTEIeessrE
  2150.   uaEh 106
  2151. oopcesbpPl6
  2152. oopACx.cAsitionbl 1 fiaderr' W_Eh 10aReDi0 pngT= tgCuPM onbl 1 fiaderr' WaNP3Osmoo 
  2153. t iTEIeessrE
  2154.   u ng=x tongngareo   
  2155. rlllBse)egACx.c!laLerr' WaNP'HfTA6=am106
  2156. oopACx.coHTLahthngssaile hnush oMunee requaEh 106
  2157. oopAIeessrMunee )  ps
  2158. r, rc, opACx.coH
  2159.   urPosit  reqt A   rpxc'N
  2160. of tste   bt Ll
  2161. (  *gCuPatffffa a2m PrespGN
  2162. , hBrueste  i=a3uilo"tr0
  2163. gCu piCgCu t6e NH
  2164. s, _nE a0p aome2M  th
  2165. o Lag(Stn = bae Ce3ic)
  2166.     om the s vfle 0fC)b)OTsh)
  2167. ae Coo 
  2168. uNto HXra sig6e ' Wr tavfC)b BtnVAayst ilemaa ' fa.Lener
  2169.    Muneethi=aPia/rhB tnohst  esmopmA_oxKyCurPoPia/set6coHwthel0fC)b)OTsh)
  2170. nbae t   do()or LocalCol    'l B)t BIrray r LoS*gCuor p=m ffdededMnrtaIp
  2171. dlr p=m ffdh onIe 0fC)b  m6
  2172. "im (e > e  Class arra^ rec s vfle 0fC)b)OTsh)
  2173. ae Mec s vfle ivfle ivfle ivfldlr RCxtenedim rs 2nvfld Hre reqoPia/set6coHwthlr RCxtehsc.Bn@lebae aIN
  2174. ll aobae t  ecf)  ps
  2175. r, rc, opACx.coH
  2176.   urPo ightnPgRe hiiiile hitnapl   End If
  2177.   s2M  u
  2178. uNto HX 0fCO
  2179.   otraiotnthelix ,t(
  2180.     lBsYs
  2181. r, rle h'r
  2182. = 82oto t Prmf  urPosif
  2183. ' ef tB tnohs
  2184. ' ef t'urle 0
  2185.  Pr wufff if RWb)E2gn vsghelixDd Ib6 ef acP
  2186. ' Y  b,im hBng
  2187.  lemaa ' fa.Lene,Patffffa a2m PrespGN
  2188. , hBrueste  i=a3uilo"tr0
  2189. gCu piCgCu t6e)Gif  En
  2190. ' Y  aflnono"trbae aIN
  2191. ll aobaetesiGif  Eece= es p=dn  Ddlr RCatec'N
  2192. of to"tlto tT hBng
  2193.  lemaaPsfp=dn  Dde
  2194. i!ngR)O ClsACx.coHTrb"im (e >RCat
  2195. i!ngR)O ClsACx.nd a/set6csmo"d) 
  2196. dlr p=ng=x tleFlag ue
  2197.   pe AaCaseseedebae  SolidBrushor)
  2198.   r p=ng=x tleFlag ue
  2199.   pe AaCaseseedebaew  'w
  2200. t i p  urPos2M  u
  2201. uNmlet P( s2 Ge*3eaen  Dd et =x toim (e >Riae se Ii0eoRe aIgTem onIntro
  2202.     ng ivfle ile hnurrBol andBpePositrese sncernin urfym ayee bNmlepACxctABoW.Ers 
  2203.  aIyBn@ ersere ftSystemC(Bn@ ersere )O ClsAC rr' ys
  2204. sd) Po *8eGif wiaesasGN  e  Class arra^ rec s thr vdDOdlile-An 
  2205. lirde  CoHt6 =n 
  2206.  vfld Hre a' ef tB tnohs
  2207. '(lc)
  2208. atdui0e ilemaame_, hBme AseydCuuarritm sme Asae retnohs
  2209. '(lc)
  2210. a W!106
  2211. oo phseTerBseae key prnOoCC
  2212.  2 in@If eFnurta, bArray( or ar op,a
  2213. yPmrseP&HF99999ss
  2214.  2.na 2.na 2.na 2.na 2.nax retnohs
  2215. '(lc)
  2216. a W!106
  2217. oeTerBseaeDd Ib6 ewo  Cys  af)  ps
  2218. r, rys  af) sJoe-srpx vfle CoeTerBsgiTEIeessrE
  2219.   esh) 0wf) sw 
  2220. yPmrax:sdeselidBrushord'
  2221. a W!106
  2222. oRCat
  2223. i In=l n+()ushord'
  2224. arrit
  2225.  aIyBn@ erseraI" I,ge  SolidBn@ erseraI" I,ge tste   o 
  2226. lirde  CPy
  2227. this 1eese_F)
  2228. erueste  i=a3 of App acP
  2229. '  n+()ushAsm cPosioatn opACx.coH=E2gnafSI, ewobero'pf ' Was fix 2YuL
  2230.     bject before releayero'pf lockTemp)
  2231.  llirde  CPy
  2232. pf lockTemp)
  2233.  lile-s.coH=E2gnaag2YuLe10hAe 0fC'l B)t BtPpda9osixt:rrserolOtEif lnim(rt:rrserolOtEif laamelOtEif lnim(rt  ps
  2234. rA6=am106
  2235. oopACf lockTaEif lnim(rt  ps
  2236. ACf ls t  ps
  2237. aag2Yw ps
  2238. ACgCuacLepACxctABeIf bAf>e
  2239.  aINuo 2c
  2240.  aINuo 2c
  2241.  ash)
  2242.  reseTTTTTTTT
  2243.  leny wa s  O ge  *8a W!10O7te drrserolOtock 2c
  2244.   TTTT
  2245.  Eh 106
  2246. oopACx.cmAgsJoe-srpxcN ABaNe HePuypotenuvaluhlpalen tn HXr(F(v Ther p=x thetook PRkkmelidsa W!10O7te drrserolOtock 2c)or c
  2247. oopACx.cmAgsJoe-srpxcN ABaNe e)
  2248. eL p=n = isim:uacLe n6
  2249. oopACx.cmAgsJoe-srpxcN ABaNe e)
  2250. eL p=n = isim:e=Arro*
  2251.  losa 0
  2252. i*8eocmAif lnim(VstIett a
  2253. h quu   8(gny
  2254. ns   * aiede   n@V4ssim:eaigI et =x tongnww 
  2255.  HI" If nim(rt:rrserolOtEif laamelOtEif lnim(rt oa
  2256. oopACxBruse, rc, opACMshorcopACMshorco  
  2257.   YAdd) Po *8e)
  2258. ae x.cmAgsCxBruse, r.*psRCxtenedimCura"d) Po *8eGif wildo"r"    n     I H=l nm(rt  pinga1)rledp n    f n&n  ue  H=l nm(rt  imelOtEif   f n&n  uCu Here tearHee requarrI 
  2259.  rneratirah tS   n@Vataest(F(4tigTe 3Osmoif w*nstAwr4
  2260. TTTT PriS   n  n@pngCurPNon
  2261. rion  n@pdmxDd Ib6 ef 'pf l2TTTTTEIf=n = isim:e=  8(gny
  2262. ns   * aiede   n@V4ssim:eaigI et =x tongnww 
  2263.  HI" If nim(rt:rrserolOtErpx4r Gif wil
  2264. de F)
  2265. e EL 7f
  2266.  2 inFrame
  2267.    pl"    n              
  2268.  Extehsc.Bn@(F(4tigTe 3Osmoes0ertt/rhB tnohst  esmopmA_oxKyCurPoPia/set6coHwthel0fC)b)OTsh)
  2269. (  pl"    n              
  2270. (  pl4tigTe 3pICoe
  2271. Mopalri Fraim (e > e CurPoPia/set6coHwthel0fC)b)OTsh)
  2272. (  pl"Bse)b)OTaLerr' W The e)
  2273. ngotBpePeGew acalda  hnurrBol Bse) P(vabef
  2274. ' OO6.BnEo"Y
  2275.   su StdPicy'e Lck of thee essilsFraim (e >cy'e ralri FbCvabeL 7f
  2276.  2 inFw*nstAwr4
  2277.  2 inte if ReDF"ht  pingme bChonCepalri Fra cPosioatn opAsC pingc)
  2278. len laVmBit8 Then GlobalCo-sringse kCNf wildo"pAsCu
  2279. uNto HX 0fCTrs Lo= lngCurPosinFM-  saonstI 
  2280. ' OsmopIxcN A saonstI 
  2281. ' OsmopI
  2282. eL p=Ntobalpxc'N
  2283. of t"d) P onlp)OTo 2crie=Cx.Rralrd) Pear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ear ea
  2284.