home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / LaVolpe_Im209651182008.psc / c32bppDIB.cls < prev   
Text File  |  2007-11-28  |  75KB  |  1,417 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "c32bppDIB"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = False
  14. Option Explicit
  15.  
  16. ' Credits/Acknowledgements - Thanx goes to:
  17. '   Paul Caton for his class on calling non VB-Friendly DLLs that use _cdecl calling convention
  18. '       Used when calling non VB-friendly zLIB dll versions
  19. '   Alfred Koppold for his PNG, VB-only, decompression routines.
  20. '       Used when zLib & GDI+ not available
  21. '   Carles P.V for his pvResize logic
  22. '       Used when manually scaling images with NearestNeighbor or BiLinear interpolation
  23. '   www.zlib.net for their free zLIB.dll, the standard DLL for compressing/decompressing PNGs
  24. '       Without it, we'd be limited to GDI+ for creating PNGs
  25. '   coders like you that provide constructive criticism to make this class better & more all-inclusive
  26. '       Without your comments, this project probably would have died several versions/updates ago
  27. ' For most current updates/enhancements visit the following:
  28. '   Visit http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=67466&lngWId=1
  29. ' To see a usercontrol applying a version of this class
  30. '   AlphaImage Control. http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=68262&lngWId=1
  31. '   Image List Control. http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=69621&lngWId=1
  32.  
  33. ' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
  34. '                                    O V E R V I E W
  35. ' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
  36. ' AlphaBlend API :: (msimg32.dll) , GDI+ API (gdiplus.dll)
  37.  
  38. ' About 32bpp pre-multiplied RGB (pARGB) bitmaps, if you are not aware.
  39. '   - These are used specifically for the AlphaBlend API & are GDI+ compatible
  40. '   Advantages:
  41. '       - Images can be per-pixel alpha blended
  42. '       - Opacity can be simultaneously adjusted during rendering
  43. '       - AlphaBlend does both BitBlt & StretchBlt for pARGB images.
  44. '       - Speed: AlphaBlend & GDI+ are pretty quick APIs vs manual blending
  45. '   Disadvantages:
  46. '       - The original RGB values are permanently destroyed during pre-multiplying
  47. '           -- Premultiplied formula: preMultipliedRed=(OriginalRed * Alpha) \ 255
  48. '           -- There is no way to convert pARGB back to non-premultiplied RGB values
  49. '              The formula would be: reconstructedRed=(preMultipliedRed * 255) \ Alpha.
  50. '               but because of integer division when pre-multiplying, the result is very
  51. '               close and if this should be premultiplied again & converted again, the
  52. '               calculated colors can eventually be completely different than the original.
  53. '               Fully opaque pixels & fully transparent pixels are not affected.
  54. '           ** Note: When images are converted to PNG formats, removal of
  55. '              premultiplication is performed to meet PNG specs.
  56. '       - Displaying a pre-multiplied bitmap without AlphaBlend/GDI+ will not result in
  57. '           the image being displayed as expected.
  58. '       - Not ideal for saving due to its size: SizeOf= W x H x 4
  59. '           -- better to save source image instead or compress the DIB bytes using favorite compression utility
  60. '           -- with GDI+ or zLib, image can be converted to PNG for storage
  61. '       - AlphaBlend API is not included/compatible with Win95, NT4 and lower
  62. '       - AlphaBlend on Win9x systems can be buggy, especially when rendering to DIBs vs DDBs
  63. ' Note that GDI+ is standard on WinXP+, and can be used on Win98,ME,2K & on NT4 if SP6 is installed
  64. ' Download GDI+ from:
  65. ' http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdicpp/GDIPlus/GDIPlus.asp
  66. ' Download ZLib from: http://www.zlib.net
  67.  
  68. ' ----------------------------------------------
  69. ' About Win95, Win98, WinME, NT3.5 & NT4 support
  70. ' ----------------------------------------------
  71. ' These routines may not honor AlphaBlend if it exists on those systems. Win98's version,
  72. ' for example, has several bugs that can crash the application when AlphaBlending to DIBs.
  73. ' NT4, NT3.5 & Win95 do not come with AlphaBlend and I do not have WinME to test with.
  74. ' Therefore, to support these older systems, the Render routine will alphablend manually
  75. ' regardless if the AlhpaBlend API exists on the older system or not. However, this can
  76. ' be overridden by you. See isAlphaBlendFriendly routine. Therefore, AlphaBlend is only
  77. ' reliable on Win2K and above. XP & above already have GDI+
  78.  
  79.  
  80. ' Class Purpose:
  81. ' ----------------------------------------------
  82. ' This class holds the 32bpp image. It also marshals any new image thru
  83. ' the battery of parsers to determine best method for converting the image
  84. ' to a 32bpp alpha-compatible image. It handles rendering, rotating, scaling,
  85. ' mirroring of DIBs using manual processes, AlphaBlend, and/or GDI+.
  86.  
  87. ' The parser order is very important for fastest/best results...
  88. ' cPNGparser :: will convert PNG, all bit depths; aborts quickly if not PNG
  89. ' cGIFparser :: will convert non-transparent/transparent GIFs; aborts quickly
  90. ' cICOpraser :: will convert XP-Alpha, paletted, true color, & Vista PNG icons
  91. '               -- can also convert most non-animated cursors
  92. ' cBMPparser :: will convert bitmaps, wmf/emf & jpgs
  93.  
  94. ' As a last resort, when GDI+ exists, anything unable to be processed by the
  95. ' parsers (i.e., TIFFs) are sent to GDI+. If GDI+ can process the image, then
  96. ' the image will be converted, internally, to PNG to enable additional processing.
  97.  
  98. ' The parsers are efficient. Most image formats have a magic number that give
  99. '   a hint to what type of image the file/stream is. However, checks need to
  100. '   be employed because non-image files could feasibly have those same magic
  101. '   numbers. If the image is determined not to be one the parser is designed
  102. '   to handle, the parser rejects it and the next parser takes over.  The
  103. '   icon parser is slightly different because PNG files can be included into
  104. '   a Vista ico file. When this occurs, the icon parser will pass off the
  105. '   PNG format to the PNG parser automatically.
  106. ' And last but not least, the parsers have no advanced knowledge of the image
  107. ' format; as far as they are concerned, anything passed is just a byte array
  108.  
  109. ' Class Organization:
  110. ' ----------------------------------------------
  111. ' Search the class for the words NEW SECTION
  112. ' The class routines are organized in the following sections:
  113. '   Class Initialization & Termination Routines
  114. '   Public Properties & Methods (almost 60 and growing)
  115. '       Public Read-Only Properties
  116. '       Public Methods
  117. '       Class to Class Communication Methods
  118. '   Local Support Functions
  119. ' ----------------------------------------------
  120.  
  121. ' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
  122. '                                       CHANGE HISTORY
  123. ' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
  124. ' Accompanying FAQ.rtf is updated with every change
  125. ' Last changed: 18 Nov 07. See change history within the FAQ file
  126. ' 26 Dec 06: First version
  127. ' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
  128.  
  129. ' No APIs are declared public. This is to prevent possibly, differently
  130. ' declared APIs, or different versions of the same API, from conflicting
  131. ' with any APIs you declared in your project. Same rule for UDTs.
  132. ' Note: I did take liberties, changing parameter types, in several APIs throughout
  133.  
  134. ' Used to determine operating system
  135. Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As Any) As Long
  136. Private Type OSVERSIONINFOEX
  137.    dwOSVersionInfoSize As Long
  138.    dwMajorVersion As Long
  139.    dwMinorVersion As Long
  140.    dwBuildNumber As Long
  141.    dwPlatformId As Long
  142.    szCSDVersion As String * 128 ' up to here is OSVERSIONINFO vs EX
  143.    wServicePackMajor As Integer ' 8 bytes larger than OSVERSIONINFO
  144.    wServicePackMinor As Integer
  145.    wSuiteMask As Integer
  146.    wProductType As Byte
  147.    wReserved As Byte
  148. End Type
  149.  
  150. ' APIs used to manage the 32bpp DIB
  151. Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal Length As Long)
  152. Private Declare Sub FillMemory Lib "kernel32.dll" Alias "RtlFillMemory" (ByRef Destination As Any, ByVal Length As Long, ByVal Fill As Byte)
  153. Private Declare Function CreateCompatibleDC Lib "gdi32.dll" (ByVal hDC As Long) As Long
  154. Private Declare Function GetDC Lib "user32.dll" (ByVal hwnd As Long) As Long
  155. Private Declare Function ReleaseDC Lib "user32.dll" (ByVal hwnd As Long, ByVal hDC As Long) As Long
  156. Private Declare Function DeleteDC Lib "gdi32.dll" (ByVal hDC As Long) As Long
  157. Private Declare Function SelectObject Lib "gdi32.dll" (ByVal hDC As Long, ByVal hObject As Long) As Long
  158. Private Declare Function DeleteObject Lib "gdi32.dll" (ByVal hObject As Long) As Long
  159. Private Declare Function CreateDIBSection Lib "gdi32.dll" (ByVal hDC As Long, ByRef pBitmapInfo As Any, ByVal un As Long, ByRef Pointer As Long, ByVal Handle As Long, ByVal dw As Long) As Long
  160. Private Declare Function AlphaBlend Lib "msimg32.dll" (ByVal hdcDest As Long, ByVal nXOriginDest As Long, ByVal nYOriginDest As Long, ByVal nWidthDest As Long, ByVal nHeightDest As Long, ByVal hdcSrc As Long, ByVal nXOriginSrc As Long, ByVal nYOriginSrc As Long, ByVal nWidthSrc As Long, ByVal nHeightSrc As Long, ByVal lBlendFunction As Long) As Long
  161. Private Declare Function SetStretchBltMode Lib "gdi32.dll" (ByVal hDC As Long, ByVal nStretchMode As Long) As Long
  162. Private Declare Function GetObjectType Lib "gdi32.dll" (ByVal hgdiobj As Long) As Long
  163. Private Declare Function GetCurrentObject Lib "gdi32.dll" (ByVal hDC As Long, ByVal uObjectType As Long) As Long
  164. Private Declare Function GetIconInfo Lib "user32.dll" (ByVal hIcon As Long, ByRef piconinfo As ICONINFO) As Long
  165. Private Declare Function BitBlt Lib "gdi32.dll" (ByVal hDestDC 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 dwRop As Long) As Long
  166. Private Declare Function SetDIBitsToDevice Lib "gdi32.dll" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, ByVal dX As Long, ByVal dY As Long, ByVal SrcX As Long, ByVal SrcY As Long, ByVal Scan As Long, ByVal NumScans As Long, ByRef Bits As Any, ByRef BitsInfo As BITMAPINFO, ByVal wUsage As Long) As Long
  167. Private Declare Function GetDIBits Lib "gdi32.dll" (ByVal aHDC As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, ByRef lpBits As Any, ByRef lpBI As BITMAPINFO, ByVal wUsage As Long) As Long
  168. Private Declare Function OffsetRgn Lib "gdi32.dll" (ByVal hRgn As Long, ByVal X As Long, ByVal Y As Long) As Long
  169. Private Const STRETCH_HALFTONE As Long = &H4&
  170. Private Const OBJ_BITMAP As Long = &H7&
  171. Private Const OBJ_METAFILE As Long = &H9&
  172. Private Const OBJ_ENHMETAFILE As Long = &HD&
  173.  
  174. ' APIs used to create files
  175. Private Declare Function WriteFile Lib "kernel32" (ByVal hFile As Long, lpBuffer As Any, ByVal nNumberOfBytesToWrite As Long, lpNumberOfBytesWritten As Long, lpOverlapped As Any) As Long
  176. Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
  177. Private Declare Function GetFileSize Lib "kernel32.dll" (ByVal hFile As Long, ByRef lpFileSizeHigh As Long) As Long
  178. Private Declare Function ReadFile Lib "kernel32.dll" (ByVal hFile As Long, ByRef lpBuffer As Any, ByVal nNumberOfBytesToRead As Long, ByRef lpNumberOfBytesRead As Long, ByRef lpOverlapped As Any) As Long
  179. Private Declare Function SetFilePointer Lib "kernel32.dll" (ByVal hFile As Long, ByVal lDistanceToMove As Long, ByRef lpDistanceToMoveHigh As Long, ByVal dwMoveMethod As Long) As Long
  180. Private Const INVALID_HANDLE_VALUE = -1&
  181.  
  182. ' ////////////////////////////////////////////////////////////////
  183. ' Unicode-capable Drag and Drop of file names with wide characters
  184. ' ////////////////////////////////////////////////////////////////
  185. Private Declare Function DispCallFunc Lib "oleaut32" (ByVal pvInstance As Long, _
  186.     ByVal offsetinVft As Long, ByVal CallConv As Long, ByVal retTYP As VbVarType, _
  187.     ByVal paCNT As Long, ByRef paTypes As Integer, _
  188.     ByRef paValues As Long, ByRef retVAR As Variant) As Long
  189. Private Declare Function lstrlenW Lib "kernel32.dll" (lpString As Any) As Long
  190. Private Declare Function GlobalFree Lib "kernel32.dll" (ByVal hMem As Long) As Long
  191.  
  192. ' ////////////////////////////////////////////////////////////////
  193. ' Unicode-capable Pasting of file names with wide characters
  194. ' ////////////////////////////////////////////////////////////////
  195. Private Declare Function DragQueryFile Lib "shell32.dll" Alias "DragQueryFileA" (ByVal hDrop As Long, ByVal UINT As Long, ByVal lpStr As String, ByVal ch As Long) As Long
  196. Private Declare Function OpenClipboard Lib "user32.dll" (ByVal hwnd As Long) As Long
  197. Private Declare Function GetClipboardData Lib "user32.dll" (ByVal wFormat As Long) As Long
  198. Private Declare Function CloseClipboard Lib "user32.dll" () As Long
  199. Private Type FORMATETC
  200.     cfFormat As Long
  201.     pDVTARGETDEVICE As Long
  202.     dwAspect As Long
  203.     lIndex As Long
  204.     TYMED As Long
  205. End Type
  206. Private Type DROPFILES
  207.     pFiles As Long
  208.     ptX As Long
  209.     ptY As Long
  210.     fNC As Long
  211.     fWide As Long
  212. End Type
  213. Private Type STGMEDIUM
  214.     TYMED As Long
  215.     Data As Long
  216.     pUnkForRelease As IUnknown
  217. End Type
  218. ' ////////////////////////////////////////////////////////////////
  219.  
  220.  
  221. ' used to create the checkerboard pattern on demand
  222. Private Declare Function FillRect Lib "user32.dll" (ByVal hDC As Long, ByRef lpRect As RECT, ByVal hBrush As Long) As Long
  223. Private Declare Function CreateSolidBrush Lib "gdi32.dll" (ByVal crColor As Long) As Long
  224. Private Declare Function OffsetRect Lib "user32.dll" (ByRef lpRect As RECT, ByVal X As Long, ByVal Y As Long) As Long
  225. Private Type RECT
  226.     Left As Long
  227.     Top As Long
  228.     Right As Long
  229.     Bottom As Long
  230. End Type
  231.  
  232. ' used when saving an image or part of the image
  233. Private Declare Function VarPtrArray Lib "msvbvm60.dll" Alias "VarPtr" (Ptr() As Any) As Long
  234. Private Type SafeArray
  235.     cDims As Integer
  236.     fFeatures As Integer
  237.     cbElements As Long
  238.     cLocks As Long
  239.     pvData As Long
  240.     rgSABound(0 To 3) As Long ' reusable UDT for 1 & 2 dim arrays
  241.     ' array items: 0=1D item count, 1=1D LBound, 2=2D item count, 3=2D LBound
  242. End Type
  243.  
  244. Private Type ICONINFO
  245.     fIcon As Long
  246.     xHotspot As Long
  247.     yHotspot As Long
  248.     hbmMask As Long
  249.     hbmColor As Long
  250. End Type
  251. Private Type BITMAPINFOHEADER
  252.     biSize As Long
  253.     biWidth As Long
  254.     biHeight As Long
  255.     biPlanes As Integer
  256.     biBitCount As Integer
  257.     biCompression As Long
  258.     biSizeImage As Long
  259.     biXPelsPerMeter As Long
  260.     biYPelsPerMeter As Long
  261.     biClrUsed As Long
  262.     biClrImportant As Long
  263. End Type
  264. Private Type BITMAPINFO
  265.     bmiHeader As BITMAPINFOHEADER
  266.     bmiPalette As Long
  267. End Type
  268.  
  269. Private Enum eOScapability
  270.     osAlphaBlendUsable = 1  ' then AlphaBlend enabled & used when needed
  271.     osGDIplusUsable = 2     ' then GDI+ enabled & used when needed (set in isGDIplusEnabled)
  272.    'oszLIBusable = 4        ' then zLib enabled & can be used to create/read PNGs (no longer used, tested as needed)
  273.     osWin2KorBetter = 8     ' AlphaBlend capable system else it isn't for these classes. See isAlphaBlendFriendly property for more info
  274.     osWin98MEonly = 16      ' Win98 or WinME. When m_OScap includes osWin98MEonly+osAlphaBlendUsable then user overrode isAlphaBlendFriendly
  275.     osGDIplusNotAvail = 32  ' then NT4 w/less than SP6 or Win95. Otherwise system is GDI+ capable else it isn't
  276.     osIsNT = 64             ' NT-based system. Unicode compatible
  277. End Enum
  278.  
  279. Public Enum eImageFormat    ' source image format
  280.     imgError = -1  ' no DIB has been initialized
  281.     imgNone = 0    ' no image loaded
  282.     imgBitmap = 1  ' standard bitmap or jpg
  283.     imgIcon = 3    ' standard icon
  284.     imgWMF = 2     ' windows meta file
  285.     imgEMF = 4     ' enhanced WMF
  286.     imgCursor = 5  ' standard cursor
  287.     imgBmpARGB = 6  ' 32bpp bitmap where RGB is not pre-multiplied
  288.     imgBmpPARGB = 7 ' 32bpp bitmap where RGB is pre-multiplied
  289.     imgIconARGB = 8 ' XP-type icon; 32bpp ARGB
  290.     imgGIF = 9      ' gif; if class.Alpha=True, then transparent GIF
  291.     imgPNG = 10     ' PNG image
  292.     imgPNGicon = 11 ' PNG in icon file (Vista)
  293.     imgCursorARGB = 12 ' alpha blended cursors? do they exist yet?
  294.     imgCheckerBoard = 64 ' image is displaying own checkerboard pattern; no true image
  295. End Enum
  296.  
  297. Public Enum ePngProperties      ' following are recognized "Captions" within a PNG file
  298.     pngProp_Title = 1           ' See cPNGwriter.SetPngProperty for more information
  299.     pngProp_Author = 2
  300.     pngProp_Description = 4
  301.     pngProp_Copyright = 8
  302.     pngProp_CreationTime = 16
  303.     pngProp_Software = 32
  304.     pngProp_Disclaimer = 64
  305.     pngProp_Warning = 128
  306.     pngProp_Source = 256
  307.     pngProp_Comment = 512
  308.     ' special properties
  309.     pngProp_Miscellaneous = 1024 ' this is free-form text can be of any length & contain most any characters
  310.     pngProp_DateTimeModified = 2048  ' date/time of the last image modification (not the time of initial image creation)
  311.     pngProp_DefaultBkgColor = 4096   ' default background color to use if PNG viewer does not do transparency
  312.     pngProp_FilterMethod = 8192        ' one of the eFilterMethods values
  313.     pngProp_ClearProps = -1     ' resets all PNG properties
  314. End Enum
  315.  
  316. Public Enum eTrimOptions    ' see TrimImage method
  317.     trimAll = 0             ' can be combined using OR
  318.     trimLeft = 1
  319.     trimTop = 2
  320.     trimRight = 4
  321.     trimBottom = 8
  322. End Enum
  323.  
  324. Public Enum eScaleOptions   ' See ScaleImage method
  325.     ScaleToSize = 0         ' [Default] will always scale
  326.     scaleDownAsNeeded = 1   ' will only scale down if image won't fit
  327.     ScaleStretch = 2        ' wll always stretch/distort
  328. End Enum
  329.  
  330. Public Enum eGrayScaleFormulas
  331.     gsclNTSCPAL = 0     ' R=R*.299, G=G*.587, B=B*.114 - Default
  332.     gsclCCIR709 = 1     ' R=R*.213, G=G*.715, B=B*.072
  333.     gsclSimpleAvg = 2   ' R,G, and B = (R+G+B)/3
  334.     gsclRedMask = 3     ' uses only the Red sample value: RGB = Red / 3
  335.     gsclGreenMask = 4   ' uses only the Green sample value: RGB = Green / 3
  336.     gsclBlueMask = 5    ' uses only the Blue sample value: RGB = Blue / 3
  337.     gsclRedGreenMask = 6 ' uses Red & Green sample value: RGB = (Red+Green) / 2
  338.     gsclBlueGreenMask = 7 ' uses Blue & Green sample value: RGB = (Blue+Green) / 2
  339.     gsclNone = -1
  340. End Enum
  341.  
  342. Public Enum eFilterMethods
  343.     filterDefault = 0     ' paletted PNGs will use filterNone while others will use filterPaeth
  344.     filterNone = 1        ' no byte preparation used; else preps bytes using one of the following
  345.     filterAdjLeft = 2     ' see cPNGwriter.EncodeFilter_Sub
  346.     filterAdjTop = 3      ' see cPNGwriter.EncodeFilter_Up
  347.     filterAdjAvg = 4      ' see cPNGwriter.EncodeFilter_Avg
  348.     filterPaeth = 5       ' see cPNGwriter.EncodeFilter_Paeth
  349.     filterAdaptive = 6    ' this is a best guess of the above 4 (can be different for each DIB scanline)
  350. End Enum
  351.  
  352. Public Enum eRegionStyles     ' See CreateRegion
  353.     regionBounds = 0
  354.     regionEnclosed = 1
  355.     regionShaped = 2
  356. End Enum
  357.  
  358. Public Enum eConstants      ' See SourceIconSizes
  359.     HIGH_COLOR = &HFFFF00
  360.     TRUE_COLOR = &HFF000000
  361.     TRUE_COLOR_ALPHA = &HFFFFFFFF
  362. End Enum
  363.  
  364. Private m_Tag As Variant            ' user-defined, user usage only. See TAG property
  365. Private m_PNGprops As cPNGwriter    ' used for more advanced PNG creation options
  366. Private m_StretchQuality As Boolean ' if true will use BiLinear or better interpolation
  367. Private m_Handle As Long        ' handle to 32bpp DIB
  368. Private m_Pointer As Long       ' pointer to DIB bits
  369. Private m_Height As Long        ' height of DIB
  370. Private m_Width As Long         ' width of DIB
  371. Private m_hDC As Long           ' DC if self-managing one
  372. Private m_prevObj As Long       ' object deselected from DC when needed
  373. Private m_osCAP As eOScapability ' See eOScapability enumeration above
  374. Private m_Format As eImageFormat ' type of source image
  375. Private m_ManageDC As Boolean   ' does class manage its own DC
  376. Private m_AlphaImage As Boolean ' does the DIB contain alpha/transparency
  377. Private m_GDItoken As Long
  378. Private m_ImageByteCache() As Byte  ' should you want the DIB class to cache original bytes
  379. ' ^^ N/A if image is loaded by handle, stdPicture, or resource
  380.  
  381. Private m_GDIplus As cGDIPlus   ' maintains instance to speed up drawing
  382. Private m_KeepGDIplusActive As Boolean
  383.  
  384. ' NEW SECTION *******************************************************************************
  385. '                   CLASS INITIALIZATION & TERMINATION ROUTINES
  386. ' *******************************************************************************************
  387.  
  388.  
  389. Private Sub Class_Initialize()
  390.  
  391.     ' Determine operating system for compatibility of 32bpp images
  392.     ' http://vbnet.mvps.org/code/helpers/iswinversion.htm
  393.     ' http://msdn2.microsoft.com/en-gb/library/ms724834.aspx
  394.     
  395.    Dim osType As OSVERSIONINFOEX
  396.    Const VER_PLATFORM_WIN32_WINDOWS As Long = 1
  397.  
  398.    ' Retrieve version data for OS.
  399.    osType.dwOSVersionInfoSize = Len(osType)
  400.    If GetVersionEx(osType) = 0 Then
  401.       ' The OSVERSIONINFOEX structure is only supported
  402.       ' in NT4/SP6+ and NT5.x, so we're likely running
  403.       ' on an earlier version of Windows. Revert structure
  404.       ' size to OSVERSIONINFO and try again.
  405.       osType.dwOSVersionInfoSize = Len(osType) - 8
  406.       Call GetVersionEx(osType)
  407.    End If
  408.    
  409.     If osType.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS Then
  410.  
  411.         If osType.dwMinorVersion = 0 Then ' Win95; can't use AlphaBlend nor GDI+
  412.             m_osCAP = osGDIplusNotAvail
  413.  
  414.         Else ' flag as Alphablend disabled, but capable & is Win98/ME
  415.             m_osCAP = osWin98MEonly
  416.         End If
  417.  
  418.     Else
  419.  
  420.         If osType.dwMajorVersion > 4 Then ' if Win2K or better
  421.             m_osCAP = osAlphaBlendUsable Or osWin2KorBetter ' flag as AlphaBlend enabled (Win2K or better) and capable
  422.  
  423.         Else ' WinNT4. If SP6 or better than GDI+ capable else not. Regardless, not AlphaBlend capable
  424.             If osType.wServicePackMajor < 6 Then m_osCAP = osGDIplusNotAvail
  425.         End If
  426.         m_osCAP = m_osCAP Or osIsNT
  427.  
  428.     End If
  429.  
  430.     ' Note for programmers:  To test the spt_Win9xBlend function on systems with GDI+
  431.     ' 1. Unrem next line
  432.     '   m_osCAP = osGDIplusNotAvail
  433.     ' 2. Rem out the next two lines
  434.     Me.isGDIplusEnabled = True  ' attempt to start GDI+, test system capability, add osGDIplusUsable to m_OScap
  435.     If Me.isGDIplusEnabled Then Me.HighQualityInterpolation = True
  436.     
  437.     m_Format = imgError
  438.  
  439. End Sub
  440.  
  441. Private Sub Class_Terminate()
  442.     DestroyDIB ' simply clean up
  443. End Sub
  444.  
  445. ' NEW SECTION *******************************************************************************
  446. '                           PUBLIC PROPERTIES AND METHODS
  447. ' *******************************************************************************************
  448.  
  449.  
  450. Public Property Let Alpha(isAlpha As Boolean)
  451.     m_AlphaImage = isAlpha  ' determines the flags used for AlphaBlend API
  452.     ' this flag is set by the various image parsers; setting it yourself
  453.     ' can produce less than desirable effects.
  454.     ' Used in Me.Render & Me.TrimImage, cPNGwriter.OptimizeTrueColor & cPNGwriter.PalettizeImage
  455. End Property
  456. Public Property Get Alpha() As Boolean
  457.     Alpha = m_AlphaImage
  458. End Property
  459.  
  460. Public Property Let HighQualityInterpolation(Value As Boolean)
  461.     ' When possible GDI+ will be used for stretching & rotation.
  462.     ' If GDI+ is used,then high quality equates to BiCubic interpolation
  463.     ' If not used, then BiLinear (manual processing) will be used.
  464.     ' If High Quality is false, then Nearest Neighbor (very fast, less quality) interpolation used
  465.     m_StretchQuality = Value
  466. End Property
  467. Public Property Get HighQualityInterpolation() As Boolean
  468.     HighQualityInterpolation = m_StretchQuality
  469. End Property
  470.  
  471. Public Property Get ImageType() As eImageFormat
  472.     ImageType = m_Format    ' returns image format of the source image
  473. End Property
  474. Friend Property Let ImageType(iType As eImageFormat)
  475.     m_Format = iType    ' set by the various image parsers. This is not used
  476.     ' anywhere in these classes, you can do with it what you want -- for now.
  477. End Property
  478.  
  479. Public Property Let ManageOwnDC(bManage As Boolean)
  480.     ' Determines whether or not this class will manage its own DC
  481.     ' If false, then a DC is created each time the image needs to be Rendered
  482.     Dim tDC As Long
  483.     If bManage = False Then     ' removing management of DC
  484.         If Not m_hDC = 0& Then   ' DC does exist, destroy it
  485.             ' first remove the dib, if one exists
  486.             If Not m_Handle = 0& Then SelectObject m_hDC, m_prevObj
  487.             m_prevObj = 0&
  488.         End If
  489.         DeleteDC m_hDC
  490.         m_hDC = 0&
  491.     Else                        ' allowing creation of dc
  492.         If m_hDC = 0& Then        ' create DC only if we have a dib to put in it
  493.             If Not m_Handle = 0& Then
  494.                 tDC = GetDC(0&)
  495.                 m_hDC = CreateCompatibleDC(tDC)
  496.                 ReleaseDC 0&, tDC
  497.             End If
  498.         End If
  499.     End If
  500.     m_ManageDC = bManage
  501. End Property
  502. Public Property Get ManageOwnDC() As Boolean
  503.     ManageOwnDC = m_ManageDC
  504. End Property
  505.  
  506. Public Property Get isAlphaBlendFriendly() As Boolean
  507.     isAlphaBlendFriendly = ((m_osCAP And osAlphaBlendUsable) = osAlphaBlendUsable)
  508.     ' WinNT4 & below and Win95 are not shipped with msimg32.dll (AlphaBlend API)
  509.     ' Win98 has bugs & would believe that WinME is buggy too but don't know for sure
  510.     ' Therefore, the Rendering in this class will not use AlphaBlend on these
  511.     ' operating systems even if the DLL exists, but will use GDI+ if available
  512.     ' Can be overridden by setting this property to True
  513. End Property
  514. Public Property Let isAlphaBlendFriendly(Enabled As Boolean)
  515.     ' This has been provided to override safety of using AlphaBlend on Win9x systems.
  516.     ' Caution. Only set this when rendering to a known device dependent bitmap (DDB)
  517.     ' Alphablend can crash when rendering DIB to DIB vs DIB to DDB. Be warned.
  518.     If Enabled = True Then
  519.         ' Overriding in play: allow AlphaBlend if system is Win98 or better
  520.         ' By default this is already set for Win2K or better
  521.         If ((m_osCAP And osWin2KorBetter) = osWin2KorBetter) Then
  522.             m_osCAP = m_osCAP Or osAlphaBlendUsable
  523.         ElseIf ((m_osCAP And osWin98MEonly) = osWin98MEonly) Then
  524.             m_osCAP = m_osCAP Or osAlphaBlendUsable
  525.         End If
  526.     Else
  527.         m_osCAP = m_osCAP And Not osAlphaBlendUsable ' disallow AlphaBlend
  528.     End If
  529. End Property
  530. Public Property Get isGDIplusEnabled() As Boolean
  531.     ' identifies if GDI+ is usable on the system.
  532.     ' Before this property is set, GDI+ is tested to ensure it is usable
  533.     isGDIplusEnabled = ((m_osCAP And osGDIplusUsable) = osGDIplusUsable)
  534. End Property
  535. Public Property Let isGDIplusEnabled(Enabled As Boolean)
  536.     ' Sets the property. If set to False by you, GDI+ will not be used
  537.     ' for any rendering, but still may be used to create PNG files if needed
  538.     
  539.     ' You can reset it to true at any time. If the system won't support
  540.     ' GDI+, then the True setting will simply be ignored -- no harm, no foul
  541.     ' To test success:  c32class.isGDIplusEnabled=True: If c32class.isGDIplusEnabled=True Then ' success
  542.     
  543.     If Not Enabled = Me.isGDIplusEnabled Then
  544.         m_osCAP = (m_osCAP And Not osGDIplusUsable)
  545.         If Enabled Then
  546.             If (m_osCAP And osGDIplusNotAvail) = 0 Then ' else Win95, NT4 SP5 or lower
  547.                 Dim cGDIp As cGDIPlus
  548.                 If m_GDIplus Is Nothing Then
  549.                     Set cGDIp = New cGDIPlus
  550.                 Else
  551.                     Set cGDIp = m_GDIplus
  552.                 End If
  553.                 If cGDIp.isGDIplusOk() = True Then m_osCAP = m_osCAP Or osGDIplusUsable
  554.             End If
  555.         End If
  556.     End If
  557. End Property
  558.  
  559. Public Property Let gdiToken(Token As Long)
  560.     ' Everytime a GDI+ API function is called, the class calls GDI+ apis to
  561.     ' create a GDI+ token first then destroys the token after the function is called.
  562.     
  563.     ' This occurs quite often. However, you can create your own token by calling
  564.     ' GdiplusStartup and then passing the token to each class for the class to use.
  565.     ' You would call GdiplusShutdown during your main form's Terminate event to
  566.     ' release the Token.
  567.     
  568.     ' When Token is zero, the classes will revert to creating a token on demand.
  569.     ' When the Token is not zero, any other DIB class created by this class will
  570.     ' pass the token as needed. The only routine that can create a new instance and
  571.     ' returns that new instance is the CreateDropShadow method. You must set the
  572.     ' token for that class at some point for that dropshadow class to use it.
  573.     
  574.     m_GDItoken = Token
  575.     
  576. End Property
  577. Public Property Get gdiToken() As Long
  578.     ' returns the GDI+ token if one was created
  579.     gdiToken = m_GDItoken
  580. End Property
  581.  
  582. Public Property Let Tag(vValue As Variant)
  583.     If IsObject(vValue) Then
  584.         Set m_Tag = vValue
  585.     Else
  586.         m_Tag = vValue
  587.     End If
  588. End Property
  589. Public Property Set Tag(vValue As Variant)
  590.     Me.Tag = vValue ' use the object check in the Let property
  591. End Property
  592. Public Property Get Tag() As Variant
  593.     If IsObject(m_Tag) Then
  594.         Set Tag = m_Tag
  595.     Else
  596.         Tag = m_Tag
  597.     End If
  598. End Property
  599.  
  600.  
  601. ' NEW SECTION *******************************************************************************
  602. '                               PUBLIC READ-ONLY PROPERTIES
  603. ' *******************************************************************************************
  604.  
  605. Public Property Get Width() As Long
  606.     Width = m_Width     ' width of image in pixels
  607. End Property
  608. Public Property Get Height() As Long
  609.     Height = m_Height   ' height of image in pixels
  610. End Property
  611. Public Property Get BitsPointer() As Long
  612.     BitsPointer = m_Pointer ' pointer to the bits of the image
  613. End Property
  614. Public Property Get scanWidth() As Long
  615.     scanWidth = m_Width * 4&    ' number of bytes per scan line
  616. End Property
  617. Public Property Get Handle() As Long
  618.     Handle = m_Handle   ' the picture handle of the image
  619. End Property
  620. Public Property Get isZlibEnabled() As Boolean
  621.     ' Read Only
  622.     ' To create PNG files, GDI+ or zLib is required. This property informs
  623.     ' you if zLIB exists in the system's DLL path
  624.     isZlibEnabled = iparseValidateZLIB(vbNullString, 0, False, False, True)
  625.     
  626. End Property
  627.  
  628. ' This setting will keep the current cGDI+ class active which
  629. ' prevents destroying the GDI+ hImage and Token objects.  This
  630. ' can speed up rendering. This option SHOULD NOT be set when the
  631. ' class is not compiled. Else crashes will happen when
  632. ' user hits END or VB toolbar's STOP button while in IDE
  633. Public Property Get KeepGDIplusActive() As Boolean
  634.     KeepGDIplusActive = m_KeepGDIplusActive
  635. End Property
  636. Public Property Let KeepGDIplusActive(keepActive As Boolean)
  637.     m_KeepGDIplusActive = keepActive
  638.     If keepActive = False Then
  639.         Set m_GDIplus = Nothing
  640.     ElseIf Me.isGDIplusEnabled = False Then
  641.         ' can't set to True if GDI+ not installed
  642.         m_KeepGDIplusActive = False
  643.     End If
  644. End Property
  645.  
  646.  
  647. ' NEW SECTION *******************************************************************************
  648. '                                       PUBLIC METHODS
  649. ' *******************************************************************************************
  650.  
  651. Public Function LoadPicture_File(ByVal FileName As String, _
  652.                                 Optional ByVal iconCx As Long, _
  653.                                 Optional ByVal iconCy As Long, _
  654.                                 Optional ByVal SaveFormat As Boolean, _
  655.                                 Optional ByVal iconBitDepth As Long = 32) As Boolean
  656.  
  657.     ' PURPOSE: Convert passed image file into a 32bpp image
  658.     
  659.     ' Parameters.
  660.     ' FileName :: full path of file. Validation occurs before we continue
  661.     ' iconCx :: desired width of icon if file is an icon file. Default is 32x32
  662.     ' iconCy :: desired height of icon if file is an icon file. Default is 32x32
  663.     ' SaveFormat :: if true, then the image will be cached as a byte array only
  664.     '   if the image was successfully loaded. Call GetOrginalFormat to retrieve them.
  665.     ' iconBitDepth :: the desired bit depth of an icon if the resource is an icon file
  666.     
  667.     ' Why would you want to save the bytes? If this is being used in a usercontrol,
  668.     ' saving the bytes will almost always be less size than saving the 32bit DIB.
  669.     ' Additionally, these classes have the ability to get different sizes from
  670.     ' the original source (i.e., WMF, icon, cursors) if available, but if the
  671.     ' 32bit DIB is saved, it is a constant size. The potential of different sizes
  672.     ' could allow better resizing of the image vs stretching the DIB.
  673.  
  674.     On Error Resume Next
  675.     Dim hFile As Long
  676.     
  677.     hFile = iparseGetFileHandle(FileName, True, ((m_osCAP And osIsNT) = osIsNT))
  678.     If hFile = INVALID_HANDLE_VALUE Then Exit Function
  679.     
  680.     If GetFileSize(hFile, 0&) > 56 Then
  681.         
  682.         ' no image file/stream can be less than 57 bytes and still be an image
  683.         Dim aDIB() As Byte  ' dummy array
  684.         LoadPicture_File = spt_LoadPictureEx(hFile, FileName, aDIB(), iconCx, iconCy, 0&, 0&, SaveFormat, iconBitDepth)
  685.     
  686.     End If
  687.     CloseHandle hFile
  688.     
  689. End Function
  690.  
  691. Public Function LoadPicture_Stream(inStream() As Byte, _
  692.                                     Optional ByVal iconCx As Long, _
  693.                                     Optional ByVal iconCy As Long, _
  694.                                     Optional ByVal streamStart As Long = 0&, _
  695.                                     Optional ByVal streamLength As Long = 0&, _
  696.                                     Optional ByVal SaveFormat As Boolean, _
  697.                                     Optional ByVal iconBitDepth As Long = 32) As Boolean
  698.     
  699.     ' PURPOSE: Convert passed array into a 32bpp image
  700.     
  701.     ' Parameters.
  702.     ' inStream:: byte stream containing the image. Validation occurs below
  703.     ' iconCx :: desired width of icon if file is an icon file. Default is 32x32
  704.     ' iconCy :: desired height of icon if file is an icon file. Default is 32x32
  705.     ' streamStart :: array position of 1st byte of the image file. Validated.
  706.     ' streamLength :: total length of the image file. Validated.
  707.     ' SaveFormat :: if true, then the image will be cached as a byte array only
  708.     '   if the image was successfully loaded. Call GetOrginalFormat to retrieve them.
  709.     ' iconBitDepth :: the desired bit depth of an icon if the resource is an icon stream
  710.     
  711.     ' Why would you want to save the bytes? If this is being used in a usercontrol,
  712.     ' saving the bytes will almost always be less size than saving the 32bit DIB.
  713.     ' Additionally, these classes have the ability to get different sizes from
  714.     ' the original source (i.e., WMF, icon, cursors) if available, but if the
  715.     ' 32bit DIB is saved, it is a constant size. The potential of different sizes
  716.     ' could allow better resizing of the image vs stretching the DIB.
  717.     
  718.     Dim nrDims As Long
  719.     If iparseArrayProps(VarPtrArray(inStream), nrDims) = 0& Then Exit Function
  720.     If nrDims > 1 Then Exit Function
  721.     
  722.     If streamStart < LBound(inStream) Then streamStart = LBound(inStream)
  723.     If streamLength = 0& Then streamLength = UBound(inStream) - streamStart + 1&
  724.     If streamLength < 57 Then Exit Function
  725.     ' no image file/stream can be less than 57 bytes and still be an image
  726.     LoadPicture_Stream = spt_LoadPictureEx(0&, vbNullString, inStream, iconCx, iconCy, streamStart, streamLength, SaveFormat, iconBitDepth)
  727.  
  728. End Function
  729.  
  730. Public Function LoadPicture_Resource(ByVal ResIndex As Variant, ByVal ResSection As Variant, _
  731.                             Optional VBglobal As IUnknown, _
  732.                             Optional ByVal iconCx As Long, _
  733.                             Optional ByVal iconCy As Long, _
  734.                             Optional ByVal streamStart As Long = 0&, _
  735.                             Optional ByVal streamLength As Long = 0&, _
  736.                             Optional ByVal iconBitDepth As Long = 32) As Boolean
  737.  
  738.     ' PURPOSE: Convert passed resource into a 32bpp image
  739.     
  740.     ' Parameters.
  741.     ' ResIndex :: the resource file index (i.e., 101)
  742.     ' ResSection :: one of the VB LoadResConstants or String value of
  743.     '       your resource section, i.e., vbResBitmap, vbResIcon, "Custom", etc
  744.     ' VbGlobal :: pass as VB.GLOBAL of the project containing the resource file
  745.     '       - Allows class to be mobile; can exist in DLL or OCX
  746.     '       - if not provided, class will use resource from existing workspace
  747.     '       - For example, if this class was in a compiled OCX, then the only way
  748.     '           to use the host's resource file is passing the host's VB.Global reference
  749.     ' iconCx :: desired width of icon if file is an icon file. Default is 32x32
  750.     ' iconCy :: desired height of icon if file is an icon file. Default is 32x32
  751.     ' streamStart :: array position of 1st byte of the image file. Validated.
  752.     ' streamLength :: total length of the image file. Validated.
  753.     '   -- See LoadPicture_Stream for the validation
  754.     ' iconBitDepth :: the desired bit depth of an icon if the resource is an icon
  755.     
  756.     ' Tips:
  757.     ' 1) Store 32bpp bitmaps in the "Custom" resource always. Storing in the
  758.     '       Bitmap resource can change color depth of the image created by VB
  759.     '       depending on your screen settings
  760.     ' 2) Icons, normal bitmaps, & cursors are generally stored in their own sections
  761.     '       However, with icons containing multiple formats, VB will extract the
  762.     '       closest format to 32x32. May want to consider sThen ' sundle hFile
  763.   '       - e ' sundluO)
  764.                          BiLinePropelosest f,Dunctsystembility (nx32. lzing of the imrror
  765.  
  766. E' iconCy :: desirle; can exist in DLL or OCX
  767.     '     b           As mat to 32x32. May w  depend32x32. May w  IME is b  IME is b  ileconCy As Loed he3cg of file names icon
  768.     imgWMystembility                      'CnePropelosest fnot proviendly(1=IB c.
  769.     ' inStream:: byif the resource is          ames icon
  770.     imcanL or OCmage
  771.     LoadPicture_Strea- the rDims A2ur WinME. When m_OSc0
  772.     ' te
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791. ByVal Savalidat)t :: arr   ' fI  ' te
  792.  
  793. oolean
  794. e file. Validated.
  795.   ng thrksp Then     '***of the imrror
  796.  
  797. E' iconCy :: desirleen BitBlt Libb pro or VB too    am(C%           u      ility (' sundluO)
  798.        ' Yu VB too    am(C   ' special he ie        ames icon
  799.     imcanL Ys icon
  800.     imcanL Ys icon
  801.     imiteF' Yonly
  802.  B_is b  IME is9        iBAs Loed'     b         H SaveForByReffys str_a , _l OCX
  803.  i+++++++    ' height oed when s )e GDI+ hImaunctionReffys ksp The
  804. ' Cl Afys str_'             is9     e) = osU your own           is9) As Lone As Long
  805.     
  806.     hFiength :: total lengths DIB :U is9) 
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  Noe file
  814.    E FileNown           is9c
  815.    21 stretch/distorta'           tocaaaaaaaaa
  816.  
  817.  
  818.  
  819.  Noe
  820.  Noe)Coken         ic    ' used=ure_Streamaaaaa(ByRef lpRect Asitmap Aon
  821.    l Afys.            Di tCis9) 
  822.  0&, 0eamaaaaa(ByRcse,  file is tBlt Lib  this treamLength, SaIBJ_ENHMETA
  823.    s   /distorta'ass tDIB    erty
  824. Public Property Get BitsPouaa(B'ass tDIB    ebr_PaetEWhen m_OSc0
  825.    ' icoNL osType.dwMial ByVal DC As Long
  826.     GDI+ hImNL osType.y) TheGart, streamLen    de your screeeeeeeeeeeee-
  827.    deeeeeeeee-
  828.    d                         Optionf theefile is tBlt' Tl almo True_Stream = spt_LoadPictureEx(0&, vbNur'ct' Tl almo i.YPublic PrD+lity (  ' inSnot provmNL pha ble pha blong, ByRef pBitmENHe. Validated.
  829.   ng thrksp Then     '***of the imrror
  830. ha ble phageT?regionlean
  831. e file. Validated.
  832.   ng thrksp Then     '***of the imrror
  833.  
  834. E' iconCy :: desirleen BitBlt Libb pro or VB too    am(C%           u    esirleen Bi.fn on demeamLength => eScaleOptions   ' See ScaleImage method
  835.     ScaleToSize = 0     ge
  836.    Vm: one of thms thms thms thms thms thms thms thms thms thms thms thms thms thmsone : onLenso///E or OCX ' streamStart :: array position of 1st byte of the image file. Validated. imrrors Long, isn't
  837.   sThen 'BitDeptAs Limags Lonmtion of 1st byte of the image file. Validated. imrrors Long, isn't
  838.   sThed in_IconSi
  839.     ' 32bvalidunctsysteer.EncodeFiB////amLength => nNumbtByVaonly 
  840.         If m_I  
  841. End Property
  842. Public Property ly 
  843.  aleOptions   ' See ScaleImage method
  844.     ScaleToSize = 0     ge
  845.    Vm: one of thms thms thms thm
  846.     isZl/Ety (  ' inSnot provst by the only way
  847.     '           to use the host's resource file is passing the host's VB.Global reference
  848.     ' ic is passing the host's VB.Global reference
  849.     ' ic is p(sourcis kernel32" (ong
  850.     Ha
  851.     ' ic is p(sourcis kersThewdle is passirsThewdleseValidahewdle isssirsThcurs quitc way        u    esirleen Bi.fn on demeamLength => eScenray positigth =>uld yodleseValssGDIplu foul
  852.  2alss' hequitc way5i byte of th ng use*******sitigth***iTPeryFiing oSuby the lAdesirleen BitBlt Libbray posite icon if file isdesirleenype.y) TheGarthe image wil=ype.y) Thedc image vs d
  853.  
  854.  
  855.  
  856. led OCtream = spt_LoadPict  '   -- Se extrae isdinatepe BITMAPy the lAdesirlheGarthe imageTMAPy thed'    Validated. imrron   erty
  857. PudFilmDLE_VALUE imageRity (' sunNumbtByVaonl Afys.    MAPy the lmrron   ertIf m_I  
  858. End PrOhms thmsI  'WIN32_  Ifevery 98 or OFriendly property for more info
  859.     osWin98MEonly  suost'1yl Afys.   msI  'WIN32_  IfeveFormsource fi Afys.    suost'1yl Afys.   mseeition issirsThcurgsepGDIplufi Afys.    sm(Ospt_LoailterAd, vbNullStringxM**
  860.  
  861. fys.   mse v
  862.  
  863.  
  864. ByVlu foul
  865. ,ptsystem(hms thS=   Vm: one of thms thce mst_LoadPcyVlu ffffffffffV  mse v
  866.  
  867.  
  868. ByVlu fo msee  mseeition issirsTh ' thenhost'/:      Scat'/:      Sc'osIScat'/:  N5ewdle is
  869.   s Sc'osIScat'/:  N5ewdle is
  870.   s Sc'osIScat'/:  N5ewdle is
  871.   s Sc'osIScat'/:  N5ewdle is
  872.   s Sc'osl("kernel32.dll" (ByVal hMem As Long) As Long
  873.  
  874. ' /////////
  875.     regioirsThcSc'o              Optioifica As Long)le. Validated.m As Lotom" resource mOnly set _I nd If
  876.     Ce
  877. s is not ************Ipie mOnHODS
  878. ' lie validationy time. If not ********p GDI+ pha ct the
  879.     'dis
  880.   s Sc'osl("Ipie mOnHODS*****y it
  881.             ' fbhe lmrron   ertIw pha c l AfysS*****y  imon '1yl Af(
  882.  umbtByVaonly ce you w lmrron   ertIw& if z le
  883.      fbhe lmonly    t depttByVaonly ce   Optiss b ur oertlmrrone
  884.    Ioon   ertIw& if z le
  885.      used='source mOnly se    **iTPer
  886.  
  887.  
  888. ByVlu(rcis kersThe'    Validated.mAbpg********2. May w  de it is usable
  889.     isGDIplusEnabled = ((m_osCAP AY  isGDIpsno image file/stream cgth =
  890.  
  891. BP AY  isGDIa4rtIw&s thmsI  'Wr mOnly set _I nd If
  892.  
  893. BP m   Vof asI  'Wr conCy :: desirleen BitBlt Libb prodmin the e mOnly rmin t         . May w  de   suost'1ylseArrayPropscic iscic one of thms Inames wme, True, ((m_osCAP And osIs of tct' Tl almo i.YPubline of t   . M2lmoee See  widereamLength As (m_o/stream can be less  the e mOnlyei'), ((m7Pouaa(B'asnnnnnnnnnn=ype.y) ror = -1  ' th As (m rmin t         . May w  de   suosP AY  isGDIps=ype.y)e.y) ror = -1  ' th As (m rmin t         . May w  d-1  ' ttL.y) r/////Ss=y t         . bames wme, True,p = -1ring value valhmsf  ' 5
  894. Public ProprCERTIESO isGDIplusEnabled = (s.   rray
  895.    Enunly waage file  End OT be 
  896. led OCtream = spt_Lo, stre ur oertlmrronees if GD e, Fil True, ((ronees if GD e,rceUIplusEnabled = (s.   rray
  897.    Enunly waage file  End OT be 
  898. led OCtream = sp]image w2s
  899.   s Sc
  900.     If GetFilLype.y)e.Sdot compilst always beIw cG, ((to use tty method
  901.     trimAll = 0   u=R*.299, G=G*.587, B=B*.1 2lmoee Seed.
  902.     ' We u(e) =             Optional' dummy array
  903. eA  . own   A:  ''t supportlean
  904. e file. Validated.
  905.   ng thrksp Tsource file index (i.e., 101)
  906.    sActive = m_ys ' We u(e) =   L phaive = m_ys ' We u   :alidu     ' We32bie e mOnl     '        L aTsysfys ' We u   :ali<.587l
  907. ,ptnli<.587ys ' WeK '  rce file u(e) =   L phaive = m_ys ' Wenabcb imon '1yl Af(
  908.  umbtByVaonly ce you w lmrron   ertIw& if v(g[aonly ccgthmrro8MEon
  909. ,ptnlime of initial image creation)
  910.  nt sizes fro= 5  ' standard cursor
  911.     imgBmpAimage filetsirleen Biaonly ccgthmrro8MEonrseen ^so, c lue    t line
  912.   un)
  913.  nt sizew
  914.    sActive  sizew
  915.    sActive  sizew
  916.    se  sizevBlor depth ofimage creation)
  917.  nt i', is 
  918.   tl True, :sCAP = R1ype icoClihe
  919. ' Cl Afys str_'    eyidated.MatiovBlor d&'    **********  Ifce fiatiovBlor de
  920. ' Cs       Optioifi fiatiMirsThcSc'o      s tFilLype.y)e.Sdot compilst always beIw revObj
  921. n tue, :sCAP = R11111111We u   ngth ::f icon if file ngth X ' stgsGDIplusEper     ' udesirlheon't know fof
  922.  
  923. Bs of tct' Tadde
  924. ' Cs       Optioifi fi fi = 0 Then ' else Win95, NTByVlheoi' Cs       Optioifi fiatiMirsThcSc'o      s tFilLype.y)e.Si revObj5
  925.   un   osh X ' stgsGDIp&e creation)
  926.  nt e, :sCAP = R1ype ipscic R1ype ipscic Rtl    **pe.y)e.Si rep&PoneesitsPointer() As Longen ' e&    . bames wme    m_Formac'osIScat'/:ue, True,,&6mi revd) = 0  revObj5
  927.   un udes sure
  928.  
  929.     i5
  930.   u. suremong, By*pe.y)e.Si rep&Poi
  931.     'DR1ype ipscic vBlon)
  932.     filt
  933.     Dim hmong, By*pe.y)e.Si ion GetyR11111111We u   ngtheY0 The system.
  934. ppe.y)e'/:ue,,neatcyVlu ffffffffffV  ms/1111115i byte of th ng use*******sitigth***iTPeryFiing oSuby the lAdesirleen BitBlt fffffe thrk+r     ' usundle hFile
  935.   '       - e ' sundis passing the host's  imcanL Ys = (s.   epfffffe seFilter_U pong = 0&, _
  936.              Sc'o  s  imLRlLype.y calls GDI+ apissssssssssssssssssssssJm_hDC RlL
  937. BP  WinSc'o  s As eImageF OnlyXcaleImage method
  938.     Scae Win95, 95, 95ropellt
  939.     Din   ertIf m_ in DLLLLLLLLLLLLs wme, True, (dUsa)nt sizes fro= 5  ' standa roperty
  940.  
  941.  
  942. ' BmpAim'(dUsaRyI rep&Poi
  943.     'DR1ype LLLs wmeh of the image file. Validated.
  944.     ' SaveFormat :: if true, then the image will be cached as a byte array only
  945.     '   if the image was successfully loaded. Call GetOrginalFormat to retrieve them.
  946.     ' iconBitDepth :: the desired bit depth of an icon if(.
  947.     'nalFormat to retrieve them.
  948.     ' icoiTPew     Bitmis
  949.   nc Proper'nalFormat to retrievely set _I nd IfyR11111S   'nacached as aewdle is
  950.   s uR  ' If not u. retrievely set _I nde lAdesfe the0   s:1S   'nac Scpethod
  951.    uM  End If
  952.         Delet7ithe image was su. roneesitsPointer() As Longen ' e&    . bameed)
  953.     oil True, ((ronehU **pe.y)e.Siiat to rnrsp.Siimeed) As Longen ' e&    . b';O thie
  954.     oil True, hcXen stre. b'**inrsp.SiimeedeEnd OT beongeehU *If
  955.  
  956. BP m   Vof asI  'Wr conCy :: desirc:bled = ((mFeng
  957.          riev,. b'**inrsp.Sii
  958.  u th various imat depth f n              Optional VBglobal As IUnknown, _
  959.                             Optional ByVal iconCx As Long, _
  960.                             Optional ByVal iconCy As Long, _
  961.                             Optional ByVal streamStart As Long = 0&, _
  962.               As Long = 0&, _ve  sizew
  963.    seUd    GDI+ not idUsa)nt eated andard curers.sirl'    n savr osGDameed)r     ' usun rmage creation)
  964.  nt sizes fro= 5  'r)r     sav=) = 0  revObj5
  965.   un udes =) =he
  966. ' C)    n savr osGDameed)r     ' usuurce imc5  'r:: desirc:bled = ((mFeng
  967. )r desirc:bled = e objectfron. b' ((ronehU **pe.y)e.Sate m_Handle As Long StretchQuatfron.B(m_Handhie
  968.     oil True, hn t_Hasav=) = IN4)_Handle As Long Stretiiat to rnrsp.Siimeed) hod
  969.    s Long =  ' standa roRay
  970. eA  . own   A: ional By_
  971.     rnrsp.Si =             OpOptioPB  sizewpertyIpie mOnHODS****NC((mFeng
  972. )r desirus)ve  sizew
  973.    seUdto rnrsp.Siimry fast, leesirus)ve  sizew be d='source mOnly se    **iTPerp  Di&  Optional hSc'osIlpe Lonehu. rone*iTPerp  a P         Perp  ao rnrsp.Si.y) TheGart, C s tFip.Sii
  974.  u th varioutFip.S8p.Sii
  975.  u th varioutF)
  976.  nSBreation)
  977.  nt i', is 5reation)
  978.  nt i', is xt      Opt.+ tFip.Sii
  979.  u st aip.Sii
  980.  u th varioutFip.S8pRUE_COLOR = &HFF    Opt.+ tF si1mmmmmCmarsp.Siimry fast,s 5re   nc C s tFip.Si
  981.  v          As mat  COLOR = &Hy fast,s U Thedc etermihp.Si
  982.  e .FbnHODS
  983. ' lie validation e .FbnHODS
  984. 4 beD    . uyC s(
  985.  e .FyVal iconBiboCOLOR = &Hy fast,s U ThPe .FbnHODnt i', ispt.+ tFip.Sii
  986.  u st ai usu ***p.Siial iconCy As Lof the imagieated andard curers.sirl'    n nly se ii,o, leesirus)ve  sizew be =  ' standa rEYuse filtene
  987.     F Onlsirl'    n nly *******sipscic R1ype(verle
  988.   - whether or no' standa rEND METHODS
  989. ' ********************sipsci'    n nly *******sipscic R1ype(verle
  990.   - whether or no' standa rEND METHODS
  991. ' **********************pverle
  992.   - whetub Clao DDB. Be warncriptida ngen ' e&    . b';O tnrsp.Siimeed) Asepend32x32.  ' e&   y As L - whthen high qtub Cla' e&   n the - whthen Long                                                                           ***ms/1111115i The potential ofength, SaveFormat, iconBitDepth)
  993.  
  994. End Function
  995.  
  996. Public Fblic Property ilst al/streamnter() APublics Long3vp, iconBitDepth)potODS
  997. ' *****em,
  998. End Enumce leToSize lasses, you can do with it what you want -- for now.
  999. End Property
  1000.  (s.  f an icon i do with it tODS
  1001. ' *****em,
  1002. End Enumc an's  c'osIlpeAP And o c'osIlp  . Ml
  1003.  nSBr c    ' sFunction
  1004.  
  1005. Public Fbli    Opt.+ it what you want -- Fpt.+ it.lic Fblie ' usun rmablicitanhon
  1006.  
  1007. PheGart, C s tFip.Sii
  1008.  u th varioutFip.Sii
  1009.  u tht desirc:sart,
  1010. Phelh, SaveFRty Let Highepend32x32.   Optu(e) = ?   Optu(e) = ? 1ype(verle
  1011.   - whether or no' standa rEND METHODS
  1012. ' ******Fpt.+     
  1013. ByVlu fouls         better -anda rENpeAd as a or no' standa rENmlic Fbli th variout - ,rtah X ' stZ/fouls  a rEYuse filtene
  1014.     F dl. Only set thi[ for now.
  1015. EODS
  1016. he oinction
  1017. ustZ/fouls  a rEYuse fi32
  1018.     ' ssm_Tag termihpncreationStart < LBound(in(ptZ/fouls  a rEYuse=he
  1019. ' BnHODS
  1020.  - ,rtaocGDIncti**********mce leToSize lasses, youcset thi[/foulsyouc.B(Y     PUgth =>uld yodleseVa
  1021.  
  1022. ' /pp(sourcis kersThewdle is passirsThewdleseValidahewdle isssirsThcurs quitc way        u  Priurcis kersThewdlwn   A: ional Ban
  1023. ig or no' standa r
  1024.              Sc'o  s  imLRlLyped youcsetBan
  1025. ig or no' ss
  1026.     '       oiatiMirshms thmsI  'WIN32_  IfevGd youcsetBane' ss
  1027.     '      **************uclls GDI+ api or no' sS1 youh As/////////////// icon///bIpGDIplusT Iariout -ge will      - As///////////(no' sS1resourcduce lresourcduce lresourcduce lresourcdbs) if aourcdb*mce leToSize lasses, youcset thi[/foulsyouc.B(YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYaroA
  1028.    ssAcyB. 1    u(  spt_Lormulas
  1029.     gsclNTSCPAL = 0     ' R=R*.299, G=G*.587, B=B*.114 - Default
  1030.     gsclCCIR709 = 1     ' R=R*.213, G=G*.715, B=B*.072
  1031.     gsclSimpleAvg = 2   ' R,G, and B = (R+G+B)/3
  1032.     gsclRedMask = 3     ' uses only the Red sample value: RGB = Red / 3
  1033.     g?   Optiona pable
  1034.  true, th, C 2ses only the RelosestS    u(  true, operty
  1035.  (s.  f an icon i d3es only the Relo8n i d3esquite sptiona E,then high quality equates to BiCubicOI cPNGwriter.EncodeFilter_Up
  1036.     filterAdjAvg = 4      ' se  ' iconart, C e fi Afy  **iTPer
  1037.  
  1038.  lmrron   ertIf m_I  use fi3 ,     betterus'i************* ND METHODSoSR iconart, C e fi Afy  **iTPer
  1039.  
  1040.  lmrron   ertIf m_I  use  Let Highepend32x32.   Optu(e) = ?   Optu(e) = ? 1ype(verle
  1041.   - whether or no' standa rEND METHnFr no''''''''''''''''
  1042. ' *****(s.  GLOBIR709 = 1 Z          'o MEnd Enumc an'sg'''
  1043. ' ****3lE,then high quality ono' sS1reso
  1044. Publicccccccoinction       
  1045.     '      oinct"no' sS1reso
  1046. Publicc
  1047. Pu) =e/   Di t,then hif) =e/  &.114 - Defy                 Di tCbfoSize = ************* Ne/   Di t,thed . bameted  ertize = ***********sirVB.GLOBAL ofe P         Perp  ao rnrsp.Si.y) TheGart, C s tFip.Sii
  1048.  u tR Optional ByVal h qualitptional ByVal h ii
  1049.  u tR OptP mPPrivate m_Handle As Long        ' handle to 32bpp DIB
  1050. Pri.Sii
  1051.  u 
  1052.     m_HandluR[/foulsyouc.Bw)) =e/  &Pe*****           u 
  1053.     m_obtptioter() Aurcduce lresourcdu          er
  1054.  
  1055.  lm' If norron   ertIw& si           u 
  1056. o MEnd EnTor no' sle As Lemle is passing the host's mr 2ses otream,ivate m'to BiCuing ton n high qu-S1resourcduc1YYY+bb0ate m'to BiCuing ton n high qu-n '1y' R,G' Saion)
  1057.  dl. Only set thi[ for now                                                                       m'to BiCuing ton n high qu-S1resourcduc1YYY+bb0ate m'to BiCuing ton n high qu-n '1y' R,G' Saion)
  1058.  dl. Only   Let Highepend32x32.   rB/:ue,ty Get sirl'verlemf n se  ' icerle
  1059.   - wlgse fi32
  1060.     ' ssm_Tag termihpncreationStart < LBound(in(ptZ/fouls  a rEYuN5en high qu-n '1y ,rti tCbfoSize = ***** - wlgse eigh seTultiple formats, VB will extract the
  1061.     '                    m'topassing the host's mr 2te m'to to BiCuiA,ion)
  1062.  ly   Let:mr 2Propert***********c Fbli    Opt.+ i1*********er   yVal h quali*****SVlu ft***********cdach time the image Fbli  Fb****cdach time the image 0tnrsp.Siimeed) Asepend32x32.  ' e&   ybpt.+ i1***is s thms thmsHan                                  eed) Aseppend32x3Tag i*****ee 0tnrsp.SinSinSiThigh qu-S1resourcduc1YYY, _
  1063.    Asepend32x32.  ' e& 1iR = &Hy fast,s U ThPi'),ts,ion)/erle
  1064.   - whaaetOrginimagwsm_Tag s  0tnrsp.Siimt th.LonehetOrginimagw5will beetOrginim
  1065.     GD,s ginimagwsm&Y Longty eq
  1066.   - whether or ,ns      CLASS INITIALIZATION & TERMB1U, _
  1067.                       m'to BiCuing ton n high qu-S1resourcduc1YYY+
  1068.     ' 32bitfor                    Optionn file. Default is 32xs  a rEYuse Ru   G  ' couldoo BiCuing ton n higardtC ginimagwsm&Y  iconBitDepth :: thlt iime. If  '1yl Af(
  1069. dtC ginimaigh quality(iR = &Hy fast,s nly the f an iceYll not ued sample value: RGB = R ono' sS1rc,age y thic Fblie ' u OptP mPPriva isb           m'topassing
  1070.   n ceYlXA*******2. May w s nly the fInala ono' sS1rc,age y th******2. May wtU4l' ice = *,s ginimagwala ono' sS1rc,a osIs of tct' Tl almo i.YPubline of t   . M2lmoee m,5ewdle is
  1071.   s Sc'oHe. Validat        *out - ,r)5ewXiS these
  1072.     ' oper usun rmage The2uSabilityyVaonly ce   OptY+
  1073.   u  ' allowinnal ByVal h ii
  1074.  u tR OptP mPPrivate m_Handle As Long        ' hal h ii
  1075.  u tR OptP mPPrivate ss LP mPPri?As Long AYLP DPPrivateLibinly ccgthmrrs           
  1076.   ly the fInala oP mPPrivate ss LP m3 = m_sGDIpluuing toSizeLong        'rrrrrre   OptY=oinct"no' ala oP mPPrivate ss LP m3 = ass.is '1y si  Fb****cdaaIME is b  ileconCy toSizeLm3 = astoSizeLong   sA2ur WinFblic Propefyy ccg f n          esourcdddddddIy) ror =age y th'D      ue y th'Db     B(YYYYYYe
  1077.    sAc    **peX3YYYYe
  1078.    sAc    ***nala ono'l LoadPictBC            pPictBC            pPictBC  no'l                  S,)b         
  1079.     F dl.y th'Db     B(YYYYYYe
  1080.    sAc    **peX3b ror = -1  iB(YYYYYYe
  1081. ate m_Handle ACYYYe
  1082.  compilst alwaysIcompilst alr usun rmage o'l LoadPictBC            pPwmnter()  useaa= Afy ltiona pable
  1083.  t1U, _
  1084. if true, th  iB(l' Yoning
  1085.   n e sys/
  1086.  - ,rtaso
  1087. Pubf the DLL exists, but will u vor = -1mtBC            pPwmnter()  useaa= AfyEp useaa= Afy ltiona pable
  1088. _**nala ioy si  Fb*g AfyEp ub't
  1089.  ''t soy si  
  1090.   2_  Iists, but willecddddy ltiona pable
  1091. _**nala ioy si  Fb*g AfyEp ub't
  1092.  ''t soy si  
  1093.   2_  Iists, but willecddddy ltiona pable
  1094. _**nala ioy si  Fb*g AfyEp ub't
  1095.  ''t soy si  
  1096.   2_  Iists, but willecddddy ltiona pable
  1097. _**nala ioy si  Fb*g AfyEp ub't
  1098.  ''t ain(ptZ/fo but wil  spt_dimImage, cPNGwritee  ' icerle
  1099.   - wlgse fi32
  1100.     ' ssm_Tag termihpncrtl beetOrginimkas in a compileimImage, cPNGwriteyEp  m_Handle AssS1resourcdle Ainimkas   Di tCis9I AfyEp ub't
  1101.  ''t soy si  
  1102.   2ptZ/foulsml beetOrginimkas in a compileimImageY+
  1103.   u  ' allowinnal ByVal h ii
  1104.  u,sts, but wi = Z/foulsmlinctiollusEnabled() AE sewritee c0sp(arginim
  1105.     gsc******** uinimagwmy ltiona pableYnctiollusErtl beetOrginimkafoulsYYYYYYYYYYt seFiltd Token scic vBln    Validated.+FenlPesthFb*g AfyEp ub't
  1106.  isn't, but wi = Z/foulsmlinctiosi  Fb*g AfyEl0t2bitfoprCERTIESO isGDIplusEnabled = (s.
  1107.  true, th, C 2ses only t, th, C 2ses onong, _                             eed) Aseg() APublla ioy  filtene
  1108.     F Onlsirl'    n nly *******sipscic R1ype(tP mPPriva isb           m'topass ma/****s  '    m'tritee  ' icer*****sipscic R1y'trit(   D M:,sts, bule Aicc
  1109. Pu) =e/   Di imageTMAPy thed'    Validated. imrron   erty
  1110. PudFilmDLE_VALUE imageRity(s.
  1111.  true, th, C 2s OptP m     ginimkas in a compi
  1112.     gdIw&h =
  1113.  
  1114. BP AY  iist's VB.Global referef thms tc Xv' sS1r,rt&pin ddddy lso///E you want  Validab*g       x3Ta iist'ageh
  1115. PudFilmDLE_ iist'bm  '           to use tlSof  waage file  EndPriva ia i if thellowinnamethod  twdle is
  1116.   s Sc'osl("kernel32.dll" (ByVal hMem As Long)  er or1    ' ssm_gmwwwwwwwas in a compileireferef thdy ltiona pable
  1117. _ng, inS+hely lbt th(   D M  2_ :: on m_H  eRthdy                :: on m_HhaBleFunal hMem As LongS+h          . re                    mI
  1118. _**na desired wi: on m_H  eOptional By s nly the fIna e mOs nly the fIna m_HhaBleFuna:GgeTMA1 EnOpto       D AC 2ses only t, th, C 2  mPes only t, erle
  1119.   - whGgem_HnOpto      msHan   si  
  1120.  pBtretc   sA2urags Lonmtion of 1st byte of the imageK '  rce file u(e) =   L phaive = m_ys ' Wenabcb imon '1yl Af(
  1121.  umbtByVaonly ce you w lmrrc0sp(argini-   am(C e fileed.
  1122.     If Enabled = !ep ccgthmrro8M2yl Af(t's VB.Global re
  1123.   ie ' u114 retup DIB
  1124. P.R = &Hy ctive ,age y th******2. May w =   L pen hi(con '1yl Af(Ihe imag2 t, iconu          y th**n hi(c   
  1125.     '    cvt conu vor = -1mtBC          
  1126.    sosCAP AY  isGDIpsno 4iunal hMem As LongS+h e y1yl Af(Ihe imag2 t, i) True)
  1127.     
  1128. EndRir)5 = -ihrksp Tssssss
  1129.   u  ' allowLLLe.Af(Ihe imag2tIw& if z le
  1130.      used='source mOnly_**nala ioy si  Fb*g AfyEp ub't
  1131.  ''t ain(ptZ/fo but wil  spt_dimImage, cPNGwritee  ' iceri n savgS+h e y1ylXt ai miunal hMem oeri n savgSe  ' 3but wi = Z/ Z/foLnnly_**nala ioy si  _
  1132.                   
  1133.  magag2tIw& if z leavgSe  ' 3but w mOnHODS****NC((mFeng
  1134. )ro but  magag2tIw& if z le '1y si  sed='s5ewdle is
  1135.  :: onh)
  1136.  
  1137. E(mbtByVa iconBi       
  1138.   8M2yl Af(tla ioy fileedal hMem filltiona pable
  1139. _e   
  1140.    M2yl Af(tla i     
  1141.   (tla i     
  1142.   (tltla ioy fileedal hMem filltiona pable
  1143. _e   
  1144.   busu ***p.eFBP  WinSc'o  s_            21 stre (tla i  yEp ub'ttup DIcoiTPew lsirl'    n   cvs(   D M:,sts, bule Aicc
  1145. Pu) =e/   Di imageTMAPy thed'    Validatend if system is Win98 or better
  1146.         ='ttup DIcoiTPew ltend if syste Wenab           21the ThMem oea m_HhaBleFu th**do.Glo Af(tla yEp uthe imagieate.Glo Af(tla yEp in a comptd if systen
  1147.  
  1148. Pub(tla yEp utc
  1149.  
  1150. Pub(tla  cvt hod5.eFBP  WinSpmageTMAPy teandle As       >, cPNGb    b)
  1151.  lth**n hi(c   
  1152.     '    cvt conu vor = -1mtBC          
  1153. e       9I XyVal hMem'Ie,rceUIs -1mtBC    ng, _  e ,   '    cvt eate a . roneeMAPy thed'    Vad. e,r
  1154. )rofor           tl Tmon 1art As e imag2tD+lity imkas . roneeMAPy thed'   ps eart As  ue iist'syEp ub't
  1155.  ''t soy sAf( tc Xv'mtBC    ng, _ rieeMNptionalnly ccgthmrro8MEonrseen ^so, c lue    t line
  1156.   un)
  1157.  nt sizew
  1158.    sActive Wro8MEonrsssssssssssssssssss  b)
  1159.  lth**sssssssssss. M2lmoee m,E(pable
  1160. loy sAf( tc X_Pn)
  1161.  treaBt thi[/fog2bitfor     qro8MEon
  1162. ,ptnlim u  ' allowinnal                     reamStar fil ''t ng usecoClihe
  1163.  lth**n hs ei,erofor   *n     cyG m,E(pabesourcduc1YYY+bb0aowinnauretrieve them . ron ai lity n     cyowinnauretrieauretri
  1164.     . ronL(tltla ioy fileedal hMeiourcdetri
  1165.     . ronL(tltla'pone of the VB LoadResCourcvetri
  1166.     . ronL(tltla'pone ronL(tltla'p true, th,. ronL(tltla ioy fileedal hMeiourcdetri
  1167.     . ronL(tltla'p9tIw& if z leavgSe up a iBIhat you want -- Fpt(ton   ertIw pha***is s As Long = 0)_**nala ioy so, cor     q. ron(=ageF     y n     cyos s Ass s  Fpt(ton  d5.eFBP  WinSpmageC(ks,c ltionS   Iw& if z leT syste( AssOy iceYll not ued ed heigh   cyos P)_**nthed'   pnS   Iw& if z lssssssssss  b)
  1168.  lth**yste( . Validat        *                     OptiNpti *  , thIpsno 4iunt coEG*siribinly cc As cG   **nala ono'l LoadPictBC enS   +wltiona pa  m_Tag ,ssssssss  bnd If
  1169. End e  Optitream foS   a com or no'  seFiltd Tok .  Optitre If
  1170. End e  qro8MEon
  1171. ,ty
  1172. Public Proper: roper'na s Sc'oost always be YoS   roper: ropessssss  o8MEof ^so, uA,ssssssss  onu vor = -1mtBC      aSc'oost ,able
  1173. loy sAf(         ource mOnl a rEYuNh
  1174.                 Di imkas . ronem(etopassise fiao with it tODS  Perp  ao I Iw& if CE8MEon
  1175. ,ty
  1176. , t, ic i+++' canon  d5.eFBP 0  sn't
  1177.   sThed Ee u(embtByVaisdesirleenypeO,   esPubln hi(c   
  1178.   uBIhat you w
  1179. PudFilmUs tmrro8M   
  1180.  *s  'yowinnauretain(ptZ/fo  'yowinnauretembioper: r.      omk hi(c Dallt
  1181. eYll not ued GGGGp ' f        uBfusecoCl  o ron abn issssss  onse ThCl  o ron abn issssss) ifval re'8MEonrseen ^so, c lue    t line
  1182.   un)
  1183.  nt sizew
  1184.    sActive Wro8MEonrssssssssssss the to the reb  this treamsinctiollovBlor dhActive
  1185.    sAsS1 youh As///////////Nona pable
  1186. _e   
  1187.    M2yl Am im pable
  1188. _e   
  1189.    M2yl  ao I Iw& if CE8MEo,able
  1190. _e   
  1191. pl    
  1192.   (tla i     
  1193.   (tltla ioy fileedal hMem filltiona pable
  1194. _e   
  1195.   busu **
  1196.  umb       leedal hMem filltioy si  sed='s5ssss) ifval re'8MEonr ' Parame, t, ic i+++ w  0  sRudFilmUs tmrs sure
  1197.  
  1198.     i5    sed=m  i5 he stem(hms thS=   Vm: one      ueval re'8Mbb0aowinA)rXx)Byle ib't ib'tCAP AY  isGtCAP AYo5 hGtCAP AYo5 hGtCAP AYo5 hGd  o8MEof ^so, uA,ssssssss  onu vor = -1mtBC      aSc(c   
  1199.   uBIhat you w
  1200. PudFilmUs tmr++' cansB///Nona pable
  1201. _e  Bonr ' Pa_Formay th*pdsB///Nonicand alwaysIcompilstif CE8MEo,able
  1202. _e  ather DIBal rompilsOpti  uA,s teso
  1203. Publicc
  1204. Pu) 
  1205. dtC ginimaigh ao I Iwepth :: theIoionalmageMEontion LoadPicture_Stream(inStrea,
  1206.              Sc'o  s  imLRlLype.y calls GDI+ apisssssssssssDt hod5ssssssm oc1m o ron abn issssss) ifval re'8MEve ib'ticc
  1207. Pu) 
  1208. dtC ginimaigh oP mPPrivate sHs. M2lmls GDI+ a. M2lmoee m,******* Bal rompi hod5ssvTpesired bit deurce mOnlmrror
  1209. tp a ,v
  1210.  u th viGtCA****:a       wg   Sc'o  s 1st nL(tltl(((((((((        u 
  1211. LP DPPrivateLibinly ccc
  1212. P=(((((( ption of 1sl Af(tla i     
  1213.  youh As////mmve
  1214.  /fog2bitfor     qro8Ms otream,ivan2/ icon///bIpGDIplusIve
  1215.  /focgth Ms otream,iI Byte, _H, is 5reation)
  1216.  dated.(      Di imkas . ro               k line
  1217. End n'I
  1218. End n'I
  1219. End n'I
  1220. End n'I
  1221. End     dLet         paBleFunal hMemC ginimaigh oP mPPrRs    rnrsp. 
  1222.    M2yl uh As//////////nehU **pe.   dLetm filltioy si  sed='s5sss wiRropet& bpt.+ac Scpt& bpt.+acf( tc Xv'mtBC    ng     qrMEon
  1223. ,p((((og2bitf tcoy si  sed='s5ssss) ifval re'8MEonr ' Parame, t, ic i+++cvs(   D M:,sts, buleivaTpes Long, _
  1224.                ' uses only the Red sample value: RGB = Red / 3
  1225.     g?   Optiona .Loneheo5 hGtCAP AYou((((s- s 1st nL(tltl(((((((( hGtCAEon
  1226. os9I (toerXx)Bl uh As///////////ed=Ie,rceUIs -1mtBC    ng - whetub Ce D     ' str//ed=Ie,rceUIs -1mtBC    sEper     ' ,rti '''''''tr/sIcompilstif CE8MEo,se 32h :: _
  1227.         ii-1mtBC    s(t'''tr/s8MEve iMEon
  1228. ,ty
  1229. Pcom sS1 youhunal   e  ' ico  sav=)      sS1 youhu    '    cvt conu vor = -1mtBS0BC  -     used='od5ss sav=)   l(hed'    Validatend if systemcng = 0&, _
  1230.          a ' str//ed=Ie,rms omms- s 1st n rievrmsy
  1231.      me.tBC adPictemcT tmrOEon
  1232. itBlt fffffe thrk+r     ' us((( hGtCAEon
  1233. os9_pending   DrieeMNptiosThen 'Bffffe thlsus((( e thlsucT tmrOEon
  1234. itBlt fffffnooooooooe thrk+r     y th   w0 tmC          
  1235. e       9IlseValidaptu(e) = ?   Optu(e) = ? 1ype(verle- str//ed=Ie,rceUIs -1mtBC    sEper     ' ,rti '''''''tr/sthlsucT tmrOEoti '''''''tr '''''''daptu(iconBi E = ? t, ei ,oievrms  . r u vor = -1mtBS0onr ''u vor =ucT'  seFiei ,offe th   LoadPictnunly was5ssss) ifval  '   -- d height of Ir u voss5ssss) ifval  n*g Afy  LoadPiaNi Wfy  ca              ' uses only the Red sample conBitDepth :: the desired bitTrueCne&ui ' st:: emcng =2 osIs og s  0tnrsp.Siimrseen ^so, 
  1236. dt=2 osII+ apisssssssnly t      se2 osIs og s  0tnand alwaysIcomp               rnS   Ie
  1237.     '  osII+ e of          R11111S   '6xip    cc ldne,sed=S    R111.. CE8MEon
  1238. ,ty
  1239. , t, ic i++     '6IMNptiosTof    no' sS1rc,age y thic Fbl(ctioe y thic Fbl(ctioe y ve
  1240. osTof :,sreso
  1241. Puzoe y thiof mpleIw& if z le  
  1242.     . roobl(cti5ssvTpe32bs5ssss) iflwaysIcomst always tnand alwaysIC hlsucT         mI
  1243. PIwlor d&'    ***d     dLet              r5ssss)tfor    r5ssss)on
  1244. vnr          Di imSSSSSSSSSSSSSSSS Loa th, ,BL p  rnS   Ie the image fiaSSSSSSSSSmage fiaSSSSSSSSSmage fiaSSSSSSSS    's) iflwaaujs  a rs=ucT'SSSSSSSSSS Loa th, ,
  1245. PI((( hGtCAEon
  1246. os9_pending   DrieeMNpt-n '1y ,rteBiLin111..h0_pending4ltf :     reamStar fil ''t ng usecoClihthls:     ream1ype ipscpending         Di imses have t=2 od  . rage fiaSSSSSSSSS 1st n rievrmsy
  1247.  mbSSSS Loa com ldne,se   Di or d&'   dRloPpype LLd&'   dSSS 1a s1monlt isaeI isaeI isaeI ,U) iflw(ring, i D AAAA, _
  1248.       eate aof Ir u voss5ssss) resourcein111.a2 od  .. CE8MEon
  1249. ,tub Ce e) = ?   Optss) rdesirlsun eamStarm: ve
  1250. osTof :,tDepth)
  1251.  
  1252. EnOptss) rdeeC As Long
  1253.     GDI+ hImNL osType.y) TheGart, AAA, =  ' standa t Themk hi(c Da:'
  1254. LP  n rievrof NL osType.y) TheGart, AAA, =  ' standsaeI isaeI isaeI ,U) iflw(rin-   Optss) rdei
  1255.    sASmap.y) TUO ico  sav h ii
  1256.  u tR   s>tOIee.dwMial ByVa z le '1y si  2          n, As Long
  1257.     Gem(etopassise fiao wit   '    fi Afy  **iTPer
  1258.  
  1259.  lmrron   ertIf m_I  use fi3 ,     betterus'i************ s//bty was5ssssp((((og2bitf ti*****t i', isptIwlor d&'    ***d     dLet          '    ***us'      sp.Si.yp   'dwMial tsssp . r u sptIlmageMEon tsssp . uund IOR = &HFi(c   
  1260.   ioyy fileti***tpByVa z le YYYe
  1261.    sAc no used=.  'dwMn
  1262. PIwlor d&'Tble, b Ifevery 98 oAs L - whthen high qtub Cla' e&   n the - whthe+e    **iTPerp98 oAs L -mbSSSS Lithen hige    **iTPerp98cwas5ssssp((((og2bitf ti*****t i', isptAfy l ifval r32h :: _
  1263.    hcithea t5ssssp((((og.and  '1yon
  1264. 'dwntAfy  iflwaaur32h :: _ 3 Vm: one   no used=. u k line*is s thhcithea    ioAn't
  1265.   sThed(L(ed.mAbpglwaa= 5  'e         O(og2bitf ti*le/bty ***us'  ty  imonq ti*lei'e         O(og2bitf ti*leAs Lssp . r u s    O(og    iftgsGDIWmo*******taght of le1iTOCAEon
  1266. os9I (toertf ti*le/1yon
  1267. 'dwp . r u s    O(og    iilltioy dwp . r -1mtBC   :,os9_pendinseVali . r u s    t=2Typeiyon
  1268. 'dwf r u v    e   no uwp . :b ub't
  1269. w   hcithetBC   :,os9_  if the image was successfully loaded. Call GetOrginalFormat to retrieve them.
  1270.     ' iconBitDepth :: the desired bit depth of an icon if(.
  1271.     'nalFormat to retrieve them.
  1272.     ' icoiTPew     Bitmis
  1273.   nc Proper'nalFormat to retrievely set _I nd IfyR11111S'/////Etmis
  1274.   ncmImagBIhat you t to retb1 youhuL(ed.mAbpglwaa= 5  'e           a R
  1275. EnOb'/////Etmis
  1276.   nk   a Rst n rievrmsy
  1277.    d&'  ed.mAbpglw+ional Byst n fy  **iTPer
  1278.  
  1279.  lmrron   ertIf m_I  use fi3 ,     betterus'e   no uwoe t &c = &HFi(c   g, _
  1280.        no' sS z lee fi3 ,     bet      O(wt Bonr ' Pa_FoqLs't
  1281. w   he   's) ifldFilmDLE_VALUE ima
  1282.        no' Nm st:ioy fileeters.  O(wt Bonr ' Pa_FoqLs't
  1283. w   islmtrimaeI isTSSSSSSSS=C    sEper  itDepth :: tewRSS=C I ::+pth :: tS
  1284. ' *****em,
  1285. EnC,vmtrimetOr **iTPe_D **iT standa t Themk hi(c Da.n if(.
  1286. b
  1287. EnC,vmtrimetOr **iTPe_D **iviendlyevely set**iTPew9) er
  1288.  
  1289.  lgh qtubSE: nd CiOT be 
  1290. led OCEp  m_Handlmuuw9) er
  1291. o(c **iTPe_D **ivie+oooooooe 1)
  1292.     ' set**iTrc **iTPe_D **ivie+oooof+oooof+oooof+oooof+ the i   no' sS zo9) er
  1293.  
  1294.  ffffV  ms/1111115i byte of th si  Fb*g 11111draysIco  'o MEnu tR OptP mPPrivate m_Hand111.a2 obFt eate a sSe oftltla'.a2 obFt eate a sSe oftlmmmmmmmmmmmmmmmc u vo a sSe o&eC As Long
  1295.          mmmc u vo a sSe-"tOr **iTPe_D115i byte of th si  Fb*g 11111dra=LPubln hi(c   
  1296.   ve
  1297.  nSEnC ,  Y          If nrDims > : tewRSSomk h2.3ic Rcbln hi(c   
  1298. :bpt.+ac t
  1299.  ''contain veSims > :r
  1300.  
  1301.  lgh c   
  1302. :bpt. ndvb*g 1uonq t:L**iT sta As Lss) rde*nala ioy si  Fb*g AfyEp ub't
  1303.  ''t soy **E t:L**iT sta As Lss) rde*nala ioy si  Fb*g AfyEp ub't fi3 ,     betterus'e **iT stai
  1304.  ''t  Fb* rde*nala mNL o*O     eate aof Ir u vims > :r **iT stamS smc u vo a sSe o&eC As Long
  1305.  FIwepth :: theI
  1306. EnC,vmtrir d&'    ***d     d  s Sc'oHpcs a byte array only
  1307.     '    'dwMial tsssi  Fb*g AfyEp ub't fi3 ,      d  s Sc'o3 ,     bL(e-eVali& TEd BiCuing ton   
  1308. :bpt.+ac t
  1309.  ''contam aof Ir u voui Aon
  1310. ,tu.+ac t
  1311.  '
  1312. :bpt6lt1ype(verle
  1313. . Call GetOrgi ?   Optu(Nwon
  1314. ,tu.c   
  1315. : ?   Optu(Nwon
  1316. ,tu.c   
  1317. : ?   Optu(Nwon
  1318. ,tu.c   :,tDepth)
  1319. aeI isevelyEYuse f/,Ahl , b s L - whth ''contain veSims > :r
  1320.  
  1321.  lgh c   
  1322. :bpt. nd'oy si Rst 'o -a As Lss) rde*nala ioy sBisaeI isae  ***us'    bpt. nd'o'iin veSist BitD (    nda t        (wtmDalaiin ve fi3 ,+oooof+oooof+ h ii
  1323.  u  mNL o*O     eatA eatA eat***us'  ui Aon
  1324. ,tu.+ac  ,+ot    th)
  1325. aegwsm_Tag s  0tnr  ui Aon
  1326. ,tu.+ac L///'oy **EFilmDL  FbDS*****y it
  1327.    u        
  1328. :bpt. nd rde*n a byte arrs    t=2Typeiyon
  1329. 'dwsp . r u sptIis
  1330.   ncmImagBIha(ton    FbDS*****/rS*****/rS*****/ruset  Fb h    . r u sptIisoe      i Da.n if(.
  1331. b
  1332. EnC,vmtrimetOr **iTPe_D **iviendlyevely set**iTPew9) er
  1333.  
  1334.  lgh qtubSE: nd sed='s5 FbDS**r_Tagtu(NwonGtOr **iiiiiiiiiiiiiiffffV  ms/y=LPubln hi(c   
  1335.   igweiol0tnr  ui Aon
  1336. ,tu.+aostB0aowinSE: n  vroer() APubluwMial ByVa 0mUsoe 1)
  1337.     '            tivaa(B'asnt'uH s1monlt isaeI isaeI isaeI ,U) iflw(ring, i D AAAA, _
  1338.       eate aof Ir u voss5ssss) resourcein111.a2 od  .. CE8MEon
  1339. ,tub Ce e) = ?   Optss) rdesirlsun eamStarm: ve
  1340. osTof :,tDepth)
  1341.  
  1342. EnOptss) rdeeC As Long
  1343.     GDI+ hImNL osType.y) TheGart, AAA, =  ' standd'o'y the fIna s) ewdlwn   A: ional Ban
  1344. ig or no' standa r
  1345.              Sc'o  s  imLRlLypedvmtrimetOr *h. ron ai ls2 o(R by( Aihth ''endlyevely set**iTP   Ae
  1346.   - s1monlt Ssssp(((,ble
  1347.  **isssy_dimImage,aourcd+th ''endons   ' inSE: n  v no'g(R by( Aihtvh qtue.y)e.Sdot compilst always beIw revObj
  1348. n tue, :sCAP = R11111111We u   ngth ::f icon if file ngth X ' stgsGDIplusEper     ' udesirlheon't know fof
  1349.  
  1350. Bs ofr *lusEper     ' udesirlheon't knvObj
  1351. n tue, :sCAP = imetOTheGar sBiss&eate a sSe oftlmmmmmmmmmmmlmageMEon tsss32bs5ssss) i  Validatend/ve fi3e = m_ys 'tend/ve fi w = imftlmmmmmlmagess) i  V   iftMAPy T  mth X ' stgsGDIplusEper  iftMnEFildach time t iftMnEFildach time t IplusEper  iftMnEFildach time t iftMnEFildach time t IplusEper  iftMnEFe t gach te tue, :sCAP = icd+th ''elusEper  iftMnEFe t gach te tue, :sCAP = icd+th ''elusEper  iftMnEFe t gach te BC    iftMnEFe t gach te tue, :sCAP = icd+th ''elusEper  iftMnEFe t gach teEcd+th ''elusEmTd+th ''elusEiviendlyevelyastgsGDIgsGDIgsGDIg obFt '8Mbb0d1ActiveTheGar0''elusEiviendlyr no' sle As LemlxM**
  1352.  
  1353. fysnHO imftlmmpired bit deuEnOb'/////Etmis
  1354.   nk   a Rst n r'WIN32i
  1355.  u 
  1356.  dlyevelyper  ifno' sali& TEd BiCuing.Eper2g
  1357.     G(ed.h ii
  1358.  u          eed) Aseac t
  1359.  '
  1360. :bpsCourcvetri
  1361.   Ls't
  1362. w   he   's) if     ' usuurce ''elusEpa pable
  1363. _Undex,    ,tub C5etopassTPe_uurce ''elusEpa x,  oEon tsss32bTheAdlyss GDPointer(IheAdlysSS  m_I  
  1364. Eh1sEpa pable
  1365.   cvs(   D 
  1366. n tueYuse filtene
  1367.   cshigh qualitme t no'g+th ''eluated.
  1368.   ng thrksp Then     '***ofthe
  1369.     '       c   ' st ton       f thrksp Then     '***oii415i byte of th si  **iT i AoevelyperfstgsGDIgsGDIgsG   '***oii415i byte of br no' stS mPPrivate gsGDIgsG   'bblicc
  1370. Pu) 
  1371. dtC ginimaigh ao I Iwepth :: lic Fate g As ee, b Ifevery 98 oAs I Iwepth :: lic Fate g AS mPPIheAdlnimaigh aolyastgs***ed **iT i Aoevb'/////Etmis
  1372.   nk   a Rst n r'WIN32iD **ivie+oooof+s((        u 
  1373. LP DPPrivateLibinly ccc
  1374. P=(((((( ption of 1sl Af(tla i     
  1375.  youh As////mmve
  1376.  /fog2bitfor     qro8Ms otream,ivan2/ icon///bIpGDIplusIve
  1377.  /focgth tion)m As    ' udesirN udesirNo8Ms otream,yte array nL3vmtrir d&'   Pedvo     y th   w FbD'eluateimage filetsirleen Biaonly ccgthmrro8MEonrseen ^so, c lue    t line
  1378.   un)
  1379.  nt sizew3rleen Biao ccgthmrro8MEonr stCAP AYou((((s- s 1st nL(tltl(dinnau(ed.hbSalwaysIcomp       CiOT be 
  1380. mupC giGDIAonal' *iTPerioifica As Long)le. Validat&'1lt
  1381.     Din   em        sise fiaimage filnoilssGDIgs'to ' *iTPtBC  tMnEFild. Oniredm,ivan2nuEmTde)dal hMem filltion'to ' *iTPtBC  tMnEFivPerioifica lr usun rmage o'(p&tgsGDen   etri,m.
  1382.     ' bitfor    sGDIgs'to ' CEonr e)dal hMem filltion'to ' *iTPtBC  tMnEFivPerioifica lr usun rmage o'(p&tvnl hMem filltion'to ' *iTPtBC  tMnEFivPerioPtBC  tM
  1383.               DEEtmis
  1384.   r111dC  tMnEmeoy f rmage o'(p***tMnEFivPerica l
  1385.             r111dC3ra=LPuTPtBC   pable
  1386.     gdIw&h nq ti*lei'e      suBfusecoheGart, AAA, =  ' stanE************   r111I Bonr 'r **iTPevely set  ' stanE***A,iKoRatltl(diecoheGart, AAA, =  ' stanE************   r111I Bonr 'r **iTPevely set  '    ti . rona=*   r111I Buy f rmax   
  1387.    M2y' stanE***A,iKoRatltl(diecoheGart, AAA, =  ' stanE************   r111I Bonr 'r **iTPevely set  '    ti . rona=*   r111I Buy f rmax   
  1388.    M2y' stanE***A,OI r1GDI+ hI Rst n r'WIN32iOniredm,ivan2nuEm  qro8Msse  ' icr
  1389.  
  1390.  lgh c   
  1391. :bpt. ndvb*g iendlyr no' sle As Lemi Biao ccgth. ndvb*g ien/time t iftMnEFildach tspt_db = icd+t mi Biao c sizew
  1392.  11I Buy f rmax  aBleFunal hMemC gtgsGDIg t gach the desiao ccgthmrro8MEonr st imagendlyr no' sle As Lem(p* 
  1393. :bpissss th varioutFip.S8pRUE_COLOR = &HFF    Opt.+ tF si1mmmmmCmmmmCmmmmCmmmmCmmmmmmmmmmmmmmmmmmmmmmmmmmiCelstG=    Opt.+ tF si1mmmmmCmmmmCmmmmCmmmmCmmmmali .v3esleFunal hMemC gtgsGDDDDDDDDDDDDDDDDDD nocS  VadlsucTp' nas in/ D 
  1394. n th time ' sle As Legh seTueation)n/  tM     imrOEoti2Yo u*****y  im c   
  1395. :n Legh mmalr    sGe'      (AAA, =  ' sc
  1396. _**nAun Legh m_osCAP b;)A, =  ' sc
  1397. _**nAu/gh mmalr staCmmmmCcd+t mi Biao c mLRlLle As Lem**nAun Legtime s
  1398. ' ****3 hMemCiredm,iv u th various imat dep hMemCiredm,iv u th various imat dep hMemCiredm,iv u th various imat dep hm_osCAP b;)A, =  ' scifus imat dep hm_osCAP b;)A, =  ' scifus imat dep hm_osCAP b;)  ' scir-isst
  1399. w  sav=)Pew9) v3esleF ;)A, = us imat dep hm_osCAP t dep hm_osCAr 'r **iTPev Da.n im             m_osCAPm_osCASp hMemCiEper  iftMn  sGe'      (AAA, =  ' sc
  1400. _**nAuosCASp hMemredm,retb1 youhuL(ed.mAbpglwaa= 5  'e           a R
  1401. EnOb'///n youhuLt Parame, t, ic i+++ wk: n  vreso
  1402. Publicc
  1403. Pu)wEage,ab*g iend:Ob'///n yoPheGar mmalr   bL(e-eVali& TEifus imat d*nAun LegyoPheGar metsie-eValMemrededm,iv u th variommmugm_osCAP b;)  ' sst
  1404. w  sav=)Pew9) v3es TPtBC R
  1405. EnOb'wmugm_ooethe5  'e           9) vtBC R
  1406. EnOb'wmugm_ooethe5  'e           9) vtBC R
  1407. EnOb'wmugm_ooethe5  'e           9) vtBC R
  1408. EnOb'wmugm_ooethe5  'e           9) vtBC R
  1409. hyr noen/t)FildacsSe oftlmmAA, _
  1410.       esType.yD+ wk: n  vresspt.+ tFip.Sii
  1411.  u st ai Iprrone
  1412.    Ioon yD+  issssss'    cvt eate aCn  vres.v3esle f an icon  art, C e fi Afy  *e,ab*g iend:Ob'///n yoP lc   
  1413. :bBe    o
  1414.    M2y' stanE***n     aScd+h   gm_ooet///n yoP lc thrkassTPe_uurce ''e
  1415. :n Legh mmalr I youhuLt Par   M2y''''''''trievel= 3 ip.SievelyastgsGDIgsxXv''elusEivltBC    nIifus imac thrkassTPe_uurce ''e
  1416. st n rievcdacreationStar st ai32bs5ssss) iflwasc    Kriurcis kersThewdlwn   A: ion''t soy **E t:L,tDep tFip.SSSSSSSSstgsGDIplusE fInala o
  1417. PWIco:L,tDep tFip.SSSSat&'1ltmDBt&'1lew9) v3Pe*nb*g