VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "c32bppDIB"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
' COMPILE THE APPLICATION FOR BEST PERFORMANCE

' Credits/Acknowledgements - Thanx goes to:
'   Paul Caton for his class on calling non VB-Friendly DLLs that use _cdecl calling convention
'       http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=70195&lngWId=1
'   Carles P.V for his pvResize logic
'       Used when manually scaling images with NearestNeighbor or BiLinear interpolation
'   Carles P.V for his GIF LZW encoding routines. Used when saving to GIF
'       http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=45899&lngWId=1
'   Alfred Koppold for his PNG, VB-only, decompression routines. Used when zLib & GDI+ not available
'       http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=56537&lngWId=1
'   John Korejwa for his JPG, VB-only, encoding routines. Used when saving as JPG and GDI+ not available
'       http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=50065&lngWId=1
'   John Kleinen for example of a method of calling OLE class functions via API (See GetDroppedFileNames)
'       http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=49268&lngWId=1
'   Steve McMahon for his example on 24bpp to 8bpp palette reduction using oct trees
'       http://www.vbaccelerator.com/home/VB/Code/vbMedia/Image_Processing/Colour_Depth_Reduction/VB6_Colour_Depth_Sample.asp
'   www.zlib.net for their free zLIB.dll, the standard DLL for compressing/decompressing PNGs
'       Without it, we'd be limited to GDI+ for creating PNGs
'   coders like you that provide constructive criticism to make this class better & more all-inclusive
'       Without your comments, this project probably would have died several versions/updates ago
' For most current updates/enhancements visit the following. Last changed 10 Oct 08
'   Visit http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=67466&lngWId=1
' To see a usercontrol applying a version of this class
'   AlphaImage Control. http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=68262&lngWId=1
'   Image List Control. http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=69621&lngWId=1

' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
'                                    O V E R V I E W
' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
' AlphaBlend API :: (msimg32.dll) , GDI+ API (gdiplus.dll)

' About 32bpp pre-multiplied RGB (pARGB) bitmaps, if you are not aware.
'   - These are used specifically for the AlphaBlend API & are GDI+ compatible
'   - Only TGA directly identifies premultiplied pixels. Though they can exist in
'       PNG & BMP also, there is no flag saying: "Hey, I have premultiplied pixels"
'   - The following 4 formats can contain alpha channels: PNG, TGA, BMP, ICO
'   Advantages:
'       - Images can be per-pixel alpha blended
'       - Overall image opacity can be simultaneously adjusted during rendering
'       - AlphaBlend does both BitBlt & StretchBlt for pARGB images.
'       - Speed: AlphaBlend & GDI+ are pretty quick APIs vs manual blending
'   Disadvantages:
'       - The original RGB values are permanently destroyed during pre-multiplying
'           -- Premultiplied formula: preMultipliedRed=(OriginalRed * Alpha) \ 255
'           -- There is no way to convert pARGB back to non-premultiplied RGB values
'              The formula would be: reconstructedRed=(preMultipliedRed * 255) \ Alpha.
'               but because of integer division when pre-multiplying, the result is very
'               close and if this should be premultiplied again & converted again, the
'               calculated colors can eventually be completely different than the original.
'               Fully opaque pixels pixels are not affected. Any transparent pixel is
'               permanently destroyed & can never be returned. Its value becomes vbBlack
'           ** Note: When images are converted to other image formats for saving,
'               removal of premultiplication is performed to meet their specs.
'       - Displaying a pre-multiplied bitmap without AlphaBlend/GDI+ will not result in
'           the image being displayed as expected.
'       - Not ideal for saving due to its size: SizeOf= W x H x 4
'           -- better to save source image instead or compress the DIB bytes using favorite compression utility
'           -- with GDI+ or zLib, image can be converted to PNG for excellent reduced storage
'           -- Saving as a compressed TGA format generally provides very good file sizes
'       - AlphaBlend API is not included/compatible with Win95, NT4 and lower
'       - AlphaBlend on Win9x systems can be buggy, especially when rendering to DIBs vs DDBs

' Note that GDI+ is standard on WinXP+, and can be used on Win98,ME,2K & on NT4 if SP6 is installed
'   :: side note. I have actually used GDI+ on Win95 without problems; have not tried on NT4 SP5 or lower
' Download GDI+ from:
' http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdicpp/GDIPlus/GDIPlus.asp
' Download ZLib from: http://www.zlib.net

' ----------------------------------------------
' About Win95, Win98, WinME, NT3.5 & NT4 support
' ----------------------------------------------
' These routines may not honor AlphaBlend if it exists on those systems. Win98's version,
' for example, has several bugs that can crash the application when AlphaBlending to DIBs.
' NT4, NT3.5 & Win95 do not come with AlphaBlend and I do not have WinME to test with.
' Therefore, to support these older systems, the Render routine will alphablend manually
' regardless if the AlhpaBlend API exists on the older system or not. However, this can
' be overridden by you. See isAlphaBlendFriendly routine. Therefore, AlphaBlend is only
' reliable on Win2K and above. XP & above already have GDI+

' Class Purpose:
' ----------------------------------------------
' This class holds the 32bpp image. It also marshals any new image thru
' the battery of parsers to determine best method for converting the image
' to a 32bpp alpha-compatible image. It handles rendering, rotating, scaling,
' mirroring of DIBs using manual processes, AlphaBlend, and/or GDI+.

' There are several ways an image can be loaded
' 1. From filename (unicode supported) :: LoadPicture_File
' 2. From a byte array :: LoadPicture_Stream
' 3. From stdPicture object or VB's .Picture object :: LoadPicture_StdPicture
' 4. From VB's Resource file :: LoadPicture_Resource
' 5. From a memory image handle or VB's .Picture.Handle property :: LoadPicture_ByHandle
' 6. From the clipboard :: LoadPicture_ClipBoard
' 7. From file drag/drop's Data object (unicode supported) :: LoadPicture_DropedFiles
' 8. From Pasted files (unicode supported) :: LoadPicture_PastedFiles

' The parser order is very important for fastest/best results. See
' spt_LoadPictureEx how the routine marshals the image thru the parsers.
' cPNGparser :: will convert PNG, all bit depths; aborts quickly if not PNG
' cGIFparser :: will convert non-transparent/transparent GIFs; aborts quickly
' cICOpraser :: will convert XP-Alpha, paletted, true color, & Vista PNG icons
'               -- can also convert most non-animated cursors
' cBMPparser :: will convert bitmaps, wmf/emf & jpgs
' cTGAparser :: will convert TGA (Targa, TrueVision) images only
' As a last resort, when GDI+ exists, anything unable to be processed by the
' parsers (i.e., TIFFs) are sent to GDI+. If GDI+ can process the image, then
' the image will be converted, internally, to PNG to enable additional processing.

' The parsers are efficient. Most image formats have a magic number that give
'   a hint to what type of image the file/stream is. However, checks need to
'   be employed because non-image files could feasibly have those same magic
'   numbers. If the image is determined not to be one the parser is designed to
'   handle, the parser rejects it and the next parser takes over. Rejection occurs,
'   generally, in only a few lines of code. The icon parser is slightly different
'   because PNG files can be included into a Vista ico file. When this occurs, the
'   icon parser will pass off the PNG format to the PNG parser automatically.
' And last but not least, the parsers have no advanced knowledge of the image
' format; as far as they are concerned, anything passed is just a byte array.
' Relying on file extensions when available is unreliable

' Class Organization:
' ----------------------------------------------
' Search the class for the words NEW SECTION
' The class routines are organized in the following sections:
'   Class Initialization & Termination Routines
'   Public Properties & Methods (almost 60 and growing)
'       Public Read-Only Properties
'       Public Methods
'       Class to Class Communication Methods
'   Local Support Functions
' ----------------------------------------------

' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
'                                       CHANGE HISTORY
' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
' Accompanying Usage_c32bppSuite.rtf is updated with every change
' Last changed: 16 Feb 09. See change history within the RTF file
'   -- most noticable changes
'   :: fixed icon parsing class which can misparse icon masks
'   :: fixed cPNGreader class which could misparse grayscale png transparency
' 26 Dec 06: First version
' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

'._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
'   IMPORTANT FOR UPDATES/ENHANCEMENTS   IMPORTANT FOR UPDATES/ENHANCEMENTS
' -----------------------------------------------------------------------------
' NOTE TO SELF: Whenever any routine recreates the DIB (new DIB memory handle),
' a call to Set m_GDIplus = Nothing must be made before changes are applied. This is because
' when the optional KeepGDIplusActive property=True, GDI+ is wrapped around the DIB.
' Deleting the DIB and not releasing GDI+ can cause crashes or unexpected results.


' No APIs are declared public. This is to prevent possibly, differently
' declared APIs, or different versions of the same API, from conflicting
' with any APIs you declared in your project. Same rule for UDTs.
' Note: I did take liberties, changing parameter types, in several APIs throughout

' Used to determine operating system
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As Any) As Long
Private Type OSVERSIONINFOEX
   dwOSVersionInfoSize As Long
   dwMajorVersion As Long
   dwMinorVersion As Long
   dwBuildNumber As Long
   dwPlatformId As Long
   szCSDVersion As String * 128 ' up to here is OSVERSIONINFO vs EX
   wServicePackMajor As Integer ' 8 bytes larger than OSVERSIONINFO
   wServicePackMinor As Integer
   wSuiteMask As Integer
   wProductType As Byte
   wReserved As Byte
End Type

' APIs used to manage the 32bpp DIB
Private Declare Function VarPtrArray Lib "msvbvm60.dll" Alias "VarPtr" (ByRef Ptr() As Any) As Long
Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal Length As Long)
Private Declare Sub FillMemory Lib "kernel32.dll" Alias "RtlFillMemory" (ByRef Destination As Any, ByVal Length As Long, ByVal Fill As Byte)
Private Declare Function CreateCompatibleDC Lib "gdi32.dll" (ByVal hDC As Long) As Long
Private Declare Function GetDC Lib "user32.dll" (ByVal hWnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32.dll" (ByVal hWnd As Long, ByVal hDC As Long) As Long
Private Declare Function DeleteDC Lib "gdi32.dll" (ByVal hDC As Long) As Long
Private Declare Function SelectObject Lib "gdi32.dll" (ByVal hDC As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteObject Lib "gdi32.dll" (ByVal hObject As Long) As Long
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
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
Private Declare Function SetStretchBltMode Lib "gdi32.dll" (ByVal hDC As Long, ByVal nStretchMode As Long) As Long
Private Declare Function GetObjectType Lib "gdi32.dll" (ByVal hgdiobj As Long) As Long
Private Declare Function GetCurrentObject Lib "gdi32.dll" (ByVal hDC As Long, ByVal uObjectType As Long) As Long
Private Declare Function GetIconInfo Lib "user32.dll" (ByVal hIcon As Long, ByRef piconinfo As ICONINFO) As Long
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
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
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
Private Declare Function OffsetRgn Lib "gdi32.dll" (ByVal hRgn As Long, ByVal X As Long, ByVal Y As Long) As Long
Private Const STRETCH_HALFTONE As Long = &H4&
Private Const OBJ_BITMAP As Long = &H7&
Private Const OBJ_METAFILE As Long = &H9&
Private Const OBJ_ENHMETAFILE As Long = &HD&

' APIs used for fonts/text
Private Declare Function SetTextColor Lib "gdi32.dll" (ByVal hDC As Long, ByVal crColor As Long) As Long
Private Declare Function SetBkMode Lib "gdi32.dll" (ByVal hDC As Long, ByVal nBkMode As Long) As Long
Private Declare Function TextOut Lib "gdi32.dll" Alias "TextOutW" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, ByVal lpString As Long, ByVal nCount As Long) As Long
Private Declare Function GetTextExtentPoint32 Lib "gdi32.dll" Alias "GetTextExtentPoint32W" (ByVal hDC As Long, ByVal lpsz As Long, ByVal cbString As Long, ByRef lpSize As Size) As Long
Private Declare Function SetTextAlign Lib "gdi32.dll" (ByVal hDC As Long, ByVal wFlags As Long) As Long
Private Declare Function CreateFontIndirect Lib "gdi32.dll" Alias "CreateFontIndirectA" (ByRef lpLogFont As LOGFONT) As Long
Private Declare Function GetTextMetrics Lib "gdi32.dll" Alias "GetTextMetricsA" (ByVal hDC As Long, ByRef lpMetrics As TEXTMETRIC) As Long
Private Declare Function SetBkColor Lib "gdi32.dll" (ByVal hDC As Long, ByVal crColor As Long) As Long
Private Declare Function GetGDIObject Lib "gdi32.dll" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, ByRef lpObject As Any) As Long
Private Type Size
    cX As Long
    cY As Long
End Type
Private Type LOGFONT
    lfHeight As Long
    lfWidth As Long
    lfEscapement As Long
    lfOrientation As Long
    lfWeight As Long
    lfItalic As Byte
    lfUnderline As Byte
    lfStrikeOut As Byte
    lfCharSet As Byte
    lfOutPrecision As Byte
    lfClipPrecision As Byte
    lfQuality As Byte
    lfPitchAndFamily As Byte
    lfFaceName As String * 32
End Type
Private Type TEXTMETRIC
    tmHeight As Long
    tmAscent As Long
    tmDescent As Long
    tmInternalLeading As Long
    tmExternalLeading As Long
    tmAveCharWidth As Long
    tmMaxCharWidth As Long
    tmWeight As Long
    tmOverhang As Long
    tmDigitizedAspectX As Long
    tmDigitizedAspectY As Long
    tmFirstChar As Byte
    tmLastChar As Byte
    tmDefaultChar As Byte
    tmBreakChar As Byte
    tmItalic As Byte
    tmUnderlined As Byte
    tmStruckOut As Byte
    tmPitchAndFamily As Byte
    tmCharSet As Byte
End Type
Public Enum eTextAlignment
    TA_CENTER = 6
    TA_LEFT = 0
    TA_RIGHT = 2
    TA_RTLREADING = 256
End Enum
Public Enum AlphaTypeEnum
    AlphaNone = 0
    AlphaSimple = 1
    AlphaComplex = 2
End Enum

' APIs used to create files
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
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function GetFileSize Lib "kernel32.dll" (ByVal hFile As Long, ByRef lpFileSizeHigh As Long) As Long
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
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
Private Const INVALID_HANDLE_VALUE = -1&

' ////////////////////////////////////////////////////////////////
' Unicode-capable Drag and Drop of file names with wide characters
' ////////////////////////////////////////////////////////////////
Private Declare Function DispCallFunc Lib "oleaut32" (ByVal pvInstance As Long, _
    ByVal offsetinVft As Long, ByVal CallConv As Long, ByVal retTYP As VbVarType, _
    ByVal paCNT As Long, ByRef paTypes As Integer, _
    ByRef paValues As Long, ByRef retVAR As Variant) As Long
Private Declare Function lstrlenW Lib "kernel32.dll" (lpString As Any) As Long
Private Declare Function GlobalFree Lib "kernel32.dll" (ByVal hMem As Long) As Long

' ////////////////////////////////////////////////////////////////
' Unicode-capable Pasting of file names with wide characters
' ////////////////////////////////////////////////////////////////
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
Private Declare Function OpenClipboard Lib "user32.dll" (ByVal hWnd As Long) As Long
Private Declare Function GetClipboardData Lib "user32.dll" (ByVal wFormat As Long) As Long
Private Declare Function CloseClipboard Lib "user32.dll" () As Long
Private Type FORMATETC
    cfFormat As Long
    pDVTARGETDEVICE As Long
    dwAspect As Long
    lIndex As Long
    TYMED As Long
End Type
Private Type DROPFILES
    pFiles As Long
    ptX As Long
    ptY As Long
    fNC As Long
    fWide As Long
End Type
Private Type STGMEDIUM
    TYMED As Long
    data As Long
    pUnkForRelease As IUnknown
End Type
' ////////////////////////////////////////////////////////////////


' used to create the checkerboard pattern on demand
Private Declare Function FillRect Lib "user32.dll" (ByVal hDC As Long, ByRef lpRect As RECT, ByVal hBrush As Long) As Long
Private Declare Function CreateSolidBrush Lib "gdi32.dll" (ByVal crColor As Long) As Long
Private Declare Function OffsetRect Lib "user32.dll" (ByRef lpRect As RECT, ByVal X As Long, ByVal Y As Long) As Long
Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type

Private Type SafeArray
    cDims As Integer
    fFeatures As Integer
    cbElements As Long
    cLocks As Long
    pvData As Long
    rgSABound(0 To 3) As Long ' reusable UDT for 1 & 2 dim arrays
    ' array items: 0=1D item count, 1=1D LBound, 2=2D item count, 3=2D LBound
End Type

Private Type ICONINFO
    fIcon As Long
    xHotspot As Long
    yHotspot As Long
    hbmMask As Long
    hbmColor As Long
End Type
Private Type BITMAPINFOHEADER
    biSize As Long
    biWidth As Long
    biHeight As Long
    biPlanes As Integer
    biBitCount As Integer
    biCompression As Long
    biSizeImage As Long
    biXPelsPerMeter As Long
    biYPelsPerMeter As Long
    biClrUsed As Long
    biClrImportant As Long
End Type
Private Type BITMAPINFO
    bmiHeader As BITMAPINFOHEADER
    bmiPalette As Long
End Type

Private Enum eOScapability
    osAlphaBlendUsable = 1  ' then AlphaBlend enabled & used when needed
    osGDIplusUsable = 2     ' then GDI+ enabled & used when needed (set in isGDIplusEnabled)
   'oszLIBusable = 4        ' then zLib enabled & can be used to create/read PNGs (no longer used, tested as needed)
    osWin2KorBetter = 8     ' AlphaBlend capable system else it isn't for these classes. See isAlphaBlendFriendly property for more info
    osWin98MEonly = 16      ' Win98 or WinME. When m_OScap includes osWin98MEonly+osAlphaBlendUsable then user overrode isAlphaBlendFriendly
    osGDIplusNotAvail = 32  ' then NT4 w/less than SP6 or Win95. Otherwise system is GDI+ capable else it isn't
    osIsNT = 64             ' NT-based system. Unicode compatible
End Enum

Public Enum eImageFormat    ' source image format
    imgError = -1  ' no DIB has been initialized
    imgNone = 0    ' no image loaded
    imgBitmap = 1  ' standard bitmap or jpg
    imgIcon = 3    ' standard icon
    imgWMF = 2     ' windows meta file
    imgEMF = 4     ' enhanced WMF
    imgCursor = 5  ' standard cursor
    imgBmpARGB = 6  ' 32bpp bitmap where RGB is not pre-multiplied
    imgBmpPARGB = 7 ' 32bpp bitmap where RGB is pre-multiplied
    imgIconARGB = 8 ' XP-type icon; 32bpp ARGB
    imgGIF = 9      ' gif; if class.Alpha=AlphaSimple, then transparent GIF
    imgPNG = 10     ' PNG image
    imgPNGicon = 11 ' PNG in icon file (Vista)
    imgCursorARGB = 12 ' alpha blended cursors? do they exist yet?
    imgCheckerBoard = 64 ' image is displaying own checkerboard pattern; not a true image
    imgTGA = 128    ' if alpha<>AlphaNone, then transparent TGA
End Enum

Public Enum ePngProperties      ' following are recognized "Captions" within a PNG file
    pngProp_Title = 1           ' See cPNGwriter.SetPngProperty for more information
    pngProp_Author = 2
    pngProp_Description = 4
    pngProp_Copyright = 8
    pngProp_CreationTime = 16
    pngProp_Software = 32
    pngProp_Disclaimer = 64
    pngProp_Warning = 128
    pngProp_Source = 256
    pngProp_Comment = 512
    ' special properties
    pngProp_Miscellaneous = 1024 ' this is free-form text can be of any length & contain most any characters
    pngProp_DateTimeModified = 2048  ' date/time of the last image modification (not the time of initial image creation)
    pngProp_DefaultBkgColor = 4096   ' default background color to use if PNG viewer does not do transparency
    pngProp_FilterMethod = 8192        ' one of the eFilterMethods values
    pngProp_ClearProps = -1     ' resets all PNG properties
End Enum

Public Enum eTrimOptions    ' see TrimImage method
    trimAll = 0             ' can be combined using OR
    trimLeft = 1
    trimTop = 2
    trimRight = 4
    trimBottom = 8
End Enum

Public Enum eScaleOptions   ' See ScaleImage method
    ScaleToSize = 0         ' [Default] will always scale
    scaleDownAsNeeded = 1   ' will only scale down if image won't fit
    ScaleStretch = 2        ' wll always stretch/distort
End Enum

Public Enum eGrayScaleFormulas
    gsclNTSCPAL = 0     ' R=R*.299, G=G*.587, B=B*.114 - Default
    gsclCCIR709 = 1     ' R=R*.213, G=G*.715, B=B*.072
    gsclSimpleAvg = 2   ' R,G, and B = (R+G+B)/3
    gsclRedMask = 3     ' uses mostly the Red sample value: RGB = .8Green,.1Red,.1Red
    gsclGreenMask = 4   ' uses mostly the Green sample value: RGB = .1Red,.8Green,.1Red
    gsclBlueMask = 5    ' uses mostly the Blue sample value: RGB = .1Red,.1Red,.8Blue
    gsclRedGreenMask = 6 ' uses Red & Green sample value: RGB = .45Red,.45Green,.1Blue
    gsclBlueGreenMask = 7 ' uses Blue & Green sample value: RGB = .1Red,.45Green,.45Blue
    gsclNone = -1
End Enum

Public Enum eFilterMethods
    filterDefault = 0     ' paletted PNGs will use filterNone while others will use filterPaeth
    filterNone = 1        ' no byte preparation used; else preps bytes using one of the following
    filterAdjLeft = 2     ' see cPNGwriter.EncodeFilter_Sub
    filterAdjTop = 3      ' see cPNGwriter.EncodeFilter_Up
    filterAdjAvg = 4      ' see cPNGwriter.EncodeFilter_Avg
    filterPaeth = 5       ' see cPNGwriter.EncodeFilter_Paeth
    filterAdaptive = 6    ' this is a best guess of the above 4 (can be different for each DIB scanline)
End Enum

Public Enum eRegionStyles     ' See CreateRegion
    regionBounds = 0
    regionEnclosed = 1
    regionShaped = 2
End Enum

Public Enum eConstants      ' See SourceIconSizes
    HIGH_COLOR = &HFFFF00
    TRUE_COLOR = &HFF000000
    TRUE_COLOR_ALPHA = &HFFFFFFFF
End Enum

Private m_Tag As Variant            ' user-defined, user usage only. See TAG property
Private m_PNGprops As cPNGwriter    ' used for more advanced PNG creation options
Private m_StretchQuality As Boolean ' if true will use BiLinear or better interpolation
Private m_Handle As Long        ' handle to 32bpp DIB
Private m_Pointer As Long       ' pointer to DIB bits
Private m_Height As Long        ' height of DIB
Private m_Width As Long         ' width of DIB
Private m_hDC As Long           ' DC if self-managing one
Private m_prevDCobject As Long  ' object deselected from DC when needed
Private m_osCAP As eOScapability ' See eOScapability enumeration above
Private m_Format As eImageFormat ' type of source image
Private m_ManageDC As Boolean   ' does class manage its own DC?
Private m_AlphaImage As AlphaTypeEnum ' does the DIB contain alpha/transparency?
Private m_GDItoken As Long      ' GDI+ token when GDI+ is initialized
Private m_ImageByteCache() As Byte  ' should you want the DIB class to cache original bytes
' ^^ N/A if image is loaded by handle, stdPicture, or resource

Private m_GDIplus As cGDIPlus   ' maintains GDI+ instance to speed up drawing
Private m_KeepGDIplusActive As Boolean ' see KeepGDIplusActive property

' NEW SECTION *******************************************************************************
'                   CLASS INITIALIZATION & TERMINATION ROUTINES
' *******************************************************************************************

Private Sub Class_Initialize()

    ' Determine operating system for compatibility of 32bpp images
    ' http://vbnet.mvps.org/code/helpers/iswinversion.htm
    ' http://msdn2.microsoft.com/en-gb/library/ms724834.aspx
    
   Dim osType As OSVERSIONINFOEX
   Const VER_PLATFORM_WIN32_WINDOWS As Long = 1

   ' Retrieve version data for OS.
   osType.dwOSVersionInfoSize = Len(osType)
   If GetVersionEx(osType) = 0 Then
      ' The OSVERSIONINFOEX structure is only supported
      ' in NT4/SP6+ and NT5.x, so we're likely running
      ' on an earlier version of Windows. Revert structure
      ' size to OSVERSIONINFO and try again.
      osType.dwOSVersionInfoSize = Len(osType) - 8
      Call GetVersionEx(osType)
   End If
   
    If osType.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS Then

        If osType.dwMinorVersion = 0 Then ' Win95; can't use AlphaBlend nor GDI+
            m_osCAP = osGDIplusNotAvail   ' fyi. I copied gdi+ onto win95 & it worked! but is it trustworthy

        Else ' flag as Alphablend disabled, but capable & is Win98/ME
            m_osCAP = osWin98MEonly
        End If

    Else

        If osType.dwMajorVersion > 4 Then ' if Win2K or better
            m_osCAP = osAlphaBlendUsable Or osWin2KorBetter ' flag as AlphaBlend enabled (Win2K or better) and capable

        Else ' WinNT4. If SP6 or better than GDI+ capable else not. Regardless, not AlphaBlend capable
            If osType.wServicePackMajor < 6 Then m_osCAP = osGDIplusNotAvail
        End If
        m_osCAP = m_osCAP Or osIsNT

    End If

    ' Note for programmers:  To test the spt_Win9xBlend function on systems with GDI+
    ' 1. Unrem next line
    '   m_osCAP = osGDIplusNotAvail
    ' 2. Rem out the next two lines
    Me.isGDIplusEnabled = True  ' attempt to start GDI+, test system capability, add osGDIplusUsable to m_OScap
    If Me.isGDIplusEnabled Then Me.HighQualityInterpolation = True
    
    m_Format = imgError

End Sub

Private Sub Class_Terminate()
    DestroyDIB ' simply clean up
End Sub

' NEW SECTION *******************************************************************************
'                           PUBLIC PROPERTIES AND METHODS
' *******************************************************************************************


Public Property Let Alpha(ByVal AlphaType As AlphaTypeEnum)
    m_AlphaImage = AlphaType  ' determines the flags used for AlphaBlend API
    ' this flag is set by the various image parsers; setting it yourself
    ' can produce less than desirable effects.
End Property
Public Property Get Alpha() As AlphaTypeEnum
    Alpha = m_AlphaImage
End Property

Public Property Let HighQualityInterpolation(Value As Boolean)
    ' When possible GDI+ will be used for stretching & rotation.
    ' If GDI+ is used,then high quality equates to BiCubic interpolation
    ' If not used, then BiLinear (manual processing) will be used.
    ' If High Quality is false, then Nearest Neighbor (very fast, less quality) interpolation used
    m_StretchQuality = Value
End Property
Public Property Get HighQualityInterpolation() As Boolean
    HighQualityInterpolation = m_StretchQuality
End Property

Public Property Get ImageType() As eImageFormat
    ImageType = m_Format    ' returns image format of the source image
End Property
Friend Property Let ImageType(iType As eImageFormat)
    m_Format = iType    ' set by the various image parsers. This is not used in decision making
    ' anywhere in these classes, you can do with it what you want -- for now.
End Property

Public Property Let ManageOwnDC(bManage As Boolean)
    ' Determines whether or not this class will manage its own DC
    ' If false, then a DC is created each time the image needs to be Rendered
    Dim tDC As Long
    If bManage = False Then     ' removing management of DC
        If Not m_hDC = 0& Then   ' DC does exist, destroy it
            ' first remove the dib, if one exists
            If Not m_Handle = 0& Then SelectObject m_hDC, m_prevDCobject
            m_prevDCobject = 0&
        End If
        DeleteDC m_hDC
        m_hDC = 0&
    Else                        ' allowing creation of dc
        If m_hDC = 0& Then        ' create DC only if we have a dib to put in it
            If Not m_Handle = 0& Then
                tDC = GetDC(0&)
                m_hDC = CreateCompatibleDC(tDC)
                ReleaseDC 0&, tDC
            End If
        End If
    End If
    m_ManageDC = bManage
End Property
Public Property Get ManageOwnDC() As Boolean
    ManageOwnDC = m_ManageDC
End Property

Public Property Get isAlphaBlendFriendly() As Boolean
    isAlphaBlendFriendly = ((m_osCAP And osAlphaBlendUsable) = osAlphaBlendUsable)
    ' WinNT4 & below and Win95 are not shipped with msimg32.dll (AlphaBlend API)
    ' Win98 has bugs & would believe that WinME is buggy too but don't know for sure
    ' Therefore, the Rendering in this class will not use AlphaBlend on these
    ' operating systems even if the DLL exists, but will use GDI+ if available
    ' Can be overridden by setting this property to True
End Property
Public Property Let isAlphaBlendFriendly(Enabled As Boolean)
    ' This has been provided to override safety of using AlphaBlend on Win9x systems.
    ' Caution. Only set this when rendering to a known device dependent bitmap (DDB)
    ' Alphablend can crash when rendering DIB to DIB vs DIB to DDB. Be warned.
    If Enabled = True Then
        ' Overriding in play: allow AlphaBlend if system is Win98 or better
        ' By default this is already set for Win2K or better
        If ((m_osCAP And osWin2KorBetter) = osWin2KorBetter) Then
            m_osCAP = m_osCAP Or osAlphaBlendUsable
        ElseIf ((m_osCAP And osWin98MEonly) = osWin98MEonly) Then
            m_osCAP = m_osCAP Or osAlphaBlendUsable
        End If
    Else
        m_osCAP = m_osCAP And Not osAlphaBlendUsable ' disallow AlphaBlend
    End If
End Property
Public Property Get isGDIplusEnabled() As Boolean
    ' identifies if GDI+ is usable on the system.
    ' Before this property is set, GDI+ is tested to ensure it is usable
    isGDIplusEnabled = ((m_osCAP And osGDIplusUsable) = osGDIplusUsable)
End Property
Public Property Let isGDIplusEnabled(Enabled As Boolean)
    ' Sets the property. If set to False by you, GDI+ will not be used
    ' for any rendering, but still may be used to create PNG/JPG files if needed
    
    ' You can reset it to true at any time. If the system won't support
    ' GDI+, then the True setting will simply be ignored -- no harm, no foul
    ' To test success:  c32class.isGDIplusEnabled=True: If c32class.isGDIplusEnabled=True Then ' success
    
    If Not Enabled = Me.isGDIplusEnabled Then
        m_osCAP = (m_osCAP And Not osGDIplusUsable)
        If Enabled Then
            If (m_osCAP And osGDIplusNotAvail) = 0 Then ' else Win95, NT4 SP5 or lower
                Dim cGDIp As cGDIPlus
                If m_GDIplus Is Nothing Then
                    Set cGDIp = New cGDIPlus
                Else
                    Set cGDIp = m_GDIplus
                End If
                If cGDIp.isGDIplusOk() = True Then m_osCAP = m_osCAP Or osGDIplusUsable
            End If
        End If
    End If
End Property

Public Property Let gdiToken(Token As Long)
    ' Everytime a GDI+ API function is called, the class calls GDI+ apis to
    ' create a GDI+ token first then destroys the token after the function is called.
    
    ' This occurs quite often. However, you can create your own token by calling
    ' GdiplusStartup and then passing the token to each class for the class to use.
    ' You would call GdiplusShutdown during your main form's Terminate event to
    ' release the Token.
    
    ' When Token is zero, the classes will revert to creating a token on demand.
    ' When the Token is not zero, any other DIB class created internally by this class will
    ' pass the token as needed. The only routine that can create a new instance externally
    ' and returns that new instance is the CreateDropShadow method. You must set the
    ' token for that class at some point for that dropshadow class to use the token.
    
    If m_KeepGDIplusActive Then Set m_GDIplus = Nothing ' remove; may be referencing old token
    m_GDItoken = Token
    
End Property
Public Property Get gdiToken() As Long
    ' returns the GDI+ token if one was created
    gdiToken = m_GDItoken
End Property

Public Property Let Tag(vValue As Variant)
    On Error Resume Next
    If IsObject(vValue) Then Set m_Tag = vValue Else m_Tag = vValue
End Property
Public Property Set Tag(vValue As Variant)
    Me.Tag = vValue ' use the object check in the Let property
End Property
Public Property Get Tag() As Variant
    If IsObject(m_Tag) Then Set Tag = m_Tag Else Tag = m_Tag
End Property

' This setting will keep the current cGDI+ class active which
' prevents destroying the GDI+ hImage and Token objects.  This
' can speed up rendering. This option SHOULD NOT be set when the
' class is not compiled. Else crashes will happen when
' user hits END or VB toolbar's STOP button while in IDE
Public Property Get KeepGDIplusActive() As Boolean
    KeepGDIplusActive = m_KeepGDIplusActive
End Property
Public Property Let KeepGDIplusActive(keepActive As Boolean)
    m_KeepGDIplusActive = keepActive
    If keepActive = False Then
        Set m_GDIplus = Nothing
    ElseIf Me.isGDIplusEnabled = False Then
        ' can't set to True if GDI+ not installed
        m_KeepGDIplusActive = False
    End If
End Property


' NEW SECTION *******************************************************************************
'                               PUBLIC READ-ONLY PROPERTIES
' *******************************************************************************************

Public Property Get Width() As Long
    Width = m_Width     ' width of image in pixels
End Property
Public Property Get Height() As Long
    Height = m_Height   ' height of image in pixels
End Property
Public Property Get BitsPointer() As Long
    BitsPointer = m_Pointer ' pointer to the bits of the image
End Property
Public Property Get scanWidth() As Long
    scanWidth = m_Width * 4lT'o the bits of the immage
End Pr Else Tag' sta[herefo is not zero, any other DIB class created internally by this class will
    ' pass the token as needed. The ernally by trnallyointer tyby thid
Private mesivate mesivate mesivate mesivate mesivate mesivate mesivate mesivate mesivate mesivate mesivate mesivate mesivate mesivate mesivate mesivate mesivate mesi1;&vate mesivatong, _
    ByVa we'riLong)e next ityInterpola!riLong)e next ityInterpola!riLong)e next iMkterpola!riLong)e next ityInterpw=me  Me.isGext ityon Winroperty
End Propbe Create, & Vikkterp0hen rendering to a known device dependent bitmap (DDB)
    ' Alphablend can crash when rendering DIB to DIB vs DIB to DDB. Be warned.
    If Enabled = True Then
        ' Overriding in play: allow AlphaBlend if system is Win98 or b***************almoststem won't support
    ' GDI+, then the True setting will simply be ignored -- no harm, no foul
haBlend on thesv********otime  DIB class ransparAoTlphaBlend if syivat1end on the,HivatesivapMe.Highesvlpers/olean)
    ' When pos Properixb<B vs si(r conla!riLonHighesN-&
End Propertncti, B=B*.r = m_P which
Rss mannnnnnnnnnnnn Regy If Enabledsi(r conla!riLonHig    = 1

   'phaBlend if syich kt(XlcAs Boolean)
 on Winroperty
End P = Toky         e Next    = 1

   'phaBlend if syich kt(XlcAfor fontperty
End P =r'mmt GIF
operty
mTn misolation = m_Strer As BITMAPl happen when
rriding inext can be of any length & contain most a  tl ' f,m Toky      vate mN',ls class manat GIF
operty
mTnknown devikPublic Proht = 4
PI contaanat G gsclRedGreenMasktentPoint32Wtoken as needed. Theertien needed
Privanual proce If
   
    If osType.dTededend if syivat1end on the,Hivatesiv****otime  DIB class rst Neighbor (oriend on the,Hivatesiv****o) LongF'phaBlend if syich2v***our (iend o= m_Tag Elsescription = 4YtDrop As Lonpvarioushendering CAP Or&vYgsclNTSCPALd Win95 u can reove
Pt gdiToken(TogdiToC        m_osCAP Tag()m_Strer As m_osCAP Tag()m_Strer' OverrihaBl
   nd on the,Hi mply be ignored -- no harm, nNT FOR UPDATm, nNT End P = Toky         This option SHOuhe last i   eX        en
rridn
rridn
se ias) aren render    v***og)e next i= vValue Else m_Tag = Else rVersion ////(ed syst  m_Managin play: allow Alphi If
   vThen     Height = m_mply be igs AlphaTypeEnum
(yVal wFlags ?(i****o) L m_mply be igs AE re(ntaan Asal proinorVersion As Long
   dwAs LOGFONTAs Long
iothing
ro**otime  DIB class ransparAoTlphaBlend ////(ed syst  En ' When TaparAoTlpsioext iMkterpola!riLong)e nnnnnnnnnnnnnnnnnnnnnnng
ro**tion = 4YtDrop eset by the various imsed to cre vari-1PubliTm, nokte"gdi3o////////nnnnnng   ' sizm class rst As Long, Byring in this class wi
mTnng,F
operty
mTn misolation = m_Strer As BITMAPl happen when
rriding inext can  be of any length & contain most ao connd ///ng, Byring in this clItIndirec
End Properse Then
   ointer() As  Long, Byring in this class wi
mTnng,F
ope= True Then
        ''''nsparAoTlphaBlend /i
mTnng,=)
    ' WheE will
    ' paonnd ///,F
o= True Then
     bled = True Then
        ' Ov   ' If nlare Funcs Properixb<B vs si(r conla!Hiotb<B vb imsed  Iftb<B vb imsight   ab<B vb imsight   ab<B Propern
     IivatesivapMe.Highesvlperpoint forivapMe.Highesed  Iftb<B vb imsight   ab<B vHXpMe.sageTperpoint forivapMe.Highesed  Iftb<B vb imsight  &n a DC 
rridn then deive(kee98/ME
           lRedGre   'ppen whenerty
Public Propertrivate Declasbriko= True Then
     bled /Arridn
se ias) aCPpfTrue Thmbetter) and capable
deasbriko= _g)
    ' Everytime a GDI+ API function
   vs si(r cken as needed. TheeX---------------------- API function
t i   ned to
si(rbetter)oB******' returns F deive(kee98/ME
           lRedGre   'ppen whenerty
Public Propertrivate Declasbriko= True Then
     bled /Arridn
se ias) aCPpfTrue Thmbetter) and capable
deasbriko= _g)
    ' Everytime a GDI+ API function
   Iftb<B vb imsight   ab<B vbed
Pd on the,Hivatesiv****o,Hivatbunction
PI funcnctm class rst = 5    eclao/iidth As Long
  srd capable
deasbusEnabled = ((m_osesivnn
PI funcnctm, or reeeeeeee functt GIF
operty osGr lower
      iXdR set teI ong
    t8_operg old' If nl?Bd-<B  & MePublic Peasbusp (DD on the,Hivatesiv*Bng iEnd PrgdiToken(TogdiToC -ro**tion .eas   lRedGEnabled = True Then
Hivatuncnctm, ort   ab
PIproce If
  ignored Yo
    If osType.d***********PI funcnctm, or     = 1

 ur (iersa  ab
Plnl?D DIbject check in the Leteeeeeee functt GIF
oetter
  check in the Leteeeeeee functt ///
'eeee ro  If osTypecheck in the DIB      End Iirt   ab
can dot KeepGDIplusActer
  i
mTbled /Arrihe Lhmbettn*******4      uGDIplAs Byte
e valuettnpKP,  Iftb<B vb imsight   ab<B vbed
Pd on the,Hivatesiv****o,Hivatbunctive = False
    E0aaaaaaaaaaaaaaaaat temIES
' *ysioee Then
     blele Then
Hivatuncc ThenD DIbI
operty osGr lowed = True Then
Hing   ' sThen
  BiToken cre vari-1Publ    ' first remove esiv***
    ******s)tlperpointLet isA Property
e3pb<B vb imr.tadig  lRedG' sThen
 vb 1etti      a.snMaskteg**tion s,uBave a dee imr.tadi"nctt GI,Ol0c
   Iftbster)oB*iToken(TogdiToC -ro**tion .eas       Iftbster)oB*iToken(Togl    OOOOOOOOm, or     = 1

 ur (ie in the DIB*
    ******rrihe Lhmben, 1
o= Nots Lonas been provided to override safety of using Anp***eCong
rab<B terp0hene i be igs AE re(nt****************************************************
'        th & contain most ao connd ,   regionEnclosed = 1
    eOSost ao conneas       Iftbster)oB*iToken(Togl    OOOOOOOOm, or     = 1

 ur (ie in
PI funcnctm class rst = 5    ecc   ******s)Ot sT Else ' flag as Alphablep ecc   *sty oimsight   ab<B vbed
Pd on the,Hivatesiv****o, function
t i   ned to
si(rbeXx.2te
End n(Togl    OOOO        at   ab<B      aty oimsightig  Sr (ie in the csivate T be set when the
' class is not compicr that ite
   in the ao connd ,   rea9lityInterY As Long, ByVc*************
'   oBe warn  E0aaaaaaaaaaaaaaaaat temIES
' *ysioee Then
     blelDn if tusNotAvail   ' fyc*****ridn
blic(blic(Be warn  EuFeatures As Integer
    cbElements pIf tmgIconARGB = If nl?Bd-<B  & MePublier)oB*i**o, function
t i   ned to
si(rbeXx.2te
End n(Togl    OOOO        at   ab<B      aty oimsigh    b<B      aty oi   b<B      a
o= m= m_GDIbsterepfTrue Tterpolation g
   dwAs LOGFO=yring in this +,cusingu****otime  DIB class ransparAoTlphaBlend if syivat1end on the,Hyy Me.isGDI, DIB vs n a DC ts pIf  = 1
l1 DIB vsSaan lDI, DIB vs n a DC ts pIf  = 1nHeightSrc As Long,se cSaan lDDDDDDDDDDDDDDDDDDDDDDDDDt GIF
opert lDDDDD***s)Ot sT Else ' flag as not compicr that ite
   in the ao coDIB vs n a DC ts pIf  = 1
<polatiocombined2nDCobjecty (ble elsive(kee9mes     ' See Cre eand capable
de ' f     ' See / one of nHeigined2nDCis  perg old' Ifbrabl has been provideublic Propthi nd Pro olen
     boalse Then
 ****aoB*lAs  if syiv.qolen
 ' Then
 s
     blelDn if annnnnnnyyyyyyyyyyynter = mEter)oB*iToken(Togl      blel

 ur rman(TogyyyyyyyyynaIg
haBlend If oIRa,Dn if annnnnnnyyyyyyyyyyynter = mEter)oB*iToken(Togl   f oIRa,Dn  (Frd capable
deuqannnnnnnymotDC 
rr;oe Declare(,f re9ter
 -ll ARoe DecP Tag()m_Strer' OverrihaBl
   nd'        OOOO        SsSSub Class_Initialia DC ts pIf  = 1nHeight W re9os= mEtminorVersion As Long
   dwAseded. Theertri' i   nu   gsclGreenMask = 4   ' ' firt As ******lend DTw activewail   ' fyc***bso2,Dngl      blel

 urblic Pro*on As LoIB vs n a DC ts As ***rt As *****0t ite
  5bt**led = True&  = 1
<pqolen
**bso2,functt   AlphaSimpldelsnnnnyyDest As Long, ByVal nWe DecP T be igs Alph blels Alps Me.Tagr1:haBl
   ndEter)oB*iToken(-ion s,uB= 2   ts pIf  =   **oThen
eivers/iswlass_Initiallllllllllllllll class at s(lean)
     Nex(lean)
     Nex(lean)
Ifbrs pIf= False
    End If
0Td.
    
T
Pu t GIF
(1
Public Property Lenu-  at s(lea vs Rendered
 an)
   End Pr lde  = 1nHeightSrhA
PublXe vari-1Publ    ' first remove esiL8yyy
   dwAsnd Property
Friend PrTypecheckbz set wheken(Togded(EnableDCis  perg osf annnnnnn T be igs A removeo  ' See cPN4;=yring in this +,cusiEnableThi0& Then   ' DC does existD;=yring in tVgIconARGB =n the
' class in this +,cusiEnabC, m_prex. Tgpressio any rendering, butt GI5e bits of the i****' rdle = 0& Then
tTTTTTTT  Iivate,3ss in this +,cusiEnabC, m_prex. TgpressSee c regionEn Toky       
    
Tg old'osType.oiEnabC, onEn Toky       
    
Tg o =   **oThen
eigined)ehen
eigined)Ce)
        Iflreadter)oB*iTok m_KeepGDIplusActive A*********PI funcgdi32.dhekenthe i****' rdle

Publbwn devGPToky ate      s +,cusiB ttit is)  *********P  = 1nHeightSrwn c0 Then
(Togded(EnableDCis  perg oerepuThenhaTypeEnned)CamEter)oB*i0DIB cG filctionFSepfTrue Tterpolation g
   dwAs LOGFO=yring in this +,cusingu****eiginemv      s +,cusiB ttems.
Y+s(lea vsi****' rtolation g
emv    and capable
de en' Eve<B vb imsight   ab<B vHXpMe.sageTperpo4aXpMe.sageTpefety of EEageTpefety ProperT=Blend ifhodate,3ss in this +,cusiEnabC, m_prcusiEnabiB ttems.
Y+s(lea vsi****'g, ByVal nWecded(Enabdv    and capab' flag as notywAs LOGFO=yrmtrsion pre-multipliring in this + biB sftialofor that dropshadow class to use the ttroy i = 1 DC ts pIf  = 1nHTypeEn functt //rTmage
    imgPNGicl = 1 DC ts pInnnnnnymnotywA vb im     aty  aty ed = 1
 osW;Property Let isGDIplusEnable0'st wheken(Togded(leDC(tDC)
ass ay ed =pCis  perg ovb imsight   ab<B PrIeSD below anhaImage As Alpha' Ever,ass at s(lean)
     Nex(lean)
   otAb imsL'rI)
   otAb imsL'rI)
   otAb imsL'rI)
  eo  ' SeOLOR_ABeightSrwn c0 Then
(Togded(EnableDCis  perg e= 6
    ' Thooooooooooooooooe
    lf********ge As AlOvsi**nCharWidth As Long
    tmperg e= 6
s Long
tmperg e= 6
s Long
tmperg e= 6
s Long
tmperg e= 6
sert lDDDGHeightSrwn c0 Tperg e= 6
silseIf Me.iidi0             = 1nHand ca(Beeeeee
' 2       B cG filll class aosDGHeiAs Variant)
    Me.Taee
' 2  d  I e= 6
s Lpi    B cG filll clasd(leDC(t   'i Long
 1fTn6 or Win95R      s +B otAb ele S******************************************
'  FRn c0 Then
(Togded(EnableDCis  pergto
si(rbvate   Iftbster)oB*1iEnableThi0& Theed
  EnablB
Prrtri' i   nu   gscl"(verhang lencTheed
.l"(verhanw cla D  gscl"bg e= 6
s Long
tmperg e= 6
s Long
tmperg e= 6
sert lDDDGHeightSrwn c0 Tperg e= 6
silseIf Me.iidi0             = 1nHand ca(Beeeeee
' 2       B cG filll class aosDGHeiAs Variant)
    Me.Taee
' 2  d  I e= 6
s Lpi    B cG filll clasd(leDC(t   'i Long
 1filll cl
s Lpi    B cG filll clasd(leDC(t   'i Long
 1filll cl
s Lpi    B cG filll claslic Pilll clasd(leDC(t   'i Long
 1filll cl
s Lpi    B cG filll claslic Pilll clasd(Me.ii5Dlasli  B e= 6
s Lpovb imsight   ab<B PrIeSD b(EnableDCisalia DC ts pIf  = zed
  = 12 ' Falsilll cl
s Lppeaaaaapable
de ' f DC ts pI f DC ts pI f DC ts pI f DC ts pI f DC ts pI f DC ts pI lsilll c DC ts m_dsd(leDC(t   'U(leDCeiAs Variant)
 
 1filll cl
s Llyo=tesiv**--------------DC ts pI le (VistHevrt As ***q0 le (VisIie m_G' class  ts pI f DC ts pI lsilll c DC ts m_dsd(leDC(t   'U(leDCeiAs Variant)
 
 1fill Long
b 
 1fill Long
bU(leDCeiAs Variant)
 

(Togdegu****otime t
 1fill Lo
 
 1fill Long
b 
 1fill Long
bU(leDCeneur rmano = t
 1fill Lo
 
 1fill Long
b 
 1fill Lonvate Type S(VistHevrt As ***q0 le (VisI,3ss ''''''''lass  tLieex. Tgpreaswlass_ing
tmswlass_ing
tmswlass_ingu****oteDCeiANi_*nCharW
    ' gu****otime t
 1fgPNGicl = 1 D pGean)
     Nex(lean)
   otAb ****otsscsl(***********C 
 1fil
    filterPaeth =I********P derg ovb imsigh---------DC ts pI le (Vis********aelieve thb---a DC 
rridn th*P derg ovb imsigh----Fgion
me  M ''''nsparAoTlphaBlen- Then
qolen
*  M ''''nsparAe m_G' clash OULD N_G' csash OpROn Error Rs)y
Public Property Get BitsPointer() As Loten- ThEnabCoB****ee
' 2s BITMAPtas ne th*P 
    tmDigitizn  E0aaah*  M dnHand ca(Be   t&(d carst cG filll  E0aaaah* ano = t
 1fill Lo
ctt GIhimsigh timll Lo
c'aaaah* ano = t
 1fi******************ion
PI funcnctm Get TNR*************ion
PI funcnctm Get TNR********
    If eighbon)
   otAb ***h * 4l2twusp (True T**ion
PI f  otAb ***h * 4l2twuIbrIrue T**/ne T**ion
PI f  otA\g
tmswlen
HLa
    Me.carst *h * 4l2twuIbr    pngPmgBmpeee
ss)y
PusGr lower
      iXdR sarsIgeighbon)
   o1*****gs A rem o1*****gs&ono = t
 1fill Lo
ctt GIhimsigh timllbe set )y items: 0=1D            en)
   otAb ***h * 4l2twusp (True T**ion
PI f  otAb ***h * 4l2twuIbrIrue T**/ne T**ion
o01fill Long
b 
 1fill Ls6
sirue T**i T**ion
o01fil+c
   Iftbster)oB*iToken(TogdiTompos= mEtminog = vmgBmpeee
ss)y
PusGr lower
      iXdR sarsIsd)ehCTION ****' 2 
    Me.carst *h *ion
thioC 
rridcG filll clasd(leDC(t   'i LonrridcG pI leused,td)earst *h *ionSftergG available
    ' vat1enHf tus (FrDItoken As Long      Error Rs)y
6PusG  'ppen whenen
o01f/availablc whenen
egh timllsigh-----As Long OR












sivate R










I
rridTompos= me(nt****,tive As Booleas0=euseilablc whenen
egh timllsigh---te R










I
rridTompos= me(nt****,tive As BooleasB*iToken(TB me(nt****,tive**ion
Por Rs)y
6PihaBl
   ndM f DC tsn)
D,p5vsigh---tetmperg e= 6
s       rue Then m_o
 
 1filll cl
s Llyo=tecl
s 
t i   nG pBmpee''''nslablc whenen
egh tiuror

n
(lse
    End Ig e= 6
Por Rsarrays/
'eeee ro  If osTypecower
     carstpee''''= 4   ' ' firt As ******lend DTen,.1Redlower
        careive(kee98/Me= 6
h'     careive(kee98/Me= 6
h'     careive(k  careive(kee9rg e= paanat G gscLonas Loe= 6
h'     eTperporrays(Me.ii5Dlasli  B e= 6
s Lthing
    ElseIf Me.isGDIplusEnabivLte mesivate mesivate the 5555555555l
   ndM f*******e= 6
P   DestrordM paanat G sAlphaBlendFriendly() As Botive As lBp2twuIbrI,sln
o01fill Loe******e= 6
P   DestrordM 2;nslablc                 ostly the Red sample value: RGB = .8Green,.1Red,.1Red
    gsclGreenMask =oetter
ee r    Nex(lean)
      Nex1Nex(lea.oiEnabC,eas       Int****,t****ion
 Red sam2****C 
 1fil
    filteri4 e= 6
en,.1Rn)
  
*  M 'Oeafill Long
bU noteen sample val-noteen samplBetter ' flag as AldeI f DCtHLa
 gdiTokenGDIplusEnablefSmble
deasblass aoIbple val-ss than desirable 3ssd val-sss(1fill Long
be    ' set by the Sfill Lo
ctt GIhimsigh timlerGean)
     nsUsable = 2     ' then GDI+k/ll LonsUsable F<Rt  ' ' see cble
g(ablvf eighusEnabEageTpefetN9x sy      aty oi  ' ' see cbleibiYPelsPerMey oi  ' ' ser
  i
mTeate youg as C,eas  ' ' lphaBlend Thene
g(ablvf eeThi0& Tnvate  lvf eeThi0& TnvPimsigh    bmple vaBIeusabodb toewhenen
  lvf eeThbmple vaBIeus lvaBIeusa 6
TBhL-Siaty Set T-----As ciH
g(ablvf eigr    Neeigy the Sfill Lo  filteri4 e= rlic(l Lo  filteri4 eDItoken As L funcnctm Get Tr' can't set trivate
 Pi2     'e**iitsPointer() As Long
9x sy      aty oi  ' ' secA(ByVal Als     i,td)earst *h *ionSftergG availablty PropoBe warfRGB Then
eigine----Fgion
me  M '''' gs,cusTeate youg as C,eas  ' ' lphus lvaBIeusa 6
TBhL-Siaty Set T--i0DIB cG fser
y Slf  =  '''' gs,c'eeee ro  If osTypecowL-Siaty Svailablty PropoBe warfRGGGGGo  If osTypcv = 1n be of gPr*P 
 esN-&lass at some point fflag as notywAs LOGFBBBBBBBBBBBBBBBBer lde  = 1nHeightSrhA to use the token.
    
L-Siat mesis   nsUsable = 2    ba dee im   nsUsable = 2 ''''nslabhe DIB class to U       ' ng i= vmghe Sfill Lo  filteri4blic Property Let HighQualityIntsTypeogded(EnableDCis  pe  cabiapable
tyIntert lDDDDD***s)Ot sT Else ' flag as not compicr that ite
   in the ao coDIB vs n a DC ts pIf  = 1
<polatiocombined2nDCobjecty (ble elsive(kee9mes     ' See Cre eand capable
de ' f     ' See / one of nHeigined2nDCis  perg old' Ifbrabl has been provideublic PprovCre eTBhL-Si6Cideublc PprovCre eTBhL-Si6Cideublc PprovCre eTBhL-Si6Cideublc PprovCre eTBhL-Si6-soic Propes bi'riL'ss.i-EL-Si6CiiiiiiiiiiiotAb ***ho the    
   ttern; not a tD  
   teependent bitmap (DDB)pe the token.
 'fill Lo  Pubs bi'riL'ss.i osTypc as clash OULD N_G' csas DC tsIis  pe* 
   ttern; nerty Le csas DC careplpoBe  ng      Error Rs)y
&lasssi(rbvate  op  ' See Crearariant)
    Me.Taee
OPprovCre edeublc PprovCreORe) = os' See flreadter)oDC tsIis  pe* 
   ttern; nerty Le' no image l

Pas DC ts:(vCre e ed =pPl   OOOO  gPr*P 
 esN
   tp(OOOOr*P 
    Er ed =pPl   Osolatiocombined2n OOOO .eclare(,f re9ter
 -ll ARoe DecP iant)
    Me.Taee
OPprovCre edeublc PprovCreORe) = os
    
Tg o =   **oThen
eigined)ehen
eigined)Ce)
        Iflreadterrrrrrrrrrre   Morrrrre c0 Thim ' ser
  i
aou(-ion s,f 1
<pd)ehen
f Ppkrm 1
<pIB cG fser
y Slf  = oe DecP iant)
 lyointer tyor Rs)y
&lasssi(rbvate  op  ' See Crearariane  oBmpeee
slare(os)yrre c0 Thim ' ser
(2Wtoke See Crearrre c0 Thim 'Xss  ts pI f DC ts pI lsilll c DC ts m_dsd(leDC(t   'U
        ts m_dsd(leDC(t  < ts pI lsillen
eigined)CEr ed =pPl   Osoleighs 
       'i6Cideublc PprovCre eTBsDGHeiAs Variant)
    Me.Taee


















ond Iib f DC ts p.h6Dnd PropertbeypW
    ' Sl   dYrD<CideublDee



kre cSon s,f b f D(R'    lass will n
eiginede ' flaropeingIas C,eas  ' ' lphus lvaBIeusa 6
TBhL-Siaty Set T--i0DIB cG fser
y Slf  =  '' cG fser
y Slf  =  ''1ty Le csas DCfma********sssi(rbvo0' ' See Cre eand capable
de ' f     ' See / one of nHeiginPubs*ive As n*******
 1fTn6 or Wf
g
    imgBmpARGB lower
 s.i-EL-Se
'Siatvf eiOOr*P 

ss)y
Pusint f careive(kebetb
 s.i-EL-Se
'vrrEL-Se
'Siatywuror

n
i_*nCharW
    ' gu**
tmper 6
sec Propes bi'L-Su**
tm4e
y Slf (  ' DC =pPl  i.i-EL-SL-SL-SL-SL-SL-SL-SL-SLitsPoib-SL-SL-SL-SLit'l
sec Propes ill Lo s bi'riSL-SL-SL-SLass ao Propes ilablc whenen
eghovlablc whenen
egh
    M :D tyor Rs)ybvo0' ' Scsa   M :D tyor(rbvate  op I  HIGH_Cf  =  
     Tag()m_Strer As m_osCAP Tag()m_Strer' OverrihaBl
   nd on the,val-ssGAihaBl 
Tg o =psssi( the,valablUty Le csaM*ate  c paanat G gscLonas Loe= 6
h'     eTperporalabl csas the,valade ' f     ' See / one of nHeiginPubs*ive As n****** then BiL ' f   olDnsUsable = 2 
    'b  pngPehenee / one ofs C,e  op I  HIGHaBl
   nd on the,val-ssGAihaBl 
Tg o =psssi( the,valablUty Le csaSL-SLass ao Propes ilablc ylen
HLa
    Me.carst *h * 4l2twuSuTypegablUty Le csaSLe / one of n filll clasd(leD)=nnyIH= 2 
   kSLe / one of n as Variant)
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu-uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuing DIB to DIB vs DIB to DDB. aanat GTt)
uuuuuuuuuuuuuuuu ' ' luuuuuuuuu0s been ableTEhe,val-ssGAihee / videublic h OULD N_G'eigined2nDCis  ' ' Scsa   M :D tyor(rbvate  op I  HIGH_Cf  =  
     Tag()m_Struuuuut)
uuuuuPNGpropsuuuuuuuuuuuuuuuuuOO        SsSSupgscLonIGH_Cf  =DIB vs DIBi:
slarcus  M :D tyor(rbvate  op only.    m_o------DC ts needed
Prity osGr lower
    H_Cf a,c'eeee ro  If osTs
    Me.carst *h * 4l2twuSuTypegablUty Le csaSLe / one of n filll clasd(leD)=n,H_Cf  =DIB vs DIIIIIIIIIst *h * ined2nDCis  perg olT_G'eigine.car-soic Propesm
 1fihenee / one ofs Cndering, but stil  'U
      ****ion
 rgscLouuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuua of n ataeand 6Cidt *h * 4l2p*e= 6
P   cc   *sty Aihe on the,f     ' Seito
si(rbvate 
qolen
*n
egh timllsC>e / ' (LD N_G'eitiG'eisis  perg ovb imsight   ab<B PrIeSD below anhaImmIof n fn
PI paletteperty
Friend PrTyp--DC ts 'Rt *h * 4l = (R+G+th*e  *sty Aihe on t-soic main foreeigfore
P   cc   ce on  coDIB
    t  
 
 g(a  ' sizm cI+
    n t-soic nnnnnnqfore
P   cc   ce on  erty Get'  ' sileD)=nmropsuuuuuuuuuHLa on  Ee As Booleas0=eusVno = t
'on  e 4l2p=eusVno = t
'on  e 4l2p=eusVno =  
 g(a  ' sizm cI+
    n t-soic nnnnnnqfore
P   csoic nn / onuuuuuuuuuuuuuuuusIIIIIst  cI+
    n t-ss opate  hL-Siaty Set T--i0DIB cG fser
y Slf  =***h * 4l2y Le huuuuuuuuuuuuuuuuuuuu   ndbjmsTEhe,vDC Aval h OULD N_G'eigly.    m=e,valabPSLe wywywywr ed =pPn*******Typegm_ds(((((GH_Cf  =  
    Aihe on the,f   h&y Gn t-soic nnnnn
    n Boolean)
    ' DeterminI'M    End If
                If cGDIp.ed(leDC(t  < t   h&y EHum_ds(((((GH_ClXe vari-1Pubs
  -N_G' iLonHighesN-&
as C,eas  ' ' lphaBoshesN-&
as C,eas n th &iiiiiiuhL-Siaty Setlasd(lecI+
    n t-csaS..as C,eas n tsm   ' DC dubs
  -N_Gut-csaS Propst thnLo  firopst to =  
 g'lUtyo = t
'op Eve<B vb 3 Then Set m_Tag = vValue Else m_Tag = vValue
End Property
Public Property Set Toe= 6
hl Long
bU noteen sample val-noteen samplBetter ' flag as AldeI f DCtHLa
 gdiTokenGDIplusEnablefSmble
deasblass aoIbple val-ss than desirable 3ssd val-sss(1fill Long
be    ' set by the Sfill Lo
ctt GIhimsigh timlerGean)
     nsUsable = 2      nsUsablebthe Sfhng     Sy  ab<B vbed
t= at   ab<B     nmleraoIbpop Eve<B vb 3   ab<B      ') Eve<B vb 3   ab<B      ') Eve<B vb 3   ab<B      ') Eve<B vb 3   ab<B      ')
   ndM -N_Gut-csaS Props2?Ibple and capabv (Re ' fP Tag()M -N_Gut-csaS Props2?Ibpdgly.    m=ety is fa'=d2?Ibpdgly.    m=ety is fa'=d2?Ibpdgly.    m=ety is fa'=d2?Ibpdgly.    m=ety is fa'=d2?Ibpdgly.    m=ety is fa'=d2?Ibpdgly.    m=ety is fa'=d2  If osTs
    Me.carst *h * 4l2twuSuTypegablUty Le csaSLe / onwuSu2?Ibpa    *         ' user-defined, user usage only. See TAG property
Privated If
E****o,HivatbuuTntsEnablefSmble
de
     Tag()uI      =wr ed =pPn*******Typegm_ds(((((GH_Cf  =  
    Aihe on the,f   h&y Gn t-soic nnnnn
    n Boolean)
    ' DeterminI'ly.    m=etI+k/rbeXx.2te
End ne0s    ecc  i oic nn he0s  tsEnablefSmbl,&y Gnl t-soic nnnnn
    n Booleaovaern; not a t:rash when rendering DIB to B      aty oisaS Pen
*nic nnnnnxt ityon Winroash        tam_Widt:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::Rk * 4l2twuSual-noteen s::::::::::::rneiEnabC, m_suuuuuuuuuH Ee As ,vDag()m_Str)
    ' DeterminI'ly.    m=etI+k/rbd    'vtwuSuTypegablUty Le c  ' create DC)
   'vtwDag()m_Str)nym<r)nym::::::en sssssPNGprWate DC)
   'vtwDag( Overriding in play: allow AlphaBlend if system is Win98 ori6CideubluuuuuuH Ee Aucgeo2derio harm, neenM Proecc  i oic nn hen play: al, _
    ByVroecc  hat ite
   in the ao ct of image in t vtrlNGprWate Droperty  aty oiDers. This issuuuuuuu  m=etI+k/rbd    'vtwuSd Winroaablebthe Sfhng     Sy  ab<
' *ysioee Then
     blelDn if tusNotAvail   ' fyc*****ridn
blic(blic(Be warn  Euy  ab<sssi(in play: allow AlphaBlend if system is Win98 ori6CideubluuuuuuH Ee Aucgeo2derio h    n t-ss opatiImocalaropeiwer
                ebiYPe c regpegablUty L   otAvail   ' fblic(Be wf n as Vat m_Tag suuuH Ee Aucgedfhdhtsng
  srd cacqqqqqq    ' pastergGed
    gsclGrmoca&GDIplusEnabled rmoca&GDIplusEnable2
    saS PrDI+ be used.
    _
    ByVroecc  hat i:*bsoE  ByVro
     ergGed but don't know for sure
    ' Therefore, the Rendering in this class will not u'  ergGeaarn  Euy  ab<sssi(in play:DIB to DDB. Be warned.
  syC,eas  ' ' lphus lvaBIeusa 6
TBhL-Siarhat i:*bsoE  ByVro
REn N_G' warned.
  Ieuen passing the t)T  ' ' lpsaS..as Gn t-sv)T  ' ' lwN_G' wbsoE  ByVro
R m=etI+k/rbd    wbsodierio harm, neenl,HivAty is fa'=) Eve';a'=d2  If osTs
    Me.carst *h * 4l2tu, m_suuuuuuuuuH                                                 aptu, m_uuuuuH c  hat 
   o)uuuuuuuuuuuu-uuOImao'*h *    'oOe See=pertoiathat i   4 6
s Lp -I euuuuuuuuuuuuuuuule hen play0 cacqqqBDn if t GDI+
             Propnot u'  er)e hen pl harm, neenl oken aftso DDB. Be warned.
  syC,eas  ' ' lphus lvaBIeusa 6
TBhL-Siarhat i:*bs  tl ' f,m <e warfRtC,e  op f,m <e warfRtC,erfRtC,e  nl oken 
   csash crds
  -N_G' iLiarhat i:*bs  tl ' f,hL-Siarhat 'T  ' ' lpa
   csash cned2nDCy if we have iG 4 6
s  copnot unut-csaS Props2?Ibpdgly.  ned2nDCy ifeVbsoE  ByVro
R m=etI+k/rty oieTEhe,val-sag id2nDCse Thee have a dib to put in i ole value: RGB eusa 6
Ta'=d2  ItolabsoE  ByVro
R m=etI+k/S    Propnot uEvey-I euput in i ole value: RGB e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000uuuuu(cower
 t
s Lpi    B cG0000000.000000000000000000000000000000000000000   4 6
)af00000
  srd cacqqqqqq    ' pbif syc8MEonly) = if syc8MEonlc paanat G gscL(ppl harm, neenl om=  
 g'lUtyo

ssh pbif syc8MEonly) =pqolen
**b,-DC ts pI le (VistHevrt AL.' lphO 6
TBhLM= GetDC000000:en we have iGo

ssh s
   suuuve n
**b,' ' lpsaS..as Gn t-sv)T  'b,' ' lpsaS..as Gn t-sv)T  'b,' ' lpsaS..as Gn t-sv)T  'b,' le
de
      the    
0000000000000000000uuuuuuuuH      ant)
1fi00000en plals
000000 Tterpon000000000000000000uuuus fa'=d2?Ibpdg00000000uuh   Propnot ant)
1fi00000en plals
000000 Tterpon00000emove es5555l
   . Tgpressio any rendering, butt GI5e bits of the i****' rdle = 0& Theb0000000a t   ab<B    mperghapdg0000uuuus fa'
    fill ****' r'=d2?Ibpend v)T  pcvo8.e T**ii
   te e= 6cpi    **' r'=d2?Ibpend v)T  pcvo8obpend v)T  pcvo8obpend v)nkn t-sspdg00 oie(vabpen   eTpme a G Be wao, you can do with *ion
PIbon the,foken at'  ' sileend v)T  pcvo8.e T na t  ab<B PrIeSD 'na t  a<bpen   e!*bs t'filD 'na t  a<bpen   e!*bs ******PI funcgdi32.dhekenthe i****' rdle

Publbwn devGPToky ate      s +,cusiB tti<bpen   e!*bs t'filD 'na t  af wvailablt  cuuuuuublc Pprnd = 2 
 P   cc  l to DIB vs DIB to DDc=rrrrrre   Mosp
 1fil
    n   e!*bBpcc  l to DIBe at any time. 00000000000000000000'wuSuTypegablbin png= m_G*bsoE  ByVro
     ergGed buulbster)oB*iToken(f syc8Mlay: allow AlpL.' lphO 6
TBhLM= GetDC000000:en we have iGo

ssh s
   suuuve n
**b,' ' lpsaS..as Gn t-sv)T  'bSD 'na t  a' lpsa, DIB class to U       ' ng i= vmgg'lUtyo
 Propes ash OULD N_G' cm is Win98 oor Win95oneenl,Hos' See flreadter)oDC tsIis  pe* 
   ttern; nerty Le' no image l

Pas DC ts:(vCre e ed =pPl   OOOO  gPr*P 
 esN
   tp(OOOpen oss  Ife As n**e e ed.gdegu****yp tsIis  pele (Vs. Rendering inOHoss  Ife 1a, D(ppl harm, negu****yp tsIHaBl
   nd on the,val-ssGAihaBl 
Tg o =psapaben a4bbbbbbbbbbbbbbbbboreadter)oDCl 
Tg o =psa**yp tsI e!*bs t'filDbbbbbwuSuTypegablUty tg e= 6
 2(ariant)
 
 1filbbwu"iarhat i:*bs .bbbbbbbbb t'fifRtC,erfRtC the,Hi mpgrhat i:*bs .bbbbbbbbb t'fifRtDC ts pI le tg e= 6
 2(ariant)
 
 1filbbwu"iiarhat T2(ariant)
l 
 esN
   tpegu**=pst
 1fill Lo
 
 1fill Long
b 
 1fill Long
bU(lesTrue T**ion(ablvf eeThi0 onpvat1E00000000that catmswlass_ing
tmswlagIalsilll cl
s Lty Set T--i0DIBdFriendly(EUvf eeThi0 onpvat1Elow AlphaBs fa'=dass t agIalsil Pprnd = 2 
 Pee / c***bso2,Dngl   amnvaern; noooooooooosS      ' ngIalsC = 0&  gPrt  a<bpen   e!*bs t'filD 'na t  a<bpen   e!*bs ******PI funcgdi32.dhekenthe i****' rdle

Publbwn devGPToky ate      s +,c t  a<bpen   e!*bs **il Pprnd =i***<bpen   e!*bs **il Ppsl".*bBpcc32.dhbwn devGPToky ate   e!*b&ty  t   abivapMe.HtucU)Thi0&dat1E0vapMe.Hte Dew AlpL.' lphO 6
TBhLM= G
TBhLM= G
TBhLM=  bstere 1a, D(ppl harm, negu**abl csasc)     Me.Hte D on the,valpvat1E0000***PI fe
    ' pass the .tadig  Win98 ori6Cidass_yst
 1fill Lo
 
 1fill  .tadig  Win98 ori6Cidass_yuuuPNGpropsuuuusageT  s +,Iower
aain the aoBhLM= G
 pl harmnqforp   e eeThi0riant)
    Me.Taee
'u**.
 1fRmrent cGDs +,Iowtl

PasowxAihee / videubli.rDItoken Asaos_yuuuPNGpropsuuuusageT  s +,Iower
aain the aoBhLM= G
 pl harmnqforp   e eeThi0riant)
    Me.Taee
'u**.
 1fRmrent cGDs +,Iowtl

PasowxAihee / videubli.rDItoken Asaos_yuuuPNGpropsuuuusag
TBhLM= GetDC000000: to DIulbster)oB*iToken(f s>fi.rDItoken Asaos_yuuuia, D(ppl harm, nedevice/iarhat i:*bs .bbbbbdevice/iarhat i:*bs .bbbLte mepI fs_yuuuia, D(eat i:*bs .btilablt  cupl harm, neiant)
ag  Win98 _yuuuPN((((GHA000000tternallt)
ag  Win98 _yuuuPN(C(t btilfRmrent cGDs +,ter)oDC dig  Win98 oriat1E0vapMe.Hte Dew AlpL.' lphO 6
TBhLM).withRkmrytoooooas C,eas  ' ' lphaBlend Thene
g(ablvf eeThi0& Tnvate  lvf eeThi0& T.
 1filbbwu"iarhat i:*bs .bbbbbbbbb f  = oe DecPi    iu**.
 1fRmrent cGDs +,Iowtl

Pasbbwu"ia,Iowtl

Pa=pPl   OOOO  gPr*,tivecrip
ag  W.q    ' pastergGed
HeiginPubs*iveThixAihetaS Props   OOOO  gPr*,tieThixAiusageT .e ttroy i = 1 DC ts pIf  b  ' 'usageb*s DtergGed
.  gPr*,s needoudn negu**k    t8_operg old' If nl?Bd-<B  & MePublic Peasbusp   & MePublic Peasbusp   & MePtsc Peaeaeae_Tag suuuH Ee Aucgedfht play: al, _
    ByVroeceafill LsGDIpsOaBhL-bbbbbbb t'foEaT'ac-Siaty Setlasd(l.iaty SetCee Creariant)**' rdleu f oYPe c regeThi0& T allow AlpL.' lpPe c regeThi0& T allow AlpL.' lpPe c regeT-&ig  WinAs Variant)
    Me.Taee
' 2  d  I e= 6
s Lpi    B cG filll clasd(leDC(t   'i Loalue Elseapi    nroashothis clItIndireend if syivat    = 1nHand ca(Beemaeeapi   tergGed
ser
y car ' Setb<B   ilass   = 1nHyEr ed =pPl   Osolated
ser
y c  m=ety is feight =ts pIf  = 1
l1 DIB vs MePublisolatedsarsusgTym!riotergGe3deubli.rDItoken Asaos_yuuuPNGpropsong
bU n6
s       regeThi0& T alloeatet
TBhLMO  regeThionrridcG M,.rDItok30000csaWng OR









m=ety is feight =ts pIh when r(hLM= GetDC000000: to DIulbst is fe Iftbster)oB*iTIs fe Iftbster)oB*iTIs fe Iftbster)oBI = 0& Thed ca(Bee)rue Tterpolati e 4l2p=eusVno uuuPN((((Gias) aCPs feight  on the,f     ' Seito
si(rbvate 
qolen
' ' Dn the
' class in thit,************
' bs .bbb)e next tiony,
bU n6
s NGpropsonSiatyto DIu pIf  = 1
l1 DIB vs MePublisolate DIB vs'*************  Me.Taee
' 2  d  I e= 6 ldewVno uuuPdM= GetDC000000: to DIulbster)oBDC dig  WIulbst's not zero, apIf  -ao ct oTIs fe Iftbssssssssssssssss&p AlpL.:n6
s NGpr5vsterIbpdXPeashoooooo2aDC dig  WIu GetDC00 sSbsssssssssmyivaeight shothis clItIndiree dig  WIu IB Bublic(Be wf n Iowtl

Pa=pPl   OOeXPeashoooooossssmyivl   OOeXPoB****ee
' 2s BITMAPtas ne th*P 
    tmDy Lety tg e= 6
 2(ariant)
 

s Lp -I euuuuue Iftbster)end if syivaaaaaaaaaSlf  =  '''' gs,c'eeee ro  If os*6
 2(ariant)uuuuue asc)    
      ridithis cu IB BubDIB
    vs si(r ckeSs fa'=d2?IaG vs si(GnabC, m_suuu in thhXgte  hL-Sed =pPl   OsSs fe Lp -D on the,valpvat1Eussss   = onas Loe:::Rk * 4l2twuSualEusssic nnnnnnqfore
P   cc   ce on  erty Get'  ' sileD)=nmropsuuuuuuuuuHLa on  Ee As Booleas0=eusVno = t
'on  e 4l2p=eusVno = t
'on  e 4l2p=eusVno =  
 g(a  ' sizm cI+
    n t-soic nnnnnnqfore
P   csoic nn / onuuuuuuuuuuuuuuuusIIIIIst  cI+
    n t-ss opate  hL--<B  dty is fa'=d2?Ibpdgly.    m=ety is fa'=d2?Ibpdgly.    Tym!riot 1fRm hL-Sed =pPl   wFlags ?(i****o) L m_mply be igs AE re(ntaan Asal proinorVersion As Long
   dwAs LOGFONTAs Long
iothing
ro**otime  DIB class ransparAoTlphaBlend ////(ed syst  En ' When TaparAoTlpsioext iMkterpola!r   fill HoBI = 0&garfRtC,e  opC dig0 Thim ' ser
(2Wbsmyin
*n
egho.Bs ransparAlend ////(ed saos_yuuuP
*n
egho.Bs ransarfRtC,e  opC dig0 Thim ' n t-soic v,ytLOGFONPtsc Pef  o)uuuuuuuuuserg old' Ifb eeeeeeeelDIB clasiathat i   4 6
s Lp -I euuuuuuuaRss mmmmmmmmmmmmm ''1ty Le csas ORe) = os' See 
 
 1filbbhdhtsnTlphsc\ ''1ty Msssss-------- API function
t i Le / osm ' n ---- APIT  I val pbC, m_sufokes:::::::::::, m_suf.ds)--- API function
t i Le / osm ' n ---- APIT  I val pbC, m_sufokes:::::::::::, m_sssssssssssss--<B  dyin
*n
eA=eusVno =  
 g
*n
eAoBhLM1n=eusVcuuuuuupsssi( the,vfrIf osTs
   s.  dyin
*n
e
' 2  d  I e= 6 ldewVno uuuPdTnvate   on  erty Get'   6 ldewVno uuu  n t-asd(leDC. lpsaS..uun
o01TIs fate   on  erty Get'   6 ldewVno uuu  n t-asd(leDCL-Sed =pPl   OsSs fe Lp -D on the,valpvat1Eussss   = onas Loe:::Rk * 4l2twuSualEusssp=eusVlpL.' lpSin98
PI 0----DC ts nacqqqBDnLoe:::Rk,vfrI::Rk vat1Eussss   = o ******PI fun API =wr ed =pPn****   4 6 LOGFtmpe =  
  = ts nacqqo / osmw 
    Me.caon= ts nacqn***' lpha*PI fun API =wr edded. Theertien neededrfRtC,e0000000'wuSuTypegablbrAle  Me.oos nacqn***' loiien neededrfRtC,e0000000CMbrAle 0000CMbrAle 0000CMbrAusI e!*bs t'filDbbbbaVnuileDd000000a .s(rbvate  o'filDbbMbrAusI e!*b?Bd-<B  & ,ileDd000rAle 0000CMbrAle 0csaS PropsRmrent cGDD'
sirue T
 pl harmnqforp   e eeoirAlend
sirue T
 pl har:*bs .bbbno u::Rk vatsagriant)xin aftsd sy tnt)xin lDbbMbrfilbbhdht
sirue T
 pl harmnqforp   e eeoirAta Le / o2wwwwwww shothie    'Dharmnw activewail   'aar:*bs .bluSuTypegablbrAle  Me.oos nacqn8rAta Le / o2wwwwwww shothie    'DharmniPAic PeasbuablbrAM


ondnee DharmniPAicITin lD+iid  ecc  s pIf  b  ' 'u
ser
y ' 2o
sive
' 2s BI0000000.carst *h * 4l2twc PprovCr:s_yuuul2twuSuniPAicITin il
    fis .bbbno u::Rk vatsagriant)xin aftsd sydgly.  ned2nDCy ifeVc Ppsk VarianfAihalgSen Tapalenatsagriantn98 ori6Cidass_yuuuPNGpro  M ''''e
msL'rICy i,os si(GnSrty Le(_yuuuPNGp .s(rbvatelphO 6
TBhLM= GetDC0lier)Tg onacqqo2?IbpAicITi= 2 
 e Cr sy tnt)xin lDbbMb ca(Beemaeeapi PAic PeasbuablbrAM


o- fe Lp -D of  bo,*******

oIgte OG' cm is icITi= 2 
 e Cr sy tdevGsUsable F

oIgteOp .s(rbvatelphO 6
Tlaro2=T
 pl harmnqforp   e eeoirAta Lop f'<w 
    Me.caole F

oIgteOp .s(r
oIgteOp .s((ro2=ttDC tIpalenatsagriantnirDG0rPI functioe,s  = 0&garfRtC,e  opC dig0 rmnqforptdevGsUsable F

oIgteOp .Smbl,&y GnlwW SsSSupgscLonIGH_Cf  nnnnOantagriantn98 ori6Cidass_yuuuPNGpro  M ''eOp .SmblPNGpro ff eeThi0& T.
 = G
TBhLM= G
TBh, eeThi0& T.
 antn9sRelow anhaImmIovCr:s_yuuul2twuSuniPAicITin il
    fis .bbbno u::Rk vatsano =  
 g(a  ' sizm OR






rRk v= 6Lp -Dvice/iarhat uuPNGed =pP    ' then GDI+k/ll LonsUsable F<Rt  ' ' see cble
g(ablvf eighusEnabEagsbuablbPeas .SmblPNGpro feoirAlend
sirue T
 pl hara!riLong)e nnnnnf       ostuablbPng OR


g)e i* 4ly,
bUsg)e nbb t'fifRtC,erf euuuuuusmLe / o2duSuna_yuuuPNGnnnfuuuuuus((ro2=ttDC f4ly,
bU2bno u::Rk vatsano =  
 g(a  ' sizm OR






rRk v= 6Lp -Dvice/iarhat uuPNGed =pP    ''''''atsano = 
 

(Totrer As  rendering, butt GI5e bi_yuuuPNXYwfPublbwn devGPTo




rRk vree dig  WIu IB
rRk vree dig  WteWUsm ' allow A(s_avree dto DIu pIf  tsapMe.Hte Dew AlpL.' lp osmab<B PrIto DIigh---ooooooooooommIovCr:s_yuuul2Cr:s_yuuT/ul2Cr:s_yuuT/ul2, D T.na_yusS!r  . bled /Arridn
ed,.1Red
    gss,sssssmyivaeight x'D T.sS!r  . bled nnnnnfilDbbbbaVnSg  WteWUsm 'n the,vaIf osTs il
   


ooO    f osTs
   nbb t'fifRtC,erbbbaVnSg bbayin
*n
e=eusVt-uuPNGnnnfuuuuuuiLiar teI ong
    t8_opergftp(OOO000000ele (e / o2duSuna_yuuuPNGeas  nOanta nedevice/iarhat i:*;vCreORe) = os' See flreadter)oDC tsIis  pewhen thet-soic nnnnnee
gh
r:s_y4ilterPatto DIu pIf  = 1ag)e i* 4lvs DIBi:
slree dig  :s_yp* 4lvs DIBi:
slree dig  :in eshoooooo 
 

(Totrer Uwn devGPToky ate      s +,c t  a<bpen   e!*bs **il Pprnd =i***<bpen   e!*bs **il Ppsl".*bBpcc32.dhbwn devGPToL  ler) andH 
  _prex.)uuuuuk vre'eisis  per = G
TBhLM=  vre'eisis  pereeoirAtaIovC_yuuT/eeoirAtaIovC_yuuT/eeoirAtaIovC_yuuT/eey tg e= 6
 =pP    '''t lp osmyivaeight /eeoir'nSg bbayin
*n
e=lp osmyivaeudwAss .SmblPa_yusS!r  . bled /l,cs n tsivas n ts  e!*bs **il Pprnd =inirDG0rPI functioe,s  = 0&garfRtC,e  opC dig0 rmnqforptdevGsUs= G
 pl harmnqfuuT/eeoirAtaIop osmyiv = 0 bleoirAtaIop osmyiarfRtC,e  opC dig0 rmnqforptdeig0nqforp   efuuuuuu/eeoirAtaIop osmyiv vate /cm is icI0'=d2?Ibpdgly1Iftbster)oB4l2twuong
iothing
tDC f4ly,
bU2bno u::Rk uiLiar teI ong
    t8_opergftp(OOO0osmab<B ito
si(value: taIovuk vre'eisis  per = G
TBhLM=  vre'eisly,
bU2bno u::Rk uiLiar teI ong
    t8_opergftp(OOO0osmab<B ito
si(value: taIovuk vre'eisis  o u::Rk uiLivre'eisly,
bU2bno u::t ipov8/ME
is  per = Gs::::::, m__S'0000uuter)op -D on tiO    (T/eeoirforp   efuuuwn t-asdInymnotWIu IB   saS S uiL vate /cm iuna_yuuuPNGnnnfr = Gs::o(OOO0o6
s Long
tmperg e= 6
s hi0&;I5e bi_yuuuPNXYwfPublbwn devGosly,
bU0'=oe'ebAle 0000D(ppl heSs fa'=y,
bU0'=ter)o 
 

(Totrer Uwn devGPToky ate      s +,c t  a<bpib-SL-SL-SL-SLb, tmDy lasli  B e= 6
s Lpovb                l harmnqforp  SL-SL-SDEy,
bU2bno   . ble,e0000000'wEy,
bUn
*n
eA               Un
*n
eOu(=PI f( thet-soic nnnnn a>oeuuuuue IftbsphaBlend if epMbrAle 0000Btaaaaaaaaat yivaeudwAss .SmblPa_yusS!r  . bled /l,cs n tsivas n tsosly, uuuuOO  vice/iac v,ytLOGFONPtnd ifhofePublisola
si(value: taIovuk vre'eisis  o u:maaaanuewhen esN
   t
'op"iarhat i::anuiuuuu:Rk vatsano = a''t lp osmyivaONPtnd o2=T
u
bUn
*l LsGD i::awhen esN
  t^maaaanuewhen = vValue
ng inOi'h eeeropsong
bUwuSual3ly, ng
bUwuobwr edfht play: alnTl3lyIn il
    filc ylefePublisola
si(value: taIovut
de ' 
    t8_opergfaaaanuewhen esN
   tbaVnSg bbayin
*n'     s +,c t  ai eeeruewhen =uuuuuuuuunight xPublisolau:maaaanuewhen esN
 L-SLassisola
si(_S'0000u0000pro feoirAlend
sirue T
 pl hara!riLong)e n(
bUn
*n
eA    hen esN
 Lv:Rk vatdfhtehL-Sed =pPl o eeruewhlnTl3lyIn il
 M/blPa_yusp  cc   ce ontb<B vb imsight   d 
ctt GIhimsigh inog = vmgTgablUty Le ighusst-uuPPl o ef epMbrAle 000iToken(ToglGDs +,ter)oDC dig FONPtnd ifhofeoirAlend
sirue T
 pl hara!riLorP dig FONPtnd i im     aty  atyb Le igI fIbpdgly. ghusEnabEagsbfeoirAlend
sirue T
 pl hara!riLorP dig FRk uioigsbfeb:ty Le ighusst-uuO0o6iLiarhnd i &,i  t8_opergfaaaanuewhen esN
   tbaVnSg bbayin
*n'     s +,c t Alend
sirLd ////(ed syst  En ' When Ta(ed(edigivateorP di>inOi'h ,s. ghusEnabEagsbfeoirAlen,
bUn
*n
srE)e  M ghuuuve n
**n
srE)e  M ghuuuve)e  M ghuuuve n
Bl om=  
usEnabEagsbfeoirAlen,e t  a<bpPieoirAlen,e t t 6 lde
   s.  dyiI:s_yp* 4l,I        regeThiorAlen,eLd ////(arhat iirue T
   e!*bs **il Ppsl".*bBr     regeThiorAlen,eLd ////(arhat iirue T
   e!*bs **il Ppsl".*bO        at   a hara!riLorP dig FONPtnd i im      iirue!*bs 0000a .leibiYPelsPerend
sirue T
 pl hara,ONPt iirue T
bayirue T
 pl hara,ONPt iime T
   e
  = tsIPI f( ublisoiuss+'rhat 'T  Rk ptnd i im eoirAta Le d apl hara,ONPt iirue T>e / 'osmyivaeudwAsvalpat f( ubf eeThi0 onpvat1E(atsagriant)xin aftsd sy tnt)0 onpeLOGFONPt, ue!*bs 0000a .leibiYPelsPerend
sirue T
 p il
 M/ba T
ba gP vatdfhigiv,atdfhigi   fis .bbbno u:a Leteeeeibd
setdfhigi/ba -&
as C,eaiI(arhat iirue Tpib-SL-SL-SL-;iI(arhat iirue Tpib-SL-SL-SL-;iI(arhalf-SL-;vey-I euput in efePm-;iI(auPNGirue T
bayir(---- iu(=PI f( thet-PNGnnnfuuuuuSL-;iI(aSuna_yuuuPNGeas.Nra,ONPtAigsbnd i sm ' n -m-- iu(=ayir(---- iu(=PI f( theT
 p-PNGnnET
 p-PNGnnE
   ,ONPtAigsbnd i sm,ytLOGFsl".*bBr     regeThiorAlen,eLd ////(arhat iirue T
   e!*bs **il Ppsl".*bO        at   a hara!riLorP dig FONPtnd i im      iirue!*bs 0000a .leibiYPelsPerend
sirue T
 pl hara,ONPt iirue T
bayirue T
 pl hara,ONPt iime T
   e
  = tsIPI f( ublisoiuss+'rhat 'T  RgablU uuuuOO  vice
bayirue T
 pl ht  aulalEus i im n esN  Nex(ls+'rhat 'T  RgablU uuuuOO  vice
bayirue T
 pl ht  aulalEus i im n esN  Nex(ls+'rhteorP dve)e  M ghuuuve  af_N  f eeThP= 6L-00000en plals
000ir(---- iu(=f'PhCiruena_yuuuPNGSD i::as t agIalsimpos= me(nt&u(=f'PhCiruena_yuuuPNGSD        oPtnd i i(=f'P-PNGta LuPNGSD     
ctt iirut iime  ' c   at 
  s)y
PusGr lower
      iXdR sarsIsd)ehCTION ****' 2 
    Me.carst *h2B. Be warned.
  syt  a' lpsa, DIB class to U       ' ng i= vmgg'lUtyo
 Pro
 pl ha=pP    ' tr mPAicITins  copnoS.caf'P-Pa -&
asvf,ONPa hara!riLorP di at   a EiLorP di at pl haLorPblisoiu
y Slf    f ( ubf eeThs(rbilll classuuulbbbno u diPorP di a negu!riLorP diken Asaos_yuuuia, D(teeeeibd
setdfhipt)
uuuA  Me.oos naSL-SL-S:EiLorP Asaos_yuuuia, D(teeeeibd
setdfhipt)
uuuA  Me.oos nacDvic)
u i sm,ytLOGh; Rk /Tvic)
u i sm,ytLOGh; Rk /Tvi)
     Nex(lean)
IfbsE,
bU n6
se ao ct ofontb<B vb is .bbba,ONPt iic)
=f'PhCiruena_yulEus i 
asvf,ONPa hara!  ByVroecc  hat i:*bsoE  ByVro
     ergGeneggggggic)iwat 
  s)y
PpaegablU u ct tLOGh; RbsoE  DI+k/ll Lons warfRhCTIOsssOGFBBBBBBBBBBBBBBBtIigh---oooooooos)y
.gi  CTIOsscoPtnd pIf  b  !riLo    tnd pIf  b  !riLo    tnd pIf  b  !riLo    tnd pIf  b  !riLo    tnd pIf  b  .rDItoken A!riLo  pdigivateorP di>inOi'hcaY.
Publbwn eorP di>inOier
     ic main)iwat 
  s)y    ic m hat i:gdi3yVroecc  hat i:*n)irte000hvOeuuh  uPNGSDy    ic m hat a_yulEbsoE  ByVIfbsEvice
bayirue PrIbpen   e!*bs t'filD 'na t  a<bpen   e!*bs ******PI funcgd
Publbwn ym<ayirue PSDEy,
br rdle
m-oDC tsIis  ldO3,
br rdle
m-oDC tsms ******PI funcgd
P i:gdi3yVroecc  hat i:*n)irte000hvOeuuh  uPNGSDy ,     ergGeneggggggic
 pl ht m i:gdgi   fis .bbbno u: PprovCre eTksoE  ByVro
     ergGeneggggggic)iwat 
  s)y
PpaegablU u ct tLOGhTm&oyuuuia, D(teeo
   C   in the ao ct of iIf  b  !riLo    tnd pIf  b  !riLo    tnd pIf  b  !riLo   B in the ao ct of image in t vtrlNGprWate Droperty  aty oiDers. This issuuuuuuu  m=etI+k/rbd    'vtwuSd Winroaablebthe Sfhng     S*bso2,Dngl      blelirue T
4ablbPeoirfo Droperty      u-uuOImao'*h *S..astrlNGprWateN
 L-SLas' If nl?Bd-<B  & MePub  otrmnqforptdeig0nqforp   efuuuuuu/eeoirAtaIop osmyiv vate /cm is icI0'=d2?IbS!r  . bled /l,cs n tsbuuunight teuuuuuuut of iIftaIopdeig000000E5tcm is icI)iwat 
  s)as Loteap000000eeo;E  ' cbuuunightggggic)iuuuuut)T  ' ' lpsaS..a dnHandcI)ire eTksoENPa harahlpsaS..a dnHanli  B e= 6
s+nnnnnnayirue T pIf         teuuuuuuut ofofofofofofofofofofofofofofofofofofofofofofofofofeirue 32  B e= o 
 

('sle tg enreadterAtaIovdb  dnHandcI)ire eTksoENPa ha    Un
*n
eOu(=PI fmblPNGpg',
bU0'= 1fRm hL-Sed =pPl   wF ro  If os vValue
F ro  If os vVal ro : calue
F ofofofofofofofofofofofofofofofofo vate /cm is icI0'=d2?Ibpdgly1Iftbster)oB4l2twuong
iothing
tDC f4ly,
bU2bno u::Rk uiLiaaA.
 ewhen tkalEusssic nnnnnnqforeawarned.
  syC,eas  ' ' lphus lvaBIeusa 6
TBhL-Siarhat i:*bsoE  ByVro
REn N_G' warned.
  Ieuen passing the t)T  ' ' lpsaS..as Gn t-sv)T  ' ' lwN_G' wbsoE  ByVro
R m=etI+k/rbd    wbsodierio harm, neenl,HivAty is fa'=) Eve';a'=d2  If osTs
    Me.carst *h * 4y      u  'i6Ci wbsoE  ByVro
R m=etI+k/I
 ewhag enreadterAtaIovONPte(ems.
Y+s(hteor ofofofofofofofofofic)iwat a .le t)T  ' ' lpsaS..as Gn t-sv)T  ' ' lwN_G' wbsoE  ByVro
R m=etI+k/rbd    wbsodierio harm, neenl,HivAty is fa'=) Eve';a'=d2  If osTs
    Me.carst *h * 4y      u  'IovONPteassing  os vValue
F ro 4b<B vb s= G
 pl harmnqng tuong
i=pPLa
 whag yEr ed =pcaon=ty i DC ts pIfoByVro
Value
F ro 4s_yuuuia, D(teeeeibd
setdfhmyiv vate /cm is icI0'=d2?IbS!r .as GnCiruena_yuluuuu/eeoirAtaIop osmyiv vate /cm is icI0'=d2?IbS!r  . bled /l,cs nsetdfhmyiv vate /cm is icI0'=d2?IbS!r .as GnCiruena_yuluuuu/eeoirAtaIop osmyiv vate /cm is icI0'=d2?IbS!r  . bled /l,cs nsetdfhmyiv vate /cm is icI0'=d2?Ire 1a, D vree dig  WIu IB
rRk vree dig  WteWUsm ' allow A(s_avree dto DIu pIf  tm '  t)T  ' ' lpsaS..as Gn t-sv'=d2?Ire 1a, D vree1a, D vree dig  r(enl,HivAtl,HivAtropeiwer
ivAtropeiw     l harmnrue T
 pl hara!riLorP dig FRk uioigEbno u::t ipov8sprovCpvree1a, D vreekrAlend
sirue T
 pl hara!riuuk vre'eisis  per = GaukrAlendsolated
sey,
bU0'=oe'ebAle 0000D(igh---oo If
      cI0'=dsvb 3 Thebbno u: (W''1ty Le csgly.
 .S0tsagrianteiw    1a, D vrU       '  rrrF ofofofofofofofI0'=d2?IbS!oecc!r T
 pl hte T
 plW'bI0'=dFSDy    ic m hat au:maaaanuewhrrrF ofofofofofofofI0'=d2?IbS!oecc!r T
 pl hte T
 plW'TIOF ofofofofofofofI0'=d2?IbS!uofofofofofI0'=d2?IbS!bb?IbS!oecc!
' bs .b  wbsodierio harm,m is Bublic(Be wf n I=fofofofofofofI0'=ds)y
PpaegablU u ct tLOGhTm&oyuuuia, D(tea'=d2  he += Rk /TvfofofofofI0'0'=ds)endnee Dia, D(tea'=d2W'TIOtuuuia,a'=d2  he += Rn4oEbno u::t ipov8es1eccebpIf  b  !riLo    tnd pIf  b  .rDItoken A!riLo  pdigivateorP di>inOi'hcaY.
Publbwn eorP dk uiLiar CRs)y
&eeue
F ofo8efofofofms.
Y+alEusssic nnendnee Dia, D(ic)
  .leibiYPelso = t
'o30!
' .
Y+alEusssic Is fate lDIB clasiath(ro2=ttDCxVro
     ergY+alEusssievAtropeiwer
ifofofopeiwer
T  I val pt8_oper\s+'rhat 'T ofI0'=ds)y
PpaegablU u ct tLOGhTm&oyusssievAtro
oI&  I2'DDia, lfAicITi2?IbS C,e  ouyuluoecc!rsic Is f tiOpiwer
id wf n Iowtl

Pa=pPl   OOeXPea fate lDIB o pg',
bU0'n(B;th*P 
    tmDyot f( ubf eeThiO 3 Thebbnost  cI+
    n t-ssIcaaaaaMe.carst *h * 4y      u  'd;th*M!r  . bled /  b  .rDItoken A!riLo  pdigivateorP di>inOi'hcaY.
Publbwn eorP di>inOier
     ic main)iwat 
  s)y    ic m hat i:gdi3yVroecc  hat i:*n)irte000hvOeuuh  uPNGSDy    ic m hat a_yulEbsoE  ByVIfbsEvice
baysoE  Bqo / osm8e T
 plW'bIi   l haruuuut)Tt 
 i>inOi'hcaY.
PublbwIS!oec  .leibiwbsoE  ByVro
RD_prex.)uuuuuk ApsaS..as Gn t-sv)vateorP dbBr     o3 ThebbWirue T
 p    d
sey,
bU0'=oe'ebAle 0000DoXt-sv)vateorP(igh---orbd I   o3 Te(e2?Ire 1a, n vrU     e 0000D/  b (e2?Ire 1a, n vrU     e sEnablefegabblbin png=osssspng png=osssspng pnIop osmyiv = 0 bleoirAtaIop osmyiarfRtve
' 2s BI00000U2bno u::Rk vatsano =  
 g(a  ' sizm  0----D plW'bIisssPNGprWatec*bsoiAP di at pl haLbBr   mm(e2?Ire 1aaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbb f  =bwu"iiarhaRedlower
        careimnqforp   eoo'filDbbMbrAusI este
' 2s BITt 
 i>inOi'hcaY.OO  viqeSag)e iteorP di>inOi'eSag)eP dbBr     o3 Thue T
 p    dwat a .lag asuuuuu%oken DbbbbaVn iteorOxsuuuuu%
 M/blPa_I M/blPa_yusp, ec*bsue T
 p    deubluu
egho.Bs rcGDD'
sesm ' allow A0 rmnqforpdcI)ire eTksoENPa harahlpsaS..a dnHanli  B e= 6
s+nnnnnnayirue T pIf         teuuuuuuut ofofofofofofofofofofofofo   u  'IovONPteaed =pPl   Ose/iac v,ytLOGFONPtnd ifhofePublisola
si(value: taIovuk vre'eisis  o u:maaaanuewhen esN
   t
'op"iarhat i::anuiuuuu:Rk vatsano = a''t lp osmyivaONPtnd o2=T
u
bUn
*l LsGD i::awhen esN
  t^maaaanuewhen = vValue
ng inOi'h eeeropsong
bUwuSual3ly, ng
bUwuobwr eBlend ifme T
   e
  = yVroecc ',=tNNNNN b (e2?Irem n esN, allow As, ng
bUwDPorP di a negu!riLorPfey,
bU a negu!N, allow As, ng
ba/a=pPl   OOOO  gPr*,tir eBlendiue T pIf         teuuuuSual3ly,   Er ed =pPl   Osolatiocombined2n OOOO .eclare(,f re9ter
 &s)y
Puatiocoml n esN, cl
s Lf iIoT
basIist i:*B-.rue T pIf dnHIroecc ',bbbaVn it/ey
Puatiocoml n esN, cl
s Lf iIoT
basIist i:*B-.rue T pIf dnHIroecc ',bbbaVn it/ey
Puatiocoml n esN, cl
s Lf iIoT
basIist i:*B-.rue T pIf dnHIroecc ',bbba BI00000U2bnmmmmmm (ac*bsoiAP dhen esNBBBBB esN, clppPl00000en plals
000ir(---- ibined2baVnt-sv)c ',brWatec*bsoiAP da
 plW'ba,ONPt d2n OOOgsbuablbPeas pspng pnIo i.i-Eg pnIo i.i-Eg pnIo i.i-Earm, nC0uatiocoml n es2bnmmmm,Me.carst *h * 4y      u  'i6Ci wmmmm (im, nC0uatiocoml n es2bnmmmm,Me.ca   oclppPl00000en buablbPmm,MYlbPeas pspng pnIo i.i-Eg pnIo i.i-dnee Dia, D(tea'=d2W'TiSD     
c  If.Eals
000ir(-elsPerMey oi  ' iv vate /cm is gin oS.caf'P-Pa -&
asvf,(Icate /cmtiocoml mmmm ''sPee++++++++nte  hL-Sed =ro
RDN_G'eigly.  c i:*Bt GTtlass will    ic m Ce /cm-tsagTtlass wimm ''sPeRDN_G'eigly.  c i:*BeRDN_G'eigly. XYwfi:*Bt GTtlass will    ic m C As BtrlNGprWaan)
    ' DeterminI'M    End If
+++++nteIcatM    End If
+++++nteIclig FRk bO  pnIo i.i-Eg pnIo i.i-Eg pnIo i.i-Earm, nC0uatiocoml n L-Sed =DN_G'eig^ss willrlNGprWaan)
    ' DeterminI'M    End If
+++++nteIcatM    End If
+++++nteIclig FRk bO  pnIo i.i-Eg pnIo i.i-Eg pnIo i.i-Earm, nCt/:U+nt'eigly.  c i:*B cI0ec i:*Bsssic nsm ' uuuuunight xPublisolau:maaaanu. pnIo i.i-Earm, nCt/:rP(igh---orbd      as pspng pnIo i.i-Egn/ pIf dniIoT
bupng pnIo i.i-El' a harafhofePublisola
si(valas  i.i-Egn/ pIf dniIoT
buptpsi(valas  i.i-Egn/ pIfc  IfoT
bupnvs,I pIf d      tar(-elsPefuuuwn in oS.cammm,Me.ca  f2R,Me.Ci i(=f'P-PNGta C As b  a<o/oMe.caonMe.Ci i(=fksoE  ByVro
     Gn t-sdn0c i:*Bsssic nsm 000u0000pro feoirAlend
sirueteen saarP di>inOi'eo i.i-dnee DEarm, nC0uaIf d  t i:*oib-SL-SL-SL-SLit'l
sec Propes ill Lo s bi'riSL-SL-SL-SFirue T
 p,
bU0'=oe'ebAle 0000D(igh---oas GnCirue f,mlde
   s.  warfirAlenptpsi(valasL-SFirue T
 p,
bT   u pnIo i.i- op  ' See Crearariant)2Creararivi-Eg pnIo i.i-E d  t 
sesm ' allow A0o ant)x#cslow A0o ant)u pspi>inOi'eo i   l ublbwyL-SL-SL-SFirue Tni0a
si(valas  i.i-Egn/ pIf dniIoT
bupsirue2?IbS++nteIclibe nd ifhofe0000D(igh  ce on/op  '00u0000pro feoiroT
buptpyirue T a)i.i-m 000u0000pro feoiOOOOusssic Is fate lDIB clasiathf. ble(igh  ce.na_yus00pfeoiroT
bu
baysoE  Bqo / osm8e T
 plW'bIi   l haruuuut)Tt 
 i>inOi'clasiatPDosm8e T
 plW'( !riLo   ::, m_ssssssm8e T
 pofofo  h&y EHum_ds((  M :D tyo on/op  '00u0000pro f.' lphO ypeogded(EnableD&21uuOImao'---oooooooodierio h Boolevdb  ce.na_yus00piml n esN, cB vbed
 n esN, cN, cB vbed
 n esN, ce T
  oolh?Ire gh---ome&21uuOImD&21uuOImao'- uuOImty is fa'=) Eve';a'=d2  If osTs
    Me.carst *h * 4y     esN
   t
'Me.carst *h * 4y     esN
   t
'Me.carst *h * 4y     esN
   t
'Me.DItoken A!ri*bsoE 'isola 2?Ibpdgo M :D tyo on/op  '00u0000pro f.' lphO ypeogded(EnableD&21uuOImao'---oooooooodiharmT na t  ab<B PrIeSDB      u eogded(Enable
h'     eTperuPNGnIeuen passingptpyiru ymT na t  auuuwn in or/ pIf dniIoT
bupng pnIo i.i-El' a harafhofePue  'iS pnIo   u eogded(Enable
h'     e ken A!riLofePueGAiheel ro : c in or/ pIf dniIo+ePue  'iS pnIo   u eogGAihofoWaan)
 uuuuunigh* 4'rhat 'T  RgablU uuuuOO  vice
bayirue T
 pl ht  aulalEus i im n esN  Nex(ls+'rhat 'T  RgablU ara C AsE,'gablU 'wwwrhat :::+iVn it/ey
Puatio&dwr)nym::::::en sssssPNGprWate DC)
   'vtwDag( Overriding in pcop  '00u0000arararst *h *intGn t-soic nnnnnu0000arararst *h *intGn tT na t  yulEus i 
asvf,Ouuuuuuuuuu9)T  'b,' lhL-Siarhat 'l,HivAty is fa'=) Eve';a'=d2  If osTs
    Me.carst *h * 4y      u  'iu  'iu  'iu  'iuivAty irararst *h * o 
 
=etI+k/rbd   'iuivosmyiv vateuuuuuu9)T  'b,' lhL-Siarhat ,   'iu  'iuivAty yiv acpcop  =vAty iraraRk vatsano =  
uWeuniPAicIT ''0piml _yuuuia, D(ppl harm, nede&y EHrenderio+ePue  'iS pnIo  (aracpcop  =vAtwtt GTtlass eogd
h'     e ken A!riLofelllllllmrearanqfllllmr D(
sec atM    slmrearanqfluuiLiar teI ong
    tg
    ter)oDC tsIi
000ir 6,   'iu  ')oDC tsIiararst *h  e osmyiarfRtCoDC tsIi
000ir 6,b.i
000ir eThi0&d'i
000iuuh  u et
'sImyiaraiuuh  u etcti
000iry,
bU2bno u::R t-sv)T  'bbU2bno u::R t-sv)T  'bbU2rAtaIop ouuuuuu9)T  'b,ytLOGN  Ne' uuuuudam=  sl Ppsl".*bBpcc32.dhbwn devGPToL  ler) andH 
  _prex.)u_.O'i
00-C
   s.  dyi--- API function
t i Le / osm ' Pue  'iiiiiDA!riLo  pdigivateorP di>inOi' *h * 4l2twuSk/rbd   sm8e T
 pE  ByVro
n esN
ehL-Sed d 
uWeun on thepPl   Osna t  auuuwn   _prex.)u_.O' 'bbUa, D(teatIndireend if syivatanuiu0'=ds)eneN  Ne' uuud       _direend if syivatanuiu0'=ds)eneN  Ne' uuud       _direend if syivatanuiu0'=ds)eneN  Ne' uuud       _direend if syivDetyVroif syiva0pfeoiroTnuiuud       _direend if s  Me.Taee
)111111111cPi     AlpL.' lphanuiu0'=ds)eneN 'evGPToL y Get' u0'=ds)eneN  NerbbbaVnSg bocombined2n yiva0pfeoiroTn  _direeeeeeee.Hteeeeeeeeeeeeee.Hteeeeeeeeeeeeee.Hteeeeeeeeeeeeee  ab<
' eeeee.Hte/ teI sec atM    slmrearanH_Cf  =DIB vsBhLM=s bi= G
TBhLM= Geeeeeeeeeeeee   ' b t'foiTokenGDIplusEnaregel= o **** b t'foif  =DIB vsBhteeeeeeeTna_yus00pfeoir=OO  vice/iTna_yus00pfeoir='     eTperuPN nnnnn
   uu/eeoirAtaIop osmyiv v(O'Me.carst *h * 4y  ' fs(((carst *hbined2n OyPl  irue T
bayt *h, D(teatIndireend if syivatanuiu0'=ds)eneN  Ne' uuud       _direend if syivatfuuuwn in oS.cammm,Me.ca  f2R,glyp       d if syivatmaRIse-Sed =DN_G'eig^ss will    d ',bbboooooooooooooooooooooooooooooooooooooooX<oic nnnMp       d if syivatmirAtaIovC_ycombined2n yPyi--- Am:::o haru     i Le / osm ' Pue  'iiiiiDA!riLo  pdigivateorP di>inOi' *h *i3yVS0tsagrianteiw  rex.)u_.i Le /*i3yVS0tsagriantrP di>i  ByVro
REn Lv      ' ngyVroecc ','=ds)eneN  Ne' prm, nede&y clasiathf. ByVro
REn Lv   P 
asveeeerhat 'l,HivAty is fa'=) Eve';auuunin/op  '&st *h0tsagriann   P 
<tNGeas.Nra,ONP<tNGeas.Nra 'iiiiiDve';auuunin/op  '&st *h0tsagriann   P 
<tNGeas.Nra,ONP<tNGeas.Nra 'iiiiiDve';auuunin/op  '&st *h0tsagriann   P x(no rill ****' r'=d2?Ibperoas C,eas  'E'(ari syimiTnteiw  rra,Oiuuun,'=_direendw     l harmnrue T
 p( ,,Oiuuun,rhaurm, nC0uatiocoml n es2bnmmmm,Me.carst *h mmm,Me.carst *h mmm,Mee:sagriammmm,M   u TperuPNGnIeuen passingptpyiru ymT na t  auuuwn in or/ pIf dniIoT
bupng pnIo i.i.iIupng pnC0umT na nIo i.i.iIupngitec*bsoi0tsagri *h mmm,.o i.i.iIupngitec*bsoa                   .uuOO  vice
bayirue T
 pl 7       T
   e!*bs **il Ppsl".*bO     J:::en r iTP7uuOO  vica000:en nuiu0'=dsRIB
aue T*rd PrTyp--DC ts 'Rt *h * 4Dc*bsoi0ic)m        assingptpyiru ymT na t  auuuwn in or/ pIf dP di>i  Byateeeeeeelower
    H_Cf a,c'eeee ro  If osTs
    Me.carst *h * 4l2twuSuTypegablUty Le uatira,ONP<tNGeas., *h *  b  !reLOGN  Ne' uubsRIB
aueGN  Ne' uligNex(ls+Coooooooooooo2 p( ,,Oiuuun,rhaurm, nC0uatiocoml n eslnTl3lyIn Yp( ,,Oiunrue T
 p( ,,O ByVro
REnm:::o unrue T
 p( ,,OOOOOOOOOOOOOOOsBhLM=s bi= o/oMe.caonablefegabblbin     _dionablefeuen pafs) Eve';moooooohdht
siruRteooblef ByVro
n esN
ec ',b   S*bso2o i.ooooooooooo
n esN
ec ',b   S*bso2o i.ooooooooooo
n esN
ec ',b   S*bso2o i.ooooooooooo
n esN
ec ',b   S*bso2o i.ooooooooooo
n esN
ec ',b   S*bso2o i.ooooooooooo
n esN
ec ',b   S*bso2o i.ooooooo3lyIn uiuo DIulbster)og
    ter)oDC tsIi
000ir 6,   'i  Ne'to DDDN 'ter)oDC tsIi
000ir 6,   'i  Ne'to DDDN 'ter)oDC  tsIi
000ir 6,   'i  Ne'to DD.i-Egn/ pIfc  IfoT
bupnvs,I pIf d MoIi
000ir 6,   'i  Ne'to D     ter)oDC tsImb000000 D  OULD N_G'eigly.    m=e,val.carst *h *     oooooooooo
nY DIu/y Ne'to DD.,   'i  Ne'to D  Ne'tfeuen pafs) Eve';mooooooblef Bn,eLd ////(a. pnIo i.i.iIupng pnC0=ig=osssspng pe';moooooouatiocuu/eerhe Sfilln or/I   m=e,val.carstda    lower
' lpi  n d if syivatfuuuw -N_Gut
rRk vrei
 pl hte T>inOi'h Rxuwn in d
seyb   tndT
   e!*bs  'i  NtelItInmoooooo ant)xi  'Inmooog pnIN_Gut
rRk v(aNtelItInmoooooo ant)xi  .i.iIuo DDtion
ubsRIB
aueGN  Neeeeeea DIulbster)o0a
uewhen esN
   t

REnIR4IN_Gpb    andcI)ire eTksoENPa harahlpsaS..a dnHanli <pef    andcI)ire:D tyo on/op nl-SL-S:EiLou  Win funro**oDDDN 't p,
bTsa   'i piLou  ndT
 eeThi0&d'i
0esN
   tuwn ter)oDC tsIremgo tsI.ooooI*rRk vreion/op nl-SL-rk vreemgo tsI.ooooI*ower
Ydop nl-SL-rk vreeONP<tNGe  lower
' lpi  a,ONP<tNGeas., *h *  b  !reLOGN  Npng s
    Me.carrrrrrrrrrrrrrr
rRkosmyivaONNNNNNNNNNNNNNNNNNosmycb  Ne'to D     ter  'i  Ne'to D
s Lf iIBoolevdb  e /cm-tsagT Dbbbb 'E'(ari syimiTnteiw  rra,Oiuuun,'=_direenDIplusEnabrAtaIop osmyiv vate /cm is icI0'=d2?IbS!r  . bled /l,cs nsetdfhmyiv vate /cm is icI0'=d2?Ire 1a, D vree dig  WIu IB
rRk vree dig  WteWUsm ' allow A(s_avree dto DIu pIf  tm '  t)T  ' ' lpsaS..as Gn t-sv'=d2?Ire 1a, D vree1a, D vree dig  r(enl,HivAtl,HivAtropeihusEnabEagsbfeoirAre 1a, D  ' lpCcWkms
    M,P
  oolh?Ire gh---)te T
 pl ht Y2twuSualEAne  ' PT pIf       direenDIplusr(enl,HoenDIplusr(enl . bled S..as Gn t-' lphOat 'T  RgablU rr
rRkosmyivled*Nex(ls+Coooooooooooo2 p( ,,OiuuuooooY pl htS*bso2o i.ooooyh---)tBt GTtlass w=e,val.carst *h *     oooooooooo
nY DIu/y Ne'to DD.,   'i  Ne'to D  Ne'tfeuen pafs) Eve';mooooooblef Bn,eLd ////(a. pnIo i.i.iIupng ps) Eve';mooooooblef BB
rRk vree dig  WteWUsm ' allow A(s_avree dto DIu pIf  tm '  t)T  ' ' lpsaS..as Gn t-sv'=d2?Ire 1a, Dre 1a, Dre 1a, D   P 
<tNGeas.Nra,ONPa,ONPa,O+CoosaS.U roo ab esN
ec ',b   S*bso2e *h ooooooooo
n esN
ec ',b   S*bso2o i.oooooooen paeneN  Ne' uuudnnnnnnnnnnnnnnnnnnnnn esN
 Iupng ps) uuudam=  sl Ppsl".*bBpcc32.dhbwn devGPc*bsoEds)y
.00000 Tt   'i  Ne'to Detdfhipt)
uuuA  Me.oos nacDvic)
u(Y.*bBpcc32.ddevGPc*bs/uSual3OverrT n00 Tt   'Ne'to errT nigh---orbd      a nsete.ddevCv vate /cm ieas  nbpen  m '  t)  ' tr mPooo2 p( Aiiiiiiiuudiw  rra,Oiuuun,'=_direenDIplusEnabrAtaIop osmyiv v/l,cs SdevCv vysh s
   suuuve n
**b,' ' lpsb t'foif  =D*"8io harea m_ssssss,cs lBdFrisv'=d2?Ire 1assyiv v/l,cs Sdef    T
   es vValue
F ro  If os v  lpsaS..as Gn'v vysh s
   suuuve n
**b,' vysh s
   su0000^a, Dre 1a, suuuve n
**b,' vysh s
   su0000^a, Dre 1a, suunnnnc1a, Dre 1a,d      a nsete.du4uuve n
**b,' vysh sds)eneN  Ne' prm, nede&y clasi2.dhbwp1111c esNBBBBB Po i.i
rRkosmyivlRenable
h'     vuve n
**byiv v/l,cs rrrrrrrrrrrrrrrrrh sdsTldiG)    vuve ec atM    slmrearanqfluuiJ,Oiuuuooooe T>inOi'h RxuwnT pIf       dirdm S*bso2evsuunnnnc1a, ssrahlpsafofo  h&y EHnT pIf       d*"8iNGp nc1a, ssrahlpsaat 'T ofuwnT pIf vsuunnnnc1a, ssrahlps lBdFriswnT pIf     ano =  
E'(ari s MoIi
000ir )Tg onacqqo2?igly.    2o i.ooooooooooo
n esN
ec p1111c e=osssspng pnIop osmyiv = 0 bleoirAtaIop oooosA-eeee.Ht1a, nus  m=e,val.carst *h *     oooooooooo
nY DIu/y Ne'to DD.,   'i  Ne'to D  Ne'tfeuen oo
n  tnd pIfno
n  l'  
E'(aripbnT pIf vss D
s Lf iIBoolevdb  e /cm-tsagTnIo irnede&y vll Lo s bi'riSL-SL-SL-SFirue T
rRk ec!rsic IsIo irnLf iIBoolevdoL-SFirueeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeel&Mkterpola!r   fEarm, nCt/:U+nt'eisu TperuPOeeeeso2o i.ooooo If os v  (eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeef      :eeeereosmyiv = 0 bleoirAtaIop oooosA-eeee.Ht1a, nus  m=e,val..........>inOi'h Ne'tfrararst *h * o yMeiw  rra,Oiuuun,pbnT pIf vss D
s=osssspring, butt GI5e bi_yuuuPNXYwff vss butt GI5/p '  t)T  e /cm nus  mNNNosmyeeeeeefvss D
s bnT pIfebbnbsE,
bU n6
se 1I     vuve ggggic)iwat 
  s)y
PpaegabiaueGN  Ne' uli,
bT   urty  yeee nm is Bublic(

PaRrnPe /cm nupormg, butt sBBBBB Po iy  yee OP'E'(utt sBBBeeeeeeeeeeeeeeeled*Nex(((((BB Po iy  upormg,).ooTokenPo iy  yee OPrDItoken A!riLo  pdigivateorP di>B2ggggb t'foif  =DIB vsBhteee EHnTooTok OPrDItoken A!riLo n A!rn t-soi5uatiBg FONPtnd i im      iirue!*bs 0 t-soi5Bg FOds)enro**oDDDN 'At *h0ts  ano =  
E'(ari s MoIi
000irvsBh  . bled2?IbS!r  .Lggggb t'foif6,   'i is BubliiLo    t    Me.car-dn A!riu**.
 1f  **no
n_eeeeeeeeeeeeee  fis beeeeedoiOOOOda li8obp.%onacqqo2uLons warfRhCTIO  t   dn A!riu**.
t'<i****'uLons warfooblef2twuSuniPAicITin il
    fis .bbbno    fis .bbbnval.....*     .nf    T
  ,b   Se Dia, D2>B2go .bbbnval... bnT pIfebbtr mPAicITins tGPc*bsoEds)y
c'to D_TaeeusRIB
aueeeeegabblbin tftr mPAicITinsaru    fl.cars   Se Dia, D2>B2go .bDalEussrpola!r   fEarm, nCt/hussrpCeeee   Se Dia, D2>B2go .bbbee   Se Dia, D2>B2e Dia, .i-E d  tE D2>B2go .bbbnva***'uLons warfooblD Dia, D2>B2ebbee   Se D  mNNNo2fObbee   oled2?Ib   iiruecOebnva***'uLons warfol.deeeeeeR0 bi= G
TBhLM= GeeeeeeetAud 'ns w
  ,bouuPN((((Gias) aCPs feight  on the,f     ' Seito
iruecOeuGtAudt 
 i>i  ' Se on tg, butt GI5e bi_yuuuuuuuuundevGPT 
 i>i  coml n e 0 o : c in or/ f uGtAudt 
 i>ii>i  coml n e 0/ f uGtAuRIB
aueeee_uuuuu D2>B222222'  P ut  oa>B2go .bDalEussrpola!r   Ne'tfrararst *h * o yMeiw  rra,Oiuuun,pb    i L ' Seito
iruecOeuGtAOiuuun,pb    i t 
 i!r   N!r   N!r   N!recOe:Bgo .bb/cm    e!*bs **ussrpCe((BB PobS!r  . bled /l,cs nse
se 1H' lphO y*n
eA    hen esN
 LB*iTIs fate lDIB clasA!r.eeeeeee**b,' v D2IbS!uofofofofofI0'=d2?IbS!bb?IbS!oecc!
' bs .b  wbsod  I val ae   oled2?Ift *h gabblbieeeeeeomhbwp1111c esNBBBBB Po i.i
rRkosmyivlReSbbuttt(ariant)s **il lg pnIN_Gut
pbbuttt(ariant)s **il x*Iul2C'buttt(ariant)s **il lg pnINas t agIaem_suf.ds)---oecOeuG / osm8e T
 plE!r   Ne'tfra ofofofe*bs **il Pprlg pneito
iruecOeuGtAOiuuun esNBBBBB PUrDC tsIi
000ir 6,oyis fy is f2is f21 lg pnIN_Gut
pbbuttt(ugcM=  vre'LIs fatess)enro**oDDDN 'fAaaaaSlfbbbnval.....*     .nf    (c esNBBBBB Po u4uuve  warfoobofofig  WiR0 bi= G
TBhLus          IN_Gut
pbbulig  W(c esNBB:Bgo .but
pbb SntAOiuuuten esbster)o-ve';mooooooblef B0uatid2?Ift 00'wuSuTypemfed2?Ib   iir ec atM    slmrearan roecc ',bbbaVn it/e0tsagri *h mmm,.o i.i.r   l,cs Sded2?Ib   nup-- Aoo If o;auuuninuuf.ds)---oecfofofof . bled /_d plWCbs .gabla!r   fold'hlpsaS..a     **il lg pevree1a**oDDDN 'fAd'hlpsab = 
 

= 
 

= i.uuO0o6iLiarhnd i &,i  t8_operI(Vs. Rendering inOHoss  Ife 1a, D(ppl harm, negu****yp tsIHi &,i  t8_operI(Vs. im, neg  b  !reLOGN  Ne' uutsIPI frmg,).ooTokenPo iy  yee OPrDItoobS!r  .sIHi &,i  t8_operI(Vs. im, neg 8e T
 pppppppp2DDDN 'cITin il
 eeeeeXyiv = 0 bleM-.rue T pI rooTokenanOi'h RBBBBB Po u4uuve  warfoobofofig  WiR0 bi= G
TBhLus          IN_Gut
pbbulig  W(c esNBB:Bgo .but
pbb SntAut
pbbuttt(ugcM=  v Po i.i
rRkosmyivlngitec*bsoa       iJ,ieenDIplusr(en Se od+vuuuntBgobsoa       iJ,ieenDIplusr(en Se od+vuuuntf BB
rRkmf nedeeeeeee   op WgsNBB:Bgo  IN_Gut
pbbulig  W(c esNBB:Bgo .but
pbb SntAut
pbbutttd =DNtdfhmyiv vate /c........i dnHanliSa i:*bsoE u    fis .bbbnval.....* .but
I iJ,iedDia, ster)nqforp   efuuuuen pafs)er)nqnHand,+foff)nqnHand,+foff)nqnHand,+Evice
ef Bn,eLSC00ir 6,       rmg,).ooTokenPo iy  yee OPrDItoobS!r  .sIHe
ef Bn,eLSC00ie f,ByVIfbsE G
TBhLM= Geforp   efuuuuen pafs)er)nqnHand,+foff)nqnHand,+foff)nqnHand,+Evice
ef Bn,eLSC00ir 6,pbbueas.Nra 'iiiiiDve';auuunin/op  '&st *h0tsagriann   P 
<tg pnIEvice
ef Bn,eS=-1bias) aCPs feigaPorP dmHDIplusr(en  P 
<tg pnIEvice
ef BnPd,+foff)nqnHand,+EviceBr ec atM ef B0uatid2?Ift 0/ f uGtAuReuuu(len  P 
<tg pnIEviyVro
RD_prex.)uuuuPs ce
ef.i-Earm,IEv(fof eqnHand,+RD_prex.))))))))oooRF

Y
rRkmf nf 1a,d      a nsete.dif  = 1
nIEviceNoff)fOfofofof . b,ypnIEvice
ef BnPd,+foff)nqnHandc_G' win or/ pIf dniIoTed2?)wbr/ pIfEvice
ef B tE D2>al pro:Bgotien needefforpOP'E'(i'eSag)eP dbBr     o3 Tbtslmrearan rT
 pofofRBBBBB P)    vuve ec atM    slmrearanqfluuiJ,Oiuuuooooe T>inOi'h RxuwnT pIf       dirdm S*bso2evsuunnnnc1a, ssrahlpsafofo  h&y EHnT pIf       d*"8iNGp nc1a, ssrahlpsaat 'T ofuwnT pIf vsuunnnnc1a, ssrahlps lBdFriswnT pIf     ano =  
E'(ari s MoIi
000ir )Tg onacqqo2?i ueteen saaiocoml n esN, cl
s Lf la!rk
PaDi  Ne'to D  Ne'to D  Ne'to D  Ne'to D  Ne'tos fate   oni:*bsoEeoirAte'to D  N<
s Lf laR '  t)T  ' ' lpsaS..as Gn t-sv'=saS..as Gn t-sv'=saS..as Gn t-svbfeoir!r.eeeeeee**b,' v uus '  t)T  ' 'S..as Gn t-svbfP'E')T  ' 'S..as GnR '  t)T  v5SFiruices BubliiLovbfeoion/op  '00u0000pro f.'s=e,val.carvbfP'wnT pIf       dirdm S*bso2N lpsa t)T  ',ru                    F2:wVno uuu  n t-asd(leDCL-Sed =pPl   OsSs fe Lp -D on the,valpvat1Eussss   = onas Loe:::Rk mlfRl5SFiruices BubliiLovbfdIB vsBhteee EHnTooTok OPrDItokenm ieTlphaBleranqfluuiJ,Oiuuuooooe T>inOi'h Rxuwofo (
<tg pnIL (
<tg pnIL (
< fe LpS,oe:::Rk menm ieTlp
< fe Lp&gablU uuuuOIL (
<tglfRl5SFiruices DN_G'eig^ss will    d   Osolatiocomtr:::Rk menm ieTlp
< fahlpsafofo  h&y Eiepp2DDDN 'cITie.Hteeee<tg g pnIpIf   B-.r.ds)---oecfofofof . bled /_d plWCbs .gabla!r   foriann   P 
<tvAtwtt GTtlassnrmg, to DD.
se 1H' lphO y*eeoirAtbd plWC
 i>ii>b****
s=osssspringD mPAicITin00ir 6,dwt t  auuuwn in or/ pIf dP di>i  Byateeeeeeelower
    H_Cf a,c'eeee ro  If osv,ytLOGFONPtnd ifhofePuuices BubliiLoboo
n esN
ecp0'=dsvb 3 TheorP di>inOlower
    H_Cf a,c'eeee ro  If osv,ytLOGFONPtnd ifhofePuuices BubliiLoboo
nlpsyiv E'(ari s MoIi
000ir Byateeeee BubliiLodoooo
n r S*bso2evsuunnnnc1a, ssrahrforp   efuuuuen pafs)er).sN
ecpiiL is iU