Announcement

Collapse
No announcement yet.

"Of The Bay"

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

  • Patrice Terrier
    replied
    I have been able to complete a new "Of The Bay" version 2.00, that runs on a x64 Windows OS.
    (It should also work with x32 Windows OS)

    I have added a couple of new features:
    To dynamicaly create, edit, and check for the changes you have done in the OTB file.

    For example you can change the order of the links in the OTB file, and this will change the icon location order on the dock bar.

    If you want to try it, then let me know.

    ...

    Leave a comment:


  • Patrice Terrier
    replied
    Martin,

    These are good suggestions, why not trying to add some yourself?

    The "Of The Bay" source code is available there.

    Leave a comment:


  • Martin Francom
    replied
    Patrice,
    I sure like using "OfTheBay". I recently was looking at a new note book. It's seems several companies now are supplying a "Dock"
    Dell has one that has a few features that I wished "OfTheBay" had.

    Here's a couple of suggestions:
    1) Being able to change the Icon/png OTB is using for an item, by dragging an icon/png file an dropping it on the current icon. Or to remove an icon completely by dragging it to the trash can. Possibly even drag shortcuts from explorer and drop/add them to OTB.
    2) Being able to select a divider line and place it anywhere on the OTB to separate groups of icons.
    3) Being able to re-arrange the icons on OTB by dragging them to a preferred location.
    4) Being able to show/hide desktop icons. I would like to see OTB not dependent on what icons are on the Desktop. But could add icons/shortcuts from anywhere.
    5) OTB automatically adds icons as new icons/shortcut are added to the desktop with out having to close and re-open OTB.
    6) Choice of different types of animation ei: grow, swing, bounce, rotate.

    7) On a standard resolution the OTB GUI looks pretty good, but on wide screen at a high resolution then the OTB looks too small and the text readabilty stresses the eyes. It would be wonderful if there was a selection in the setup options that would allow the user to select a size for OTB that is appropreate for the screen resolution.

    Just a couple of ideas.
    Last edited by Martin Francom; 23 Dec 2008, 04:06 AM. Reason: to add a thought

    Leave a comment:


  • Patrice Terrier
    replied
    "Of The Bay" version 1.60

    OfTheBay has been enhanced with a new menu option to create/update the "OfTheBay.OTB" file,
    that would let you customize the shorcuts with your own set of icons, or hide existing shorcut(s), and/or add new OTB shortcut(s).


    Example of "OfTheBay.OTB" file:

    Code:
    '+--------------------------------------------------------------------------+
    '|                               Of The Bay                                 |
    '|                                                                          |
    '|                         User shorcut definition                          |
    '|                                                                          |
    '+--------------------------------------------------------------------------+
    '|                                                                          |
    '|                         Author Patrice TERRIER                           |
    '|                            copyright(c) 2008                             |
    '|                           www.zapsolution.com                            |
    '|                         [email protected]                          |
    '|                                                                          |
    '+--------------------------------------------------------------------------+
    '| Build on: 12-17-2008                                                     |
    '+--------------------------------------------------------------------------+
    '
    'Use @[email protected] to match either the OfTheBay.EXE path or the ShellTo target path
    '
    'Icon:
    'Use either 32x32 or larger (will be converted to 48x48)
    'in case of 32x32 the program adds the active icon background else not.
    '
    '"ShellTo, UseLabel, IconName, WorkDir, CmdLine, EnableShortcutTrueFalse"
    '
    'EnableShortcutTrueFalse = 0 // Disable this shorcut
    'EnableShortcutTrueFalse = 1 // Enable this shorcut
    'EnableShortcutTrueFalse = 2 // To inform OTB that this one refers to the "Recycle Bin"
    '                            // you must also provide 2 icons named:
    '                            // "RecycleBinEmpy.png" and "RecycleBinFull.png"
    '
    'Replace "@[email protected]\48x48\????.png" with a custom PNG file.
    '
    '****************************************************************************
    "Ordinateur, Ordinateur, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Computer.png, , , 1"
    "c:\program files\cc hyper file\cc120hf.exe, Centre de Contrôle HF, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Control.png, @[email protected], , 1"
    "c:\program files\google\picasa3\picasa3.exe, Picasa 3, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Picasa.png, @[email protected], , 1"
    "d:\sed\sed_116.exe, PBWin9, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\PowerBASIC.png, @[email protected], , 1"
    "d:\disque_p\assigndsk.bat, Promotech, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Param1.png, @[email protected], , 1"
    "c:\program files\phoenix\bin\phoenix.exe, Phoenix, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Phoenix.png, , , 1"
    "c:\travail\sdk\template\bassbox24\bassbox.exe, BassBox24, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Woofer.png, @[email protected], , 1"
    "c:\program files\hp\quickplay\qp.exe, QuickPlay, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\QuickPlay.png, @[email protected], , 1"
    "d:\wd11-us\programs\windev11.exe, WD11 US, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\WD11.png, @[email protected], , 1"
    "c:\travail\sdk\template\moviebox2\moviebox.exe, MovieBox, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\MovieProjector.png, @[email protected], , 1"
    "c:\windev 12\programmes\windev12.exe, WinDev 12, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\WD12.png, @[email protected], , 1"
    "c:\program files\vahelp\vahelp73.exe, HelpMaker, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Vizacc.png, @[email protected], , 1"
    "c:\windev 12\zoleigest.bat, Z oleigest, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Run.png, @[email protected], , 1"
    "Corbeille, Corbeille, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\RecycleBinFull.png, , , 1"
    "c:\windows\installer\{e4ddba93-769b-49d8-ba33-8814e45ed0c1}\_40c4cb6f6690400fa04ba2.exe, HP Help and Support, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\HP.png, C:\Windows\Help\OEM\scripts\, , 1"
    "c:\windev 10\programmes\windev10.exe, WinDev 10, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\WD10.png, @[email protected], , 1"
    "c:\windev11\programmes\windev11.exe, WinDev 11, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\WD11.png, @[email protected], , 1"
    "c:\windev 10\disquez.bat, Disque Z, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\HD.png, @[email protected], , 1"
    "c:\windows\system32\cmd.exe, Prompt, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Prompt.png, C:\travail, , 1"
    "Son - Raccourci, Son - Raccourci, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Sound.png, , , 1"
    "c:\windows\installer\{5c82dae5-6eb0-4374-9254-be3319ba4e82}\skype.ico, Skype, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Skype.png, C:\Program Files\Skype\, , 1"
    "c:\vs2005\zmovieplayer\bin\debug\zmovieplayer.exe, zMoviePlayer, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\MediaPlayer.png, @[email protected], , 1"
    "c:\program files\acronis\trueimagehome\trueimage.exe, Acronis True Image Home 10.0, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Acronis.png, @[email protected], , 1"
    "c:\program files\filezilla client\filezilla.exe, FileZilla, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\FileZilla.png, @[email protected], , 1"
    "c:\travail\photocomposer\photocompo.exe, PhotoComposer, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\PhotoComposer.png, @[email protected], , 1"
    "c:\program files\blender foundation\blender\blender.exe, Blender, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Blender.png, @[email protected], , 1"
    "c:\users\administrateur\appdata\local\google\chrome\application\chrome.exe, Google Chrome, @[email protected]\48x48\????.png, @[email protected], , 1"
    "d:\photosetup\photosetup.exe, PhotoSetup, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\PhotoSetup.png, @[email protected], , 1"
    '
    'End of file.
    The link to download the file is unchanged:
    http://www.zapsolution.com/preview/OfTheBay.zip


    ...
    Attached Files

    Leave a comment:


  • Patrice Terrier
    replied
    Martin

    You can find many icons+ on this web site: www.crystalxp.net

    Then just put the name of the icon you want to use in the OTB file, and that would do it.

    ...

    Leave a comment:


  • Martin Francom
    replied
    Thanks, Patrice... That's Great.

    Very useful, pretty eye candy. I like the way it helps to clear the clutter off the desktop.

    I haven't quit figured out how to use the DoOTB more specifically where to find the icons to use. But it will be fun to play with.

    Leave a comment:


  • Patrice Terrier
    replied
    OfTheBay version 1.57

    Under request of Martin Francom, the "shorcut target path" is now shown on the dock, when you hold down the right mouse button, while hover a DockBar icon.

    Click here to download the new public version 1.57

    OfTheBay is powered by GDImage

    ...

    Leave a comment:


  • Patrice Terrier
    replied
    Marty,

    Some desktop links do not refer to a path/program, anyway i shall think of it.

    ...

    Leave a comment:


  • Martin Francom
    replied
    Patrice,
    You've done a great job with "Of the Bay".

    There would be only, one thing I would ask fo. And that is:

    Would it be possible to right click on an icon and have a tooltip pop up to show the path/program that are the target for the icon?

    Thanks... good work.

    Leave a comment:


  • Patrice Terrier
    replied
    GDImage.inc version 4.14

    Code:
    '+--------------------------------------------------------------------------+
    '|                                                                          |
    '|                               GDImage.dll                                |
    '|             Graphic control compatible GDI, GDIPLUS, OpenGL              |
    '|                                                                          |
    '|                              Version 4.14                                |
    '+--------------------------------------------------------------------------+
    '|                                                                          |
    '|                         Author Patrice TERRIER                           |
    '|                                                                          |
    '|                         copyright(c) 2005-2007                           |
    '|                                                                          |
    '|                Patrice Terrier http://www.zapsolution.com                |
    '|                                                                          |
    '+--------------------------------------------------------------------------+
    '|                  Project started on : 10-16-2005 (MM-DD-YYYY)            |
    '|                        Last revised : 12-05-2008 (MM-DD-YYYY)            |
    '+--------------------------------------------------------------------------+
    '
    '****************************************************************************
    ' CONSTANTS
    '
      $GDIPLUSIMG        = ".DIB.EMF.GIF.JPG.JPEG.PNG.TIF.TIFF.WMF."
      $GDIPLUSEXT        = $GDIPLUSIMG + "BMP.ICO."
    '
      $zLim              = "|"
      $Anti              = "\"
      $Dot               = "."
      $GDImageClassName  = "ZIMAGECTRL"  ' Class name for GDImage standard control.
      $GLImageClassName  = "ZOPENGLCTRL" ' Class name for OpenGL control.
    
    ' Internal GDImage structure being used to store details about each sprite object.
      %METADATA_SIZE   = 2048 '//See it in GDImage.inc
      TYPE ZOBJECT
          hWnd        AS LONG
          objType     AS LONG
          metacount   AS LONG
          metadata    AS STRING * %METADATA_SIZE
          'metastring  AS STRING * %METADATA_SIZE
          useFont     AS ASCIIZ * 128
          useSize     AS LONG
          fontFam     AS LONG
          curFont     AS LONG
          strFormat   AS LONG
          useARGB     AS LONG
          use3D       AS LONG
          x1          AS LONG ' x top coordinate
          y1          AS LONG ' y top coordinate
          x2          AS LONG ' window width
          y2          AS LONG ' window height
          visible     AS LONG
          order       AS LONG
          locked      AS BYTE
    
          ID          AS LONG
          Style       AS LONG
          Bitmap      AS LONG
          Region      AS LONG
          objLabel    AS STRING * 64
          xCapture    AS INTEGER ' WORD   '//4.04
          yCapture    AS INTEGER ' WORD   '//4.04
          opacity     AS BYTE ' PNG variable opacity
          scale       AS SINGLE '//2.10
          clone       AS LONG   '//2.10
          xP          AS INTEGER ' WORD   '//4.04 '//2.11
          yP          AS INTEGER ' WORD   '//4.04 '//2.11
          angle       AS WORD   '//2.11
          quality     AS BYTE   '//2.11
          flipmode    AS BYTE   '//3.00
          userotate   AS BYTE   '//3.00
          selected    AS BYTE   '//3.02
          hidden      AS BYTE   '//3.56
    
          brightness  AS BYTE   '//4.05
          contrast    AS BYTE   '//4.05
          red         AS BYTE   '//4.05
          green       AS BYTE   '//4.05
          blue        AS BYTE   '//4.05
          hue         AS BYTE   '//4.05
    
          reserved    AS STRING * 21 ' 27' 28 ' 26
      END TYPE ' 2368 bytes
    
    TYPE POINTS
      x AS INTEGER
      y AS INTEGER
    END TYPE
    '
    '****************************************************************************
    ' Version 1.00
    ' --------------------
    ' Load the GDImage.dll
    ' --------------------
    ' Must be done in the WinMain section BEFORE USING any of the GDImage function.
    ' Parameter: None
      DECLARE FUNCTION RegisterGDImageClass LIB "GDIMAGE.DLL" ALIAS "RegisterGDImageClass" () AS LONG
    ' Return:
    ' 0 = means failure, any other value means registered.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.00
    ' Default function to create a GDImage control
    ' (Alias zCreateImageCtrl)
      DECLARE FUNCTION ZI_CreateWindow LIB "GDIMAGE.DLL" ALIAS "ZI_CreateWindow" ( _
      BYVAL hParent AS LONG, _  ' The Window/Dialog container
      BYVAL x AS LONG, _        ' The control top left corner horizontal location
      BYVAL y AS LONG, _        ' The control top left corner vertical location
      BYVAL xW AS LONG, _       ' The control width
      BYVAL yH AS LONG, _       ' The control height
      BYVAL ControlID AS LONG _ ' The control unique IDentifier
      ) AS LONG
    ' Return:
    ' The handle of the newly created control
    '
    ' --------------------------------------
    ' Alternate methode using CreateWindowEx
    ' --------------------------------------
    ' Style&   = %WS_CHILD OR %WS_VISIBLE OR %WS_BORDER
    ' StyleEx& = 0
    ' CALL CreateWindowEx(StyleEx&, _
    '                    "ZIMAGECTRL", _                 ' window class name
    '                    "e:\pictures\image.png<fit>", _ ' Optional FullPathName to picture
    '                     Style&, _                      ' window style
    '                     10, _                          ' initial x position
    '                     10, _                          ' initial y position
    '                     150, _                         ' Calculate Window Width
    '                     150, _                         ' Calculate Window Height
    '                     hMain, _                       ' parent window handle
    '                     %ID_THUMBCTRL, _               ' ControlID
    '                     GetModuleHandle(""), _         ' program instance handle
    '                     BYVAL 0)                       ' creation parameters
    '
    ' ---------------------------------------
    ' Alternate methode using DDT CONTROL ADD
    ' ---------------------------------------
    '  CONTROL ADD "ZIMAGECTRL", _
    '              hDlg, _
    '              %IDC_CUSTOMCONTROL, _
    '              "e:\picture.jpg", _
    '              10, 10, 640, 480, _
    '              %WS_CHILD OR %WS_VISIBLE OR %WS_HSCROLL OR %WS_VSCROLL, _
    '              %WS_EX_LEFT OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
    '
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.00
    ' Display the common file selector dialog using thumbnail preview for the supported graphic format.
    ' (Alias zImageLoadDialog)
      DECLARE FUNCTION ZI_LoadDialog LIB "GDIMAGE.DLL" ALIAS "ZI_LoadDialog" ( _
      BYVAL hParent AS LONG _              ' The parent window handle.
      ) AS STRING
    ' Return:
    ' The FullPathName of the selected picture
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.00
    ' Display the common save to file dialog providing a valid hGDImageCtrl handle
    ' (Alias zImageSaveDialog)
      DECLARE FUNCTION ZI_SaveDialog LIB "GDIMAGE.DLL" ALIAS "ZI_SaveDialog" ( _
      BYVAL hParent AS LONG, _             ' The parent window handle.
      BYVAL hGDImageCtrl AS LONG _         ' The GDImage control handle.
      ) AS LONG
    ' Return:
    ' Successfull ErrCode& = 0
    ' Error       ErrCode
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.00
    ' Save the content of a GDImage control to any of the supported graphic format
    ' Must be a supported graphic format, see $GDIPLUSEXT.
      DECLARE FUNCTION ZI_SaveToFile LIB "GDIMAGE.DLL" ALIAS "ZI_SaveToFile" ( _
      zFullPathName AS ASCIIZ, _           ' Full path name of the graphic file to save.
      BYVAL hGDImageCtrl AS LONG, _        ' The GDimage control handle.
      OPTIONAL BYVAL JpegQuality AS LONG _ ' Optional JPEG encoding quality 1-100:
      ) AS LONG                            ' Default 0 = QalityMax = 100
    ' Return:
    ' Successfull ErrCode& = 0
    ' Error       ErrCode
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.00
    ' Set the image file to use with the control.
    ' Must be a supported graphic format, see $GDIPLUSEXT.
    ' (Alias zSetImageFromFile)
      DECLARE SUB ZI_SetFromFile LIB "GDIMAGE.DLL" ALIAS "ZI_SetFromFile" ( _
      BYVAL hGDImageCtrl AS LONG, _  ' The GDimage control handle.
      zFullPathName AS ASCIIZ _      ' Full path name to the graphic file to display
      )
    ' This function is the same than using :
    ' CALL SendMessage (hCtrl, %WM_SETTEXT, 0, STRPTR(FullPathName$))
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.00
    ' Set property of a GDImage control
    ' (Alias zGetProperty)
      DECLARE FUNCTION ZI_GetProperty LIB "GDIMAGE.DLL" ALIAS "ZI_GetProperty" ( _
      BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
      BYVAL nProperty AS LONG _     ' A %ZI_ predefined constant (see the list below)
      ) AS LONG
    ' Return:
    ' The matching property value
    '
    ' Get property from a GDImage control
    ' (Alias zSetProperty)
      DECLARE SUB ZI_SetProperty LIB "GDIMAGE.DLL" ALIAS "ZI_SetProperty" ( _
      BYVAL hGDImageCtrl AS LONG, _ ' The control handle.
      BYVAL nProperty AS LONG, _    ' A %ZI_ predefined constant (see the list below)
      BYVAL Parameter AS LONG _     ' A parameter matching the type of property to set.
      )
    '
    ' See below the list of GDImage properties:
    ' Note: Constants prefixed with %ZI_ are for IMAGE control
      %ZI_DC             = 1  ' Internal DC
      %ZI_Bitmap         = 2  ' Memory Bitmap
      %ZI_Horizontal     = 3  ' Horizontal scrolling position
      %ZI_Vertical       = 4  ' Vertical scrolling position
      %ZI_GradientTop    = 5  ' Top gradiant color backgroud
      %ZI_GradientBottom = 6  ' Bottom gradiant color backgroud
    
      %ZI_FitToWindow    = 7  ' Resize the image to fit the view port
                              ' And use any of this constant as Parameter
                               %ZI_QualityDefault = -1
                               %ZI_QualityGood    = 1  ' Best performance
                               %ZI_QualityHigh    = 2  ' Best rendering quality
    ' DO NOT use or alter these properties!
      %ZI_PaintDC        = 8  ' Internal DC
      %ZI_PaintBitmap    = 9  ' Memory Bitmap
      %ZI_Reserved       = 10 ' Animated frame parameters : LOWRD = FrameWidth, HIWRD = FrameCount
    
      %ZI_ZoomWindow     = 11 ' Version 1.41
      %ZI_ZoomFactor     = 12 ' Version 1.41
      %ZI_Orientation    = 13 ' Version 1.41
    
      %ZI_FlagByte       = 14 ' Version 2.00 4 bytes reserved for flag
          %TOOL_CROP     = 1          ' Stored in the first byte
          %TOOL_CUTTER   = 2          ' Stored in the first byte
          %TOOL_PENCIL   = 4          ' Stored in the first byte
          %TOOL_FLOOD    = 8          ' Stored in the first byte
          %TOOL_AIRBRUSH = 16         ' Stored in the first byte
          %TOOL_PIPE     = 32         ' Stored in the first byte
          %TOOL_MOUSE    = 64         ' Stored in the first byte
          %TOOL_UNKNOWN  = 128        ' Stored in the first byte
    
      %Extend_cbWndExtra = %ZI_FlagByte ' %ZI_Orientation ' %ZI_Reserved
    
      %ZI_GDIPLUSHANDLE  = 1  ' Load GDIPLUS Image handle
    
      %ZD_MAPCOLORFROM   = &h807F80   ' Maping color for 32-bit alphablending
      %ZI_MAPCOLORFROM   = &hFF807F80 ' Maping color for 32-bit alphablending
      %ZI_MAPCOLORTO     = &hFF808080 ' Maping color for 32-bit alphablending
      %ZI_MAPCOLORNULL   = &h00807F80 ' Maping color for 32-bit alphablending
      %ZI_MAPTRANSCOLOR  = &h807F80   ' Transparent maped color for 32-bit alphablending
    '
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.00
    ' Paint the background of a GDImage control
    ' see property %ZI_GradientTop
    ' and property %ZI_GradientBottom
    ' (Alias zGradientPaintDC)
      DECLARE SUB ZI_GradientPaintDC LIB "GDIMAGE.DLL" ALIAS "ZI_GradientPaintDC" ( _
      BYVAL hDC AS LONG, _      ' A Windows DC (do not use ZI_GetDC except if you want to paint over the image)
      BYVAL x AS LONG, _        ' The top left corner horizontal location
      BYVAL y AS LONG, _        ' The top left corner vertical location
      BYVAL xW AS LONG, _       ' The width
      BYVAL yH AS LONG, _       ' The height
      BYVAL TopRGB AS LONG, _   ' The RGB color to use for the top
      BYVAL BottomRGB AS LONG _ ' The RGB color to use for the bottom
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.00
    ' Retrieve bitmap size from a supported GDI+ disk file (do not load the image)
    ' (Alias zGetImageSize)
      DECLARE SUB ZI_GetImageSizeFromFile LIB "GDIMAGE.DLL" ALIAS "ZI_GetImageSizeFromFile" ( _
      zFullPathName AS ASCIIZ, _      ' The name of the graphic file to detect size
      imgWidth AS LONG, _             ' Width of the picture
      imgHeight AS LONG _             ' Height of the picture
      )
    ' See: ZI_AdjustWindowRect to adjust the client size of a GDImage control.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.00
    ' Get the private DC of GDImage control
      DECLARE FUNCTION ZI_GetDC LIB "GDIMAGE.DLL" ALIAS "ZI_GetDC" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
      ) AS LONG
    ' Return:
    ' The private DC of the GDImage control
    ' You can use this DC to draw on the GDImage memory bitmap using standard GDI command.
    '
    ' DO NOT release this DC and AVOID to use DELETEDC on it!
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.04
    ' Get the GDImage.dll internal version number
    ' (Alias zGDImageVersion)
      DECLARE FUNCTION ZI_Version LIB "GDIMAGE.DLL" ALIAS "ZI_Version" () AS STRING
    ' Return:
    ' The version number of the form "#.#"
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.04
    ' Copy image to clipboard.
    ' (Alias zClipboardCopy)
      DECLARE FUNCTION ZI_ClipboardCopy LIB "GDIMAGE.DLL" ALIAS "ZI_ClipboardCopy" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
      ) AS LONG
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.04
    ' Paste image from clipboard.
    ' (Alias zClipboardPaste)
      DECLARE FUNCTION ZI_ClipboardPaste LIB "GDIMAGE.DLL" ALIAS "ZI_ClipboardPaste" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
      ) AS LONG
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.05
    ' Compute the client size for a specific GDImage control
    ' that will match exactly the picture size
      DECLARE SUB ZI_AdjustWindowRect LIB "GDIMAGE.DLL" ALIAS "ZI_AdjustWindowRect" ( _
      BYVAL StyleEx AS LONG, _ ' The CreateWindowEx Extended Style.
      imgW AS LONG, _          ' Width of the image.
      imgH AS LONG, _          ' Height of the image.
      BYVAL Style AS LONG _    ' The CreateWindowEx Style.
      )
    ' See: ZI_GetImageSizeFromFile to get an image size without loading it.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.05
    ' Set the value for the alpha channel of GDImage layered window.
    ' Note: A layered window MUST use the POPUP style.
      DECLARE FUNCTION ZI_SetLayeredAlpha LIB "GDIMAGE.DLL" ALIAS "ZI_SetLayeredAlpha" ( _
      BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
      BYVAL TransLevel AS BYTE _    ' The translucency level ranging from 0 to 255
      ) AS LONG
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.06
    ' Create a window using a transparent color to build a region on the fly
    ' You can use this command with either a POPUP or CHILD window .
      DECLARE FUNCTION ZI_CreateWindowFromImage LIB "GDIMAGE.DLL" ALIAS "ZI_CreateWindowFromImage" ( _
      BYVAL Style AS LONG, _           ' The CreateWindowEx Style.
      zFullImagePath AS ASCIIZ, _      ' The name of an image file.
      BYVAL x AS LONG, _               ' The top left corner horizontal location
      BYVAL y AS LONG, _               ' The top left corner vertical location
      BYVAl hParent AS LONG, _         ' The main window parent handle
      BYVAL UseID AS LONG, _           ' Warning, DO NOT use an ID when using the %WS_POPUP style.
      BYVAL StyleEx AS LONG, _         ' The CreateWindowEx Extended Style.
      BYVAL UseTransColor AS LONG _    ' The transparent color that will be used to create the region.
      ) AS LONG
    ' Return:
    ' The new window handle or NULL if error.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.07
    ' To retrieve the image size of specific GDimage control
      DECLARE SUB ZI_GetImageSizeFromControl LIB "GDIMAGE.DLL" ALIAS "ZI_GetImageSizeFromControl" ( _
      BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
      imgW AS LONG, _               ' Width of the picture.
      imgH AS LONG _                ' Height of the picture.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.07
    ' To force immediate refresh of a GDImage control display
      DECLARE SUB ZI_UpdateWindow LIB "GDIMAGE.DLL" ALIAS "ZI_UpdateWindow" ( _
      BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
      BYVAL EraseFlag AS LONG _     ' Boolean flag to erase first the background.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.11
    ' To anchor a GDImage control to a specific location when resizing parent window
    ' See: ANCHOR.GIF
      DECLARE FUNCTION ZI_SetAnchorMode LIB "GDIMAGE.DLL" ALIAS "ZI_SetAnchorMode" ( _
      BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
      BYVAL AnchorMode AS LONG _    ' The anchor mode (see below)
      ) AS LONG
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error
    '
    ' Version 1.12
    ' The function has been enhanced to anchor any type of control:
    ' button, static, edit, listbox, etc.
    '
    ' ANCHOR Flags:
      %ANCHOR_NONE                = 0
      %ANCHOR_LEFT                = %ANCHOR_NONE
      %ANCHOR_WIDTH               = 1
      %ANCHOR_RIGHT               = 2
      %ANCHOR_CENTER_HORZ         = 3
      %ANCHOR_HEIGHT              = 4
      %ANCHOR_HEIGHT_WIDTH        = 5
      %ANCHOR_HEIGHT_RIGHT        = 6
      %ANCHOR_BOTTOM              = 7
      %ANCHOR_BOTTOM_WIDTH        = 8
      %ANCHOR_BOTTOM_RIGHT        = 9
      %ANCHOR_CENTER_HORZ_BOTTOM  = 10
      %ANCHOR_CENTER_VERT         = 11
      %ANCHOR_CENTER_VERT_RIGHT   = 12
      %ANCHOR_CENTER              = 13
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.15
    ' Convert COLOR to 256 shade of GRAY
      DECLARE FUNCTION ZI_ConvertToGray LIB "GDIMAGE.DLL" ALIAS "ZI_ConvertToGray" ( _
      BYVAL hGDImageDC AS LONG _  ' A GDImage DC (ZI_GetDC) or any DC using an associated memory bitmap
      ) AS LONG
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.15
    ' Replace a RGB color with another RGB color, using a Device Context handle
      DECLARE SUB ZI_ReplaceRGBColor LIB "GDIMAGE.DLL" ALIAS "ZI_ReplaceRGBColor" ( _
      BYVAL hGDImageDC AS LONG, _  ' A GDImage DC (ZI_GetDC) or any DC using an associated memory bitmap
      BYVAL WasRGBColor&, _        ' The RGB color to replace
      BYVAL NewRGBColor& _         ' The new RGB color to use
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.15
    ' Compute the number of unique color(s) of an image shown in a GDImage control.
      DECLARE FUNCTION ZI_ColorCount LIB "GDIMAGE.DLL" ALIAS "ZI_ColorCount"( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDImage control handle
      ) AS LONG
    ' Return:
    ' The number of unique color(s) being used in the image.
    ' Note: Overlay objects are not considered in the computation.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.15
    ' Print image only, self centered on the paper sheet.
    ' Print will fit the paper size
      DECLARE FUNCTION ZI_PrintImage LIB "GDIMAGE.DLL" ALIAS "ZI_PrintImage" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDImage control handle
      ) AS LONG
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.15
    ' Print image + annotation, self centered on the paper sheet.
    ' Print will fit the paper size
      DECLARE FUNCTION ZI_PrintFull LIB "GDIMAGE.DLL" ALIAS "ZI_PrintFull" ( _
      BYVAL hGDImageCtrl AS LONG _
      ) AS LONG
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.15
    ' Read image from a provided text buffer (STREAMING)
      DECLARE FUNCTION ZI_LoadImageFromStream LIB "GDIMAGE.DLL" ALIAS "ZI_LoadImageFromStream" ( _
      BYVAL hGDImageCtrl AS LONG, _        ' The GDImage control handle.
      BYVAL pBufferData AS BYTE PTR, _     ' Pointer to buffer holding data.
      BYVAL BufferSize AS LONG _           ' Size of the buffer.
      ) AS LONG
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.17
    ' To load any of the supported graphic format as a program resource
    ' directly to a GDImage control as background.
      DECLARE FUNCTION ZI_LoadFromResource LIB "GDIMAGE.DLL" ALIAS "ZI_LoadFromResource" ( _
      BYVAL hGDImageCtrl AS LONG, _        ' The GDImage control handle.
      zResourceName AS ASCIIZ _            ' The resource name identifier.
      ) AS LONG
    ' Return:
    ' IF the GDImage control handle is omited the returned parameter is a Bitmap handle.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.17
    ' To GET the Width and Height of a STANDARD BITMAP
      DECLARE SUB ZI_GetBitmapSize LIB "GDIMAGE.DLL" ALIAS "ZI_GetBitmapSize" ( _
      BYVAL hBitmap AS LONG, _   ' Handle to a standard bitmap.
      BitmapWidth AS LONG, _     ' The width of the bitmap.
      BitmapHeight AS LONG _     ' The Height of the bitmap.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.17
    ' Create a valid GDI BITMAP handle from FILE using any of the supported GDImage format.
      DECLARE FUNCTION ZI_CreateBitmapFromFile LIB "GDIMAGE.DLL" ALIAS "ZI_CreateBitmapFromFile" ( _
      zFullImagePath AS ASCIIZ, _      ' The name of an image file.
      BitmapWidth AS LONG, _           ' The width of the bitmap.
      BitmapHeight AS LONG _           ' The Height of the bitmap.
      ) AS LONG
    ' Return:
    ' A valid GDI bitmap handle (do not confuse GDI bitmap handle and GDI+ Image handle).
    ' Important:
    ' You must use DeleteObject(GDIBitmapHandle) when you do not need it anymore.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.17
    ' To load the specified bitmap resource from the module's executable file.
    ' The resource can use any of the supported GDImage graphic format.
    ' (See RESOURCE.RC example)
      DECLARE FUNCTION ZI_LoadBitmap LIB "GDIMAGE.DLL" ALIAS "ZI_LoadBitmap" ( _
      zResourceName AS ASCIIZ _            ' The resource name identifier.
      ) AS LONG
    ' Return:
    ' A valid GDI bitmap handle (do not confuse GDI bitmap handle and GDI+ Image handle).
    ' Important:
    ' You must use DeleteObject(GDIBitmapHandle) when you do not need it anymore.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.17
    ' Create a valid GDIPLUS Image handle from FILE using any of the supported GDImage format.
      DECLARE FUNCTION ZI_CreateImageFromFile LIB "GDIMAGE.DLL" ALIAS "ZI_CreateImageFromFile" ( _
      zFullPathName AS ASCIIZ, _           ' Full path name to the graphic file to load.
      imageWidth AS LONG, _                ' The image width.
      imageHeight AS LONG, _               ' The image height.
      BYVAL RemoveARGBColor AS LONG, _     ' Boolean flag use %TRUE to remove ARGBColorToRemove.
      BYVAL ARGBColorToRemove AS LONG _    ' The ARGB color to remove.
      ) AS LONG
    ' Return:
    ' A valid GDIPLUS Image handle (do not confuse with a GDI Bitmap handle),
    ' or NULL if error.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.17
    ' Create an empty image background (Bitmap) into a GDImage control.
    ' Use it to perform direct drawing, everything lying out of it (overlay objects) would be clipped.
      DECLARE FUNCTION ZI_CreateImageBackground LIB "GDIMAGE.DLL" ALIAS "ZI_CreateImageBackground" ( _
      BYVAL hGDImageCtrl AS LONG, _        ' The GDImage control handle.
      BYVAL BitmapWidth AS LONG, _         ' The width of the bitmap.
      BYVAL BitmapHeight AS LONG _         ' The Height of the bitmap.
      ) AS LONG
    ' Return:
    ' A valid GDImage DC (ZI_GetDC) you can use to draw in.
    ' Note: After drawing into the provided DC, use ZI_UpdateWindow to refresh the display.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.17
    ' Remove a GDIPLUS Image object from memory.
      DECLARE SUB ZI_DeleteImageObject LIB "GDIMAGE.DLL" ALIAS "ZI_DeleteImageObject" ( _
      hImage AS LONG _                     ' A valid GDIPLUS Image handle
      )
    ' Comment:
    ' Use it as you would do with DeleteObject for a standard BITAMP handle.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.17
    ' Perform image rotation in the specified DC, using a GDIPLUS Image handle.
      DECLARE SUB ZI_RotateImage LIB "GDIMAGE.DLL" ALIAS "ZI_RotateImage" ( _
      BYVAL hDC AS LONG, _                 ' A valid Device Context
      BYVAL hImage AS LONG, _              ' A valid GDIPLUS Image handle
      BYVAL x AS LONG, _                   ' The X coordinate
      BYVAL y AS LONG, _                   ' The Y coordinate
      BYVAL AngleDegree AS LONG, _         ' The rotation angle in degree to use
      BYVAL UseAlpha AS LONG _             ' The Alpha channel value (use 255 for standard opaque mode)
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.17
    ' Render GDIPLUS Image rotation into a specific GDImage control.
      DECLARE SUB ZI_RenderImageRotationToWindow LIB "GDIMAGE.DLL" ALIAS "ZI_RenderImageRotationToWindow" ( _
      BYVAL hGDImageCtrl AS LONG, _        ' The GDImage control handle.
      BYVAL hImage AS LONG, _              ' A valid GDIPLUS Image handle.
      BYVAL x AS LONG, _                   ' The X coordinate.
      BYVAL y AS LONG, _                   ' The Y coordinate.
      BYVAL AngleDegree AS LONG, _         ' The rotation angle in degree to use.
      BYVAL UseAlpha AS LONG _             ' The Alpha channel value (use 255 for standard opaque mode).
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.18
    ' Use a Bitmap to paint a tiled background in a specific GDImage control.
    ' Bitmap can provide from file or resource using any of the GDImage supported graphic format.
      DECLARE FUNCTION ZI_SetTiledBackground LIB "GDIMAGE.DLL" ALIAS "ZI_SetTiledBackground" ( _
      BYVAL hGDImageCtrl AS LONG, _        ' The GDImage control handle.
      BYVAL UseBitmap AS LONG _
      ) AS LONG
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.18
    ' Retrieve the Bitmap handle being used to tile a background in a specific GDImage control.
      DECLARE FUNCTION ZI_GetTiledBackground LIB "GDIMAGE.DLL" ALIAS "ZI_GetTiledBackground" ( _
      BYVAL hGDImageCtrl AS LONG _         ' The GDImage control handle.
      ) AS LONG
    ' Return:
    ' The background Bitmap handle, or NULL if there is no tiled background.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.19
    ' Retrieve a copy of the entire bitmap for the selected GDImageDC,
    ' using a 2 dimensions array of the form (x,y) pointing directly to pixel.
    ' You can use the array coordinates as you would do with a standard DC,
    ' because pixel 0,0 is at coordinate Array(0,0).
    ' Once your are done with the array, the bitmap is replaced using ZI_SetDIBits.
    ' (see ZI_SetDIBits)
      DECLARE FUNCTION ZI_GetDIBits LIB "GDIMAGE.DLL" ALIAS "ZI_GetDIBits" ( _
      BYVAL hGDImageDC AS LONG, _              ' Any memory bitmap Device Context (like ZI_GetDC).
      PixelArray() AS LONG _                   ' Array using 2 dimensions (Y,Y) matching the pixel coordinates.
      ) AS LONG
    ' Return:
    ' Null if error, else success.
    ' Comment:
    ' Each pixel use ARGB color of the form Alpha, Red, Blue, Green (reading from left to right).
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.19
    ' Replace a copy of a bitmap that was retrieved as a device-independent bitmap.
    ' (see ZI_GetDIBits)
      DECLARE FUNCTION ZI_SetDIBits LIB "GDIMAGE.DLL" ALIAS "ZI_SetDIBits" ( _
      BYVAL hGDImageDC AS LONG, _              ' Any memory bitmap Device Context (like ZI_GetDC).
      PixelArray() AS LONG, _                  ' Array using 2 dimensions (Y,Y) matching the pixel coordinates.
      OPTIONAL BYVAL DoNotClearArray AS LONG _ ' Boolean flag, %TRUE = DO NOT clear the array
      )AS LONG
    ' Return:
    ' Null if error, else success.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.22
    ' Delete the memory bitmap and device context associated to a GDImage control.
      DECLARE FUNCTION ZI_DeleteControlBitmap LIB "GDIMAGE.DLL" ALIAS "ZI_DeleteControlBitmap" ( _
      BYVAL hGDImageCtrl AS LONG _        ' The GDImage control handle.
      ) AS LONG
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error
    '****************************************************************************
    '
    '****************************************************************************
    ' Load a graphic file and Resize it on the fly to create a Bitmap matching a specific size.
    ' Version 1.26
      DECLARE FUNCTION ZI_FitImageFromFile LIB "GDIMAGE.DLL" ALIAS "ZI_FitImageFromFile" ( _
      zFullPathName AS ASCIIZ, _      ' The name of the graphic file.
      BYVAL BoundWidth AS LONG, _     ' The bounding width.
      BYVAL BoundHeight AS LONG _     ' The bounding height.
      ) AS LONG
    ' Note:
    ' The image will be stretched to match the bounding size, however keeping the original aspect ratio
    ' between width and height.
    ' Return:
    ' A valid GDI bitmap handle (do not confuse GDI bitmap handle and GDI+ Image handle).
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.36
    ' To render a GDIPLUS image rotation into a provided bitmap handle.
      DECLARE FUNCTION ZI_RenderRotationFromImageToBitmap LIB "GDIMAGE.DLL" ALIAS "ZI_RenderRotationFromImageToBitmap" ( _
      BYVAL SrceBitmap AS LONG, _  ' A valid GDImage bitmap handle.
      BYVAL Img AS LONG, _         ' A valid GDImage - GDIPLUS handle.
      BYVAL AngleDegree AS LONG, _ ' The angle rotation in degree.
      BYVAL UseAlpha AS LONG _     ' The alpha channel value in the range (0-255).
      ) AS LONG
    ' Return:
    ' A new bitmap handle that combines the GDImage Bitmap and the GDIPLUS Image handle together.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.37
    ' Display an image using a grayed mask to perform gradient translucency
      DECLARE SUB ZI_DrawAlphaBlend LIB "GDIMAGE.DLL" ALIAS "ZI_DrawAlphaBlend" ( _
      BYVAL hDCDest AS LONG, _    ' A valid Device Context.
      BYVAL x AS LONG, _          ' The X coordinate.
      BYVAL y AS LONG, _          ' The Y coordinate.
      zImage AS ASCIIZ, _         ' Full path name to the graphic file to load.
      zMask AS ASCIIZ _           ' Full path name to the grayed mask graphic file.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.06 & 4.10
    ' Save a memory Bitmap to any of the supported graphic format
    ' Must be a supported graphic format, see $GDIPLUSEXT.
      DECLARE FUNCTION ZI_SaveBitmapToFile LIB "GDIMAGE.DLL" ALIAS "ZI_SaveBitmapToFile" ( _
      zFullPathName AS ASCIIZ, _           ' Full path name of the graphic file to save.
      BYVAL hBitmap AS LONG, _             ' Bitmap handle.
      OPTIONAL BYVAL JpegQuality AS LONG _ ' Optional JPEG encoding quality 1-100:
      ) AS LONG                            ' Default 0 = QalityMax = 100
    ' Return:
    ' Successfull ErrCode& = 0
    ' Error       ErrCode
    '****************************************************************************
    '
    '****************************************************************************
    '****************************************************************************
    '****************************************************************************
    '***                                                                      ***
    '***                           DRAWING FUNCTIONS                          ***
    '***                                                                      ***
    '****************************************************************************
    '****************************************************************************
    '
    ' CONSTANTS prefixed with %ZD_ apply to DRAWING functions
      %ZD_TRANSCOLOR = &HFF00FF   ' Magenta color that is the default GDImage transparent color
      %ZD_TOPLEFTCOLOR = -1       ' Pixel color at location 0,0
    '
    ' ZD_DrawText constants
    ' Version 1.09
      %ZD_TextHorzUp = &H0        ' Horizontal text orientation
      %ZD_TextVertUp = &H1        ' Vertical text orientation from bottom to top
      %ZD_TextVertDn = &H2        ' Vertical text orientation from top to bottom
      %ZD_HIDE       = &H0        ' FALSE
      %ZD_SHOW       = &H1        ' TRUE
    
    ' GDImage overlay Generic STYLE must be a 2^
      %ZS_HIDDEN     = %ZD_HIDE
      %ZS_VISIBLE    = %ZD_SHOW   ' VISIBLE, same as %WS_VISIBLE
      %ZS_SCROLL     = &H2        ' MOVE with scroll bars, default is FIX (do not scroll)
      %ZS_DRAFT      = &H4        ' Draft drawing mode
    
    ' GDImage Drawing STYLE         For all ZD_Drawxxx functions
      %ZD_DRAW_OUTLINE  = 1
      %ZD_DRAW_FILLED   = 2
      %ZD_DRAW_3DIN     = 3
      %ZD_DRAW_3DOUT    = 4
      %ZD_DRAW_OPEN     = 5
    '
      %ZD_DRAW_REDRAW   = -1      ' Forces immediat redraw of parent object
      %ZD_DRAW_DEFERRED = 0       ' Defers redraw of parent object
    '
    '****************************************************************************
    ' Version 1.00
    ' Fills a rectangle using a specific RGB color.
      DECLARE SUB ZD_FillRect LIB "GDIMAGE.DLL" ALIAS "ZD_FillRect" ( _
      BYVAL hGDImageDC AS LONG, _ ' The GDImage DC (ZI_GetDC)
      BYVAL x AS LONG, _          ' The top left horizontal coordinate of the rectangle
      BYVAL y AS LONG, _          ' The top left vertical coordinate of the rectangle
      BYVAL xW AS LONG, _         ' The rectangle width
      BYVAL yH AS LONG, _         ' The rectangle height
      BYVAL RGBcolor AS LONG _    ' The RGB color to use
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.09
    ' Draw a text using a True Type Font, ARGB color, optional 3D effect and orientation
      DECLARE FUNCTION ZD_DrawTextToDC LIB "GDIMAGE.DLL" ALIAS "ZD_DrawTextToDC" ( _
      BYVAL hGDImageDC AS LONG, _          ' The GDImage DC (ZI_GetDC)
      zUseText AS ASCIIZ, _                ' The text to display
      BYVAL x AS LONG, _                   ' The X seed coordinate
      BYVAL y AS LONG, _                   ' The Y seed coordinate
      BYVAL ColrARGB AS LONG, _            ' The ARGB color to use
      zUseFont AS ASCIIZ, _                ' The "Tue Type Font" name to use
      BYVAL UseSize AS LONG, _             ' The size of the font in pixel
      OPTIONAL BYVAL UseShadow AS LONG, _  ' The shadow 3D offset
      OPTIONAL BYVAL Orientation AS LONG _ ' The text orientation (%ZD_TextHorzUp, %ZD_TextVertUp, %ZD_TextVertDn)
      ) AS LONG
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.09
    ' Compute an ARGB color to ensure compatibility with GDI+
      DECLARE FUNCTION ZD_ColorARGB LIB "GDIMAGE.DLL" ALIAS "ZD_ColorARGB"( _
      BYVAL AlphaChannel AS BYTE, _ ' The translucency level ranging from 0 to 255.
      BYVAL ColrRGB??? _            ' The classical RGB() color to use.
      ) AS LONG
    ' Return:
    ' A 32-bit ARGB color.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.09
    ' To retrieve the bounding size in pixel of specifc text using a True Type Font
    ' of a specific size.
      DECLARE FUNCTION ZD_GetTextBound LIB "GDIMAGE.DLL" ALIAS "ZD_GetTextBound" ( _
      zUseText AS ASCIIZ, _                ' The text to display.
      zUseFont AS ASCIIZ, _                ' The "Tue Type Font" name to use.
      BYVAL UseSize AS LONG, _             ' The size of the font in pixel.
      BYREF BoundingWidth AS LONG, _       ' The bounding width.
      BYREF BoundingHeight AS LONG, _      ' The bounding height.
      OPTIONAL BYVAL Orientation AS LONG _ ' The text orientation (%ZD_TextHorzUp, %ZD_TextVertUp, %ZD_TextVertDn).
      ) AS LONG
    ' Return:
    ' The width and height of the bounding rectangle that matches the text being used.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.09
    ' Create a TEXT overlay object.
    ' Each overlay object must have a unique identifier.
    ' TEXT overlay is independant of the image background that is not altered.
      DECLARE FUNCTION ZD_DrawTextToCtrl LIB "GDIMAGE.DLL" ALIAS "ZD_DrawTextToCtrl" ( _
      BYVAL hGDImageCtrl AS LONG, _        ' The GDImage control handle.
      zUseText AS ASCIIZ, _                ' The text to display.
      BYVAL x AS LONG, _                   ' Top left X coordinate.
      BYVAL y AS LONG, _                   ' Top left Y coordinate.
      BYVAL ColrARGB AS LONG, _            ' The ARGB color to use.
      zUseFont AS ASCIIZ, _                ' The "Tue Type Font" name to use.
      BYVAL UseSize AS LONG, _             ' The size of the font in pixel.
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL ZS_STYLE AS LONG, _            ' The object Generic STYLE (use at least %ZS_VISIBLE to show it).
      OPTIONAL BYVAL UseShadow AS LONG, _  ' The shadow 3D offset.
      OPTIONAL BYVAL Orientation AS LONG _ ' The text orientation (%ZD_TextHorzUp, %ZD_TextVertUp, %ZD_TextVertDn).
      ) AS LONG
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.16
    ' To change on the fly the text of a TEXT overlay.
      DECLARE SUB ZD_SetObjectText LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectText" ( _
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one)
      zUseText AS ASCIIZ _                 ' The text to display
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.10
    ' Create a RECTANGLE overlay object.
    ' Each overlay object must have a unique identifier.
    ' RECTANGLE overlay is independant of the image background that is not altered.
      DECLARE FUNCTION ZD_DrawRectangleToCtrl LIB "GDIMAGE.DLL" ALIAS "ZD_DrawRectangleToCtrl" ( _
      BYVAL hGDImageCtrl AS LONG, _        ' The GDImage control handle.
      BYVAL x AS LONG, _                   ' Top left X coordinate.
      BYVAL y AS LONG, _                   ' Top left Y coordinate.
      BYVAL xWidth AS LONG, _              ' Rectangle width.
      BYVAL yHeight AS LONG, _             ' Rectangle height.
      BYVAL ColrARGB AS LONG, _            ' The ARGB color to use.
      BYVAL BorderSize AS LONG, _          ' Size of the border (can be NULL).
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL ZS_STYLE AS LONG, _            ' The object Generic STYLE (use at least %ZS_VISIBLE to show it).
      BYVAL ZD_STYLE AS LONG, _            ' The object Drawing STYLE (see below).
      OPTIONAL BYVAL Use3D AS LONG _       ' The shadow 3D offset.
      ) AS LONG
    ' GDImage Drawing STYLE                  Drawing mode:
    ' ---------------------                  -------------
    ' %ZD_DRAW_OUTLINE                       Border only (frame mode)
    ' %ZD_DRAW_FILLED                        Fill mode
    ' %ZD_DRAW_3DIN                          Fill with 3D-IN effect
    ' %ZD_DRAW_3DOUT                         Fill with 3D_Out effect
    '
    ' Return:
    ' TRUE (-1) if visible, FALSE (0) if not
    '****************************************************************************
    '
    '****************************************************************************
    ' Create ARROW overlay object.
    ' Version 1.14
    ' Each overlay object must have a unique identifier.
      DECLARE FUNCTION ZD_DrawArrowToCtrl LIB "GDIMAGE.DLL" ALIAS "ZD_DrawArrowToCtrl" ( _
      BYVAL hGDImageCtrl AS LONG, _        ' The GDImage control handle.
      BYVAL SeedX AS LONG, _               ' Swap SeedX and TargetX to select arrow orientation.
      BYVAL SeedY AS LONG, _               ' Swap SeedY and TargetY to select arrow orientation.
      BYVAL TargetX AS LONG, _             ' Swap TargetX and SeedX to select arrow orientation.
      BYVAL TargetY AS LONG, _             ' Swap TargetY and SeedY to select arrow orientation.
      BYVAL ColrARGB AS LONG, _            ' The ARGB color to use.
      BYVAL ArrowSize AS LONG, _           ' Size of the Arrow.
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL ZS_STYLE AS LONG, _            ' The object Generic STYLE (use at least %ZS_VISIBLE to show it).
      BYVAL ZD_STYLE AS LONG, _            ' The Drawing mode.
      OPTIONAL BYVAL Use3D AS LONG _       ' The shadow 3D offset.
      ) AS LONG
    ' To change the arrow orientation, swap Seed and Target coordinates
    ' GDImage Drawing STYLE                  Drawing mode:
    ' ---------------------                  -------------
    ' %ZD_DRAW_FILLED                        Fill mode ONLY
    '
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error
    '****************************************************************************
    '
    '****************************************************************************
    ' Create ELLIPSE overlay object.
    ' Version 1.14
    ' Each overlay object must have a unique identifier.
      DECLARE FUNCTION ZD_DrawEllipseToCtrl LIB "GDIMAGE.DLL" ALIAS "ZD_DrawEllipseToCtrl" ( _
      BYVAL hGDImageCtrl AS LONG, _        ' The GDImage control handle.
      BYVAL TopLeftX AS LONG, _            ' The top X of the rectangular region matching the ellipse size.
      BYVAL TopLeftY AS LONG, _            ' The top Y of the rectangular region matching the ellipse size.
      BYVAL BottomRightX AS LONG, _        ' The bottom X of the rectangular region matching the ellipse size.
      BYVAL BottomRightY AS LONG, _        ' The bottom Y of the rectangular region matching the ellipse size.
      BYVAL ColrARGB AS LONG, _            ' The ARGB color to use.
      BYVAL OutlineSize AS LONG, _         ' Size of the outline.
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL ZS_STYLE AS LONG, _            ' The object Generic STYLE (use at least %ZS_VISIBLE to show it).
      BYVAL ZD_STYLE AS LONG, _            ' The object Drawing STYLE (see below).
      OPTIONAL BYVAL Use3D AS LONG _       ' The shadow 3D offset.
      ) AS LONG
    ' The ellipse coordinates must match a rectangualr perimeter
    ' GDImage Drawing STYLE                  Drawing mode:
    ' ---------------------                  -------------
    ' %ZD_DRAW_OUTLINE                       Border only (frame mode)
    ' %ZD_DRAW_FILLED                        Fill mode
    ' %ZD_DRAW_3DIN                          Fill with 3D-IN effect
    ' %ZD_DRAW_3DOUT                         Fill with 3D_Out effect
    '
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.14
    ' Create CURVE overlay object.
    ' Version 1.14
    ' Each overlay object must have a unique identifier.
      DECLARE FUNCTION ZD_DrawCurveToCtrl LIB "GDIMAGE.DLL" ALIAS "ZD_DrawCurveToCtrl" ( _
      BYVAL hGDImageCtrl AS LONG, _        ' The GDImage control handle.
      BYVAL pXY AS POINTS PTR, _           ' Pointer to an ARRAY of POINTS (holding x,y coordinates of each point).
      BYVAL ArraySize AS LONG, _           ' UBOUND - LBOUND + 1 = number of point in the array.
      BYVAL ColrARGB AS LONG, _            ' The ARGB color to use.
      BYVAL CurveSize AS LONG, _           ' Size of the curve.
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL ZS_STYLE AS LONG, _            ' The object Generic STYLE (use at least %ZS_VISIBLE to show it).
      BYVAL ZD_STYLE AS LONG, _            ' The object Drawing STYLE (see below).
      OPTIONAL BYVAL Use3D AS LONG _       ' The shadow 3D offset.
      ) AS LONG
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error.
    '
    ' GDImage Drawing STYLE                  Drawing mode:
    ' ---------------------                  -------------
    ' %ZD_DRAW_OUTLINE                       Border only (frame mode)
    ' %ZD_DRAW_FILLED                        Fill mode
    ' %ZD_DRAW_3DIN                          Fill with 3D-IN effect
    ' %ZD_DRAW_3DOUT                         Fill with 3D_Out effect
    ' %ZD_DRAW_OPEN                          Do not apply to rectangle
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.14
    ' Create POLYLINE overlay object.
    ' Version 1.14
    ' Each overlay object must have a unique identifier.
      DECLARE FUNCTION ZD_DrawPolyLineToCtrl LIB "GDIMAGE.DLL" ALIAS "ZD_DrawPolyLineToCtrl" ( _
      BYVAL hGDImageCtrl AS LONG, _        ' The GDImage control handle.
      BYVAL pXY AS POINTS PTR, _           ' Pointer to an ARRAY of POINTS (holding x,y coordinates of each point).
      BYVAL ArraySize AS LONG, _           ' UBOUND - LBOUND + 1 = number of point in the array.
      BYVAL ColrARGB AS LONG, _            ' The ARGB color to use.
      BYVAL CurveSize AS LONG, _           ' Size of the polyline.
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL ZS_STYLE AS LONG, _            ' The object Generic STYLE (use at least %ZS_VISIBLE to show it).
      BYVAL ZD_STYLE AS LONG, _            ' The object Drawing STYLE (see below).
      OPTIONAL BYVAL Use3D AS LONG _       ' The shadow 3D offset.
      ) AS LONG
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error
    '
    ' GDImage Drawing STYLE                  Drawing mode:
    ' ---------------------                  -------------
    ' %ZD_DRAW_OUTLINE                       Border only (frame mode)
    ' %ZD_DRAW_FILLED                        Fill mode
    ' %ZD_DRAW_3DIN                          Fill with 3D-IN effect
    ' %ZD_DRAW_3DOUT                         Fill with 3D_Out effect
    ' %ZD_DRAW_OPEN                          Do not apply to rectangle
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.10
    ' Process pending window or dialog messages during animation sequence.
      DECLARE FUNCTION ZD_DoEvents LIB "GDIMAGE.DLL" ALIAS "ZD_DoEvents" () AS LONG
    ' Return:
    ' %WM_QUIT if user presses on exit button else %NULL.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.10
    ' To show or hide a GDImage overlay object
      DECLARE SUB ZD_ShowObject LIB "GDIMAGE.DLL" ALIAS "ZD_ShowObject" ( _
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL ShowOrHide AS LONG _           ' %TRUE = SHOW, %FALSE = HIDE.
      )
    ' Apply to any of the ZD_DrawXXXToCtrl functions.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.10
    ' Check for visibility of a GDImage overlay object
      DECLARE FUNCTION ZD_IsObjectVisible LIB "GDIMAGE.DLL" ALIAS "ZD_IsObjectVisible" ( _
      BYVAL ObjID AS LONG _                ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      ) AS LONG
    ' Return:
    ' TRUE (-1) if visible, FALSE (0) if not.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.14
    ' Get the STYLE of a GDImage overlay object
      DECLARE FUNCTION ZD_GetObjectStyle LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectStyle" ( _
      BYVAL ObjID AS LONG _                ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      ) AS LONG
    ' Return:
    ' The STYLE of the object.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.14
    ' Set the STYLE of a GDImage overlay object
      DECLARE SUB ZD_SetObjectStyle LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectStyle" ( _
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL UseStyle AS LONG _             ' The new style to use (must be a valid GDImage style).
      )
    ' See: GDImage overlay Generic STYLE
    ' Note: Use ZI_UpdateWindow to refresh the display after the style change.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.10
    ' To set up the Alpha channel of a specific sprite object
      DECLARE SUB ZD_SetObjectAlpha LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectAlpha" ( _
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL Alpha AS BYTE, _               ' The alpha channel (range 0-255, 0 = transparent, 255 = opaque).
      BYVAL RedrawParent AS LONG _         ' TRUE causes immediat redraw of the object parent
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.10
    ' To get the ARGB parameters of a specific sprite object
      DECLARE SUB ZD_GetObjectARGB LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectARGB" ( _
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYREF Alpha AS BYTE, _               ' The alpha channel (range 0-255, 0 = transparent, 255 = opaque).
      BYREF Red AS BYTE, _                 ' The RED component (0-255).
      BYREF Green AS BYTE, _               ' The GREEN component (0-255).
      BYREF Blue AS BYTE _                 ' The BLUE component (0-255).
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.10
    ' To set the ARGB parameters of a specific sprite object
      DECLARE SUB ZD_SetObjectARGB LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectARGB" ( _
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL Alpha AS BYTE, _               ' The alpha channel (range 0-255, 0 = transparent, 255 = opaque).
      BYVAL Red AS BYTE, _                 ' The RED component (0-255).
      BYVAL Green AS BYTE, _               ' The GREEN component (0-255).
      BYVAL Blue AS BYTE _                 ' The BLUE component (0-255).
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.10
    ' Retrieve the immediate parent of the overlay object
      DECLARE FUNCTION ZD_GetObjectParent LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectParent" ( _
      BYVAL ObjID AS LONG _                ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      ) AS LONG
    ' Return:
    ' The GDImage control handle of the parent.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.10
    ' Retrieve the bounding size that best fit the overlay object region
      DECLARE SUB ZD_GetObjectBound LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectBound" ( _
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one)
      BYREF BoundWidth AS LONG, _          ' The bounding with
      BYREF BoundHeight AS LONG _          ' The bounding height
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.10
    ' Retrieve overlay object X, Y coordinates
      DECLARE SUB ZD_GetObjectXY LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectXY" ( _
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one)
      BYREF x AS LONG, _                   ' The X coordinate
      BYREF y AS LONG _                    ' The Y coordinate
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.10
    ' Set the X,Y coordinates of an overlay object.
      DECLARE SUB ZD_SetObjectXY LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectXY" ( _
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one)
      BYVAL x AS LONG, _                   ' The X coordinate
      BYVAL y AS LONG, _                   ' The Y coordinate
      BYVAL RedrawParent AS LONG _         ' TRUE causes immediat redraw of the object parent
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.14
    ' To Get the Z-order of an overlay object
      DECLARE FUNCTION ZD_GetObjectZorder LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectZorder" ( _
      BYVAL ObjID AS LONG _                ' The unique object IDentifier (each object MUST USE A UNIQUE one)
      ) AS LONG
    ' Return:
    ' The overlay object Z-order
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.14
    ' You can use these constants
      %ZD_ORDER_TOP    = &HFFFFFF          ' Z-order Top
      %ZD_ORDER_BOTTOM = &HFFFF&           ' Z-Order Bottom
    ' To Set the Z-order of an overlay object
      DECLARE FUNCTION ZD_SetObjectZorder LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectZorder" ( _
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one)
      BYVAL SetOrder AS LONG _             ' The new Z-order of the object
      ) AS LONG
    ' Return:
    ' 0 = Error
    ' ELSE the PREVIOUS z-order of the object.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.17
    ' Create a sprite BITMAP (overlay object).
      DECLARE FUNCTION ZD_DrawBitmapToCtrl LIB "GDIMAGE.DLL" ALIAS "ZD_DrawBitmapToCtrl" ( _
      BYVAL hGDImageCtrl AS LONG, _        ' The GDImage control handle.
      BYVAL x AS LONG, _                   ' The X coordinate.
      BYVAL y AS LONG, _                   ' The Y coordinate.
      BYVAL hBitmap AS LONG, _
      BYVAL ColrARGB AS LONG, _
      BYVAL ObjID AS LONG, _
      BYVAL ZS_STYLE AS LONG _
      ) AS LONG
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.20
    ' To be used with a bitmap object.
    ' Retrieve a copy of the entire bitmap for the object IDentifier being used,
    ' using a 2 dimensions array of the form (x,y) pointing directly to pixel.
    ' You can use the array coordinates as you would do with a standard DC,
    ' because pixel 0,0 is at coordinate Array(0,0).
    ' Once your are done with the array, the bitmap is replaced using ZD_SetBitmapObjectBits.
    ' (see ZD_SetBitmapObjectBits)
      DECLARE FUNCTION ZD_GetBitmapObjectBits LIB "GDIMAGE.DLL" ALIAS "ZD_GetBitmapObjectBits" ( _
      BYVAL ObjID AS LONG, _                   ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      PixelArray() AS LONG _                   ' Array using 2 dimensions (Y,Y) matching the pixel coordinates.
      ) AS LONG
    ' Return:
    ' Null if error, else success.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.20
    ' To be used with a bitmap object.
    ' Replace a copy of a bitmap that was retrieved as a device-independent bitmap.
    ' (see ZD_GetBitmapObjectBits)
      DECLARE FUNCTION ZD_SetBitmapObjectBits LIB "GDIMAGE.DLL" ALIAS "ZD_SetBitmapObjectBits" ( _
      BYVAL ObjID AS LONG, _                   ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      PixelArray() AS LONG, _                  ' Array using 2 dimensions (Y,Y) matching the pixel coordinates.
      OPTIONAL BYVAL DoNotClearArray AS LONG _ ' Boolean flag, %TRUE = DO NOT clear the array.
      )AS LONG
    ' Return:
    ' Null if error, else success.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.21
      TYPE ZPOLYGON
          pXY        AS DWORD    ' 32-bit unsigned POINTS PTR
          ArraySize  AS INTEGER  ' 16-bit signed SHORT integer
          ObjID      AS LONG     ' 32-bit signed LONG integer
          ColorARGB  AS LONG     ' 32-bit signed LONG integer
          PenSize    AS INTEGER  ' 16-bit signed SHORT integer
          ZS_Style   AS LONG     ' 32-bit signed LONG integer
          ZD_Style   AS LONG     ' 32-bit signed LONG integer
      END TYPE
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.21
    ' Draws a series of closed polygons.
    ' Each polygon is outlined or filled by using a specific pen size and ARGB color.
    ' The polygons drawn by this function can overlap.
      DECLARE FUNCTION ZD_PolyPolygon LIB "GDIMAGE.DLL" ALIAS "ZD_PolyPolygon" ( _
      BYVAL hGDImageCtrl AS LONG, _        ' The GDImage control handle.
      zp() AS ZPOLYGON, _                  ' The polypolygon description.
      BYVAL PolygonCount AS LONG _         ' The plygon count.
      ) AS LONG
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.21
    ' Show or hide a list of GDImage overlay objects at once.
      DECLARE SUB ZD_ShowObjectList LIB "GDIMAGE.DLL" ALIAS "ZD_ShowObjectList" ( _
      BYVAL ObjectList AS LONG PTR, _     ' A long pointer to an array of object ID
      BYVAL ListSize AS LONG, _           ' The size of the array.
      BYVAL ShowOrHide AS LONG _          ' %TRUE = SHOW, %FALSE = HIDE.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.36
    ' Show or Hide a specific GDImage overlay object.
      DECLARE SUB ZD_SetObjectVisibility LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectVisibility" ( _
      BYVAL ObjID AS LONG, _      ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL ShowOrHide AS LONG _  ' A boolean TRUE/FALSE flag to show or hide the object.
      )
    '****************************************************************************
    '
    '
    '****************************************************************************
    '****************************************************************************
    '*                                                                          *
    '*                             HELPER FUNCTIONS                             *
    '*                                                                          *
    '****************************************************************************
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.00
    ' Retrieve the instance of the current module
      DECLARE FUNCTION zInstance LIB "GDIMAGE.DLL" ALIAS "zInstance" () AS LONG
    ' Return:
    ' the instance handle of the running application.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.07
    ' Beep the user.
      DECLARE SUB zFocusBeep LIB "GDIMAGE.DLL" ALIAS "zFocusBeep" ()
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.11
    ' Compute CPU SPEED, handy to compute animation speed.
      DECLARE FUNCTION zGetCPUspeed LIB "GDIMAGE.DLL" ALIAS "zGetCPUspeed" () AS LONG
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.00
    ' Check if file exist
      DECLARE FUNCTION zExist LIB "GDIMAGE.DLL" ALIAS "zExist" ( _
      BYVAL FullPathName AS STRING _ ' The name of the file to check.
      ) AS LONG
    ' Return:
    ' TRUE (-1) if exist, FALSE (0) if not.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.16
    ' Generic I/O file manager faster and less overhead than built-in PB's functions.
    ' OPEN File
      DECLARE FUNCTION zFOpen LIB "GDIMAGE.DLL" ALIAS "zFOpen" ( _
      BYVAL FullPathName AS STRING, _ ' The name of the file to open.
      BYVAL AccessMode AS LONG, _
      BYVAL ShareMode AS LONG, _
      BYREF hFile AS LONG _
      ) AS LONG
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.16
    ' Generic I/O file manager faster and less overhead than built-in PB's functions
    ' CLOSE File
      DECLARE SUB zFClose LIB "GDIMAGE.DLL" ALIAS "zFClose" ( _
      BYREF hFile AS LONG _
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.16
    ' Generic I/O file manager faster and less overhead than built-in PB's functions
    ' GET buffer
      DECLARE FUNCTION zFGet LIB "GDIMAGE.DLL" ALIAS "zFGet" ( _
      BYVAL hFile AS LONG, _
      BYREF sBuffer AS STRING _
      ) AS LONG
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.16
    ' Generic I/O file manager faster and less overhead than built-in PB's functions
    ' Disk size of an open file FLOF
      DECLARE FUNCTION zFlof LIB "GDIMAGE.DLL" ALIAS "zFlof" ( _
      BYVAL hFile AS LONG _
      ) AS LONG
    '****************************************************************************
    '
    '****************************************************************************
      MACRO Pi = 3.141592653589793##
      MACRO PiDiv4 = 0.785398163397448##
      MACRO DegreesToRadians(Deg) = Deg * 0.0174532925199432957##
    
    '****************************************************************************
    '
    '****************************************************************************
    
    ' Version 1.21
    ' Low level function to retrieve a device-independent bitmap.
      DECLARE FUNCTION zGetDIBits LIB "GDIMAGE.DLL" ALIAS "zGetDIBits" ( _
      BYVAL hBitmap AS LONG, _                 ' A valid bitmap handle.
      PixelArray() AS LONG _                   ' Array using 2 dimensions (Y,Y) matching the pixel coordinates.
      ) AS LONG
    
    ' Version 1.21
    ' Low level function to replace a copy of a bitmap that was retrieved as a device-independent bitmap.
      DECLARE FUNCTION zSetDIBits LIB "GDIMAGE.DLL" ALIAS "zSetDIBits" ( _
      BYVAL hBitmap AS LONG, _                 ' A valid bitmap handle.
      PixelArray() AS LONG _                   ' Array using 2 dimensions (Y,Y) matching the pixel coordinates.
      ) AS LONG
    
    ' Version 1.30
    ' Low level function to split an ARGB color.
      DECLARE SUB zSplitColorARGB LIB "GDIMAGE.DLL" ALIAS "zSplitColorARGB" ( _
      BYVAL ARGB&, _                           ' The ARGB color to split
      Alpha AS BYTE, _                         ' The Alpha channel in the range 0-255.
      Red AS BYTE, _                           ' The Red component in the range 0-255.
      Green AS BYTE, _                         ' The Green component in the range 0-255.
      Blue AS BYTE _                           ' The Blue component in the range 0-255.
      )
    
    '****************************************************************************
    '
    '****************************************************************************
    '****************************************************************************
    '***                                                                      ***
    '***                         SLIDE SHOW FUNCTIONS                         ***
    '***                                                                      ***
    '****************************************************************************
    '****************************************************************************
    ' Version 1.25
      TYPE ZSLIDESHOW
        ' Slide section
          FilName   AS ASCIIZ * 260
          Delay     AS LONG
          Effect    AS INTEGER
          Grain     AS INTEGER
        ' Font section
          Legend    AS ASCIIZ * 128
          FontName  AS ASCIIZ * 64
          FontSize  AS INTEGER
          FontColor AS LONG
          Shadow    AS BYTE
          Location  AS BYTE
      END TYPE
    
    ' Transition effects
      %ZE_EFFECT_MIN                 = 0  '
      %ZE_TRANSLUCENT_SPIRAL         = 0  ' Translucent spiral (uGrain to adjust speed).
      %ZE_SMOOTH_FADING              = 1  ' Smooth fading (uGrain to adjust speed).
      %ZE_MOVE_BOTTOM_TO_TOP         = 2  ' Moving from bottom to top (uGrain to adjust speed).
      %ZE_VERTICAL_LINE              = 3  ' Vertical line (use uGrain to change space between lines).
      %ZE_VERTICAL_LINE_FILLED_RIGHT = 4  ' Vertical line (use uGrain to change space between lines).
      %ZE_CHECKER_BOARD              = 5  ' Checker board (use uGrain for larger square).
      %ZE_RANDOM_DOT                 = 6  ' Random dots (use uGrain for larger dots).
      %ZE_WIPE_TO_CENTER             = 7  ' Wipe to center (uGrain to adjust speed).
      %ZE_STRETCH_FROM_CENTER        = 8  ' Stretch from center (uGrain to adjust speed).
      %ZE_PUSH_LEFT_TO_RIGHT         = 9  ' Push from left to right (uGrain to adjust speed).
      %ZE_PUSH_TOP_TO_BOTTOM         = 10 ' Push from top to bottom (uGrain to adjust speed).
      %ZE_NO_EFFECT                  = 11 ' Cut mode (no transition effect).
      %ZE_EFFECT_MAX                 = 11
    
    ' Legend location
      %ZE_TXT_TOP_LEFT               = 1  ' Text on the top, left justified.
      %ZE_TXT_TOP_CENTER             = 2  ' Text on the top, centered.
      %ZE_TXT_TOP_RIGHT              = 3  ' Text on the top, right justified.
      %ZE_TXT_MIDDLE_CENTER          = 4  ' Text on the middle, centered.
      %ZE_TXT_BOTTOM_LEFT            = 5  ' Text on the bottom, left justified.
      %ZE_TXT_BOTTOM_CENTER          = 0  ' Text on the bottom, centered.
      %ZE_TXT_BOTTOM_RIGHT           = 6  ' Text on the bottom, right justified.
    
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.37
    ' Start playing a GDImage slide show.
      DECLARE SUB ZI_SlideAnimate LIB "GDIMAGE.DLL" ALIAS "ZI_SlideAnimate" ( _
      BYVAL hGDImageCtrl AS LONG, _  ' The GDImage control handle.
      BYVAL ipt AS ZSLIDESHOW PTR, _ ' A DWORD PTR to a ZSLIDESHOWE array.
      BYVAL ImageCount AS LONG, _    ' Number of element in the array
      BYVAL LoopMode AS LONG _       ' Boolean flag, TRUE = play slide show in loop mode.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.25
    ' STOP a playing GDImage slide show.
      DECLARE SUB ZI_SlideStop LIB "GDIMAGE.DLL" ALIAS "ZI_SlideStop" ()
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.25
    ' Play a GDImage slide show in incremental order.
      DECLARE SUB ZI_SlidePlayIncrOrder LIB "GDIMAGE.DLL" ALIAS "ZI_SlidePlayIncrOrder" ()
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.25
    ' Play a GDImage slide show in decremental order.
      DECLARE SUB ZI_SlidePlayDecrOrder LIB "GDIMAGE.DLL" ALIAS "ZI_SlidePlayDecrOrder" ()
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.25
    ' PLAY a GDImage slide show that has been previously PAUSED.
      DECLARE SUB ZI_SlidePlay LIB "GDIMAGE.DLL" ALIAS "ZI_SlidePlay" ()
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.25
    ' PAUSE a playing GDImage slide show.
      DECLARE SUB ZI_SlidePause LIB "GDIMAGE.DLL" ALIAS "ZI_SlidePause" ()
    '****************************************************************************
    '
    '****************************************************************************
    '****************************************************************************
    '*                                                                          *
    '*                             OpenGL FUNCTIONS                             *
    '*                                                                          *
    '****************************************************************************
    '****************************************************************************
    '
    '****************************************************************************
      %ZI_GLDC      = 8  ' OpenGL Device Context
      %ZI_GLRC      = 9  ' OpenGL Rendering Context
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.30
    ' No need to use it if you have already registered the RegisterGDImageClass
    ' -------------------------------------------------------------------------
    ' Must be done in the WinMain section BEFORE USING any of the GDImage function.
    ' Parameter: None
      DECLARE FUNCTION RegisterGLImageClass LIB "GDIMAGE.DLL" ALIAS "RegisterGLImageClass" () AS LONG
    ' Return:
    ' 0 = means failure, any other value means registered.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.30
    ' Create an OpenGL texture from any of the supported GDImage graphic format.
    ' GDImage takes care of all the hard stuff to create a correct OpenGL texture.
      DECLARE FUNCTION ZI_CreateGLTextureFromFile LIB "GDIMAGE.DLL" ALIAS "ZI_CreateGLTextureFromFile" ( _
      zFullPathName AS ASCIIZ, _        ' Name of the graphic file to create the texture from.
      xPower2 AS LONG, _                ' A value in the range: 2, 4, 16, 32, 64, 128, 256, 512, etc.
      yPower2 AS LONG, _                ' A value in the range: 2, 4, 16, 32, 64, 128, 256, 512, etc.
      PixelArray() AS BYTE _           ' Byte array holding the texture.
      ) AS LONG
    ' Return:
    ' If the function succeeds the returned value is %TRUE,
    ' and the PixelArray is full of bytes that are already converted to the internal RGBA OpenGL format.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.30
    ' Create on the fly an OpenGL texture from any supported GDImage raster graphic file.
      DECLARE FUNCTION ZI_SetGLTextureFromFile LIB "GDIMAGE.DLL" ALIAS "ZI_SetGLTextureFromFile" ( _
      zFullPathName AS ASCIIZ _        ' Name of the graphic file to create the texture from.
      ) AS LONG
    ' Return:
    ' An OpenGL error code in case of Error.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.30
    ' Enable the use of OpenGL with a previously "bounded" GDImage OpenGL texture.
      DECLARE SUB ZI_InitGLControl LIB "GDIMAGE.DLL" ALIAS "ZI_InitGLControl" ( _
      BYVAL ARGB AS LONG _ ' The GDImage ARGB color to paint the control background.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.30
    ' Allows you to resize the "view port" of a GDImage OpenGL control during WM_SIZE message.
    ' The GDImage control being the container of the OpenGL "view port",
    ' you must resize both the control and the "veiw port".
      DECLARE SUB ZI_ResizeGLWindow LIB "GDIMAGE.DLL" ALIAS "ZI_ResizeGLWindow" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
      )
    ' Note: To resize automatically a GDImage control use the ZI_SetAnchorMode API.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.30
    ' Allows you to update a GDImage OpenGL control.
      DECLARE SUB ZI_UpdateGLWindow LIB "GDIMAGE.DLL" ALIAS "ZI_UpdateGLWindow" (BYVAL hWnd AS LONG)
    ' Note:
    ' This API must be called from your "DrawScene" procedure to display the rendered animation.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.30
    ' To retrieve the GDImage OpenGL permanent (CS_OWNDC) Device Context.
      DECLARE FUNCTION ZI_GetGLDC LIB "GDIMAGE.DLL" ALIAS "ZI_GetGLDC" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
      ) AS LONG
    ' Do not delete this DC.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.30
    ' To retrieve the GDImage OpenGL Rendering Context.
      DECLARE FUNCTION ZI_GetGLRC LIB "GDIMAGE.DLL" ALIAS "ZI_GetGLRC" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
      ) AS LONG
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.31
      TYPE ZGLFONT
          fontName   AS ASCIIZ * 64 ' The True Type font name.
          fontBase   AS LONG        ' The OpenGL FontBase (do not set this).
          charStart  AS LONG        ' OpenGL starting ASCII character (usually 32).
          charNum    AS LONG        ' OpenGL number of glyphe characters to create(usually 96).
          fontHeight AS LONG        ' The font size (72 DPI).
          fontWeight AS LONG        ' The font weigt.
          fontHandle AS LONG        ' The Win32 font handle
      END TYPE
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.31
    ' Create an OpenGL font, from a Windows True Type Font, to use with ZI_DrawGLText.
      DECLARE SUB ZI_BuildGLfont LIB "GDIMAGE.DLL" ALIAS "ZI_BuildGLfont" ( _
      BYVAL hGLcontrolDC AS LONG, _ ' The GDimage Device Context (see ZI_GetGLDC).
      UseFont AS ZGLFONT _          ' Pointer to a ZGLFONT structure.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.31
    ' Delete a GDImage OpenGL font previously created with ZI_BuildGLfont.
      DECLARE SUB ZI_DeleteGLFont LIB "GDIMAGE.DLL" ALIAS "ZI_DeleteGLFont" ( _
      UseFont AS ZGLFONT _          ' Pointer to a ZGLFONT structure.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.31
    ' Display a text string on a GDImage OpenGL graphic control.
      DECLARE SUB ZI_DrawGLText LIB "GDIMAGE.DLL" ALIAS "ZI_DrawGLText" ( _
      BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
      UseFont AS ZGLFONT, _         ' Pointer to a ZGLFONT structure.
      BYVAL x AS LONG, _            ' The X location in pixel coordinates.
      BYVAL y AS LONG, _            ' The Y location in pixel coordinates.
      zTxt AS ASCIIZ, _             ' The text string to display.
      BYVAL ARGB AS LONG _          ' The ARGB color to use.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.32
    ' Return Width and Height of a string based on a specific ZGLFONT font structure.
      DECLARE SUB ZI_GetGLTextExtent LIB "GDIMAGE.DLL" ALIAS "ZI_GetGLTextExtent"( _
      BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
      UseFont AS ZGLFONT, _         ' Pointer to a ZGLFONT structure.
      zTxt AS ASCIIZ, _             ' The text string to compute the size from.
      stWidth AS LONG, _            ' The width of the string in pixel.
      stHeight AS LONG _            ' The height of the string in pixel.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.31
    ' Do not create a default SQUARE shape texture.
    ' With spherical objects, it is better to use a rectangular texture:
    ' Best size would be 128 x 64, 256 x 128, 512 x 256, 1024 x 512, etc. (always 2^n).
      DECLARE SUB ZI_DoNotSquareTexture LIB "GDIMAGE.DLL" ALIAS "ZI_DoNotSquareTexture" ()
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.31
    ' Set the current GDImage OpenGL zoom.
      DECLARE SUB ZI_SetGLzoom LIB "GDIMAGE.DLL" ALIAS "ZI_SetGLzoom" ( _
      BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
      BYVAL fovy AS LONG _          ' The field of view angle, in degrees (1-180), in the y-direction.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.31
    ' Retrieve the current GDImage OpenGL zoom.
      DECLARE FUNCTION ZI_GetGLzoom LIB "GDIMAGE.DLL" ALIAS "ZI_GetGLzoom" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
      ) AS LONG
    ' Return:
    ' The fovy angle in degree from the observer in the range 1-180.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.31
    ' Create a polar view.
      DECLARE SUB ZI_UseGLPolarView LIB "GDIMAGE.DLL" ALIAS "ZI_UseGLPolarView" ( _
      BYVAL radius AS DOUBLE, _     ' The radius value.
      BYVAL twist AS DOUBLE, _      ' The twist value.
      BYVAL latitude AS DOUBLE, _   ' The latitude value.
      BYVAL longitude AS DOUBLE _   ' The longitude value.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.33
    ' Convert a GDImage ARGB color to an OpenGL color.
    ' The new color applies to all subsequent OpenGL drawing procedures until a new color is defined.
      DECLARE SUB ZI_glColor4f LIB "GDIMAGE.DLL" ALIAS "ZI_glColor4f" ( _
      BYVAL ARGB AS LONG _          ' A GDImage ARGB color.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.32
    ' Determines whether a key is up or down at the time the function is called.
      DECLARE FUNCTION ZI_IsKeyDown LIB "GDIMAGE.DLL" ALIAS "ZI_IsKeyDown" ( _
      BYVAL CheckKey AS LONG _ ' One of 256 possible virtual-key codes.
      ) AS LONG
    ' Return:
    ' TRUE = the key is down, FALSE = the key is up.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.32
    ' Determines whether the left mouse button is up or down at the time the function is called.
      DECLARE FUNCTION ZI_IsLButtonDown LIB "GDIMAGE.DLL" ALIAS "ZI_IsLButtonDown" () AS LONG
    ' Return:
    ' TRUE = the mouse button is down, FALSE = the mouse button is up.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.32
    ' Determines whether the right mouse button is up or down at the time the function is called.
      DECLARE FUNCTION ZI_IsRButtonDown LIB "GDIMAGE.DLL" ALIAS "ZI_IsRButtonDown" () AS LONG
    ' Return:
    ' TRUE = the mouse button is down, FALSE = the mouse button is up.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.32
    ' Determines whether a the Shift key is up or down at the time the function is called.
      DECLARE FUNCTION ZI_IsShiftKeyPressed LIB "GDIMAGE.DLL" ALIAS "ZI_IsShiftKeyPressed" () AS LONG
    ' Return:
    ' TRUE = the Shift key is down, FALSE = the Shift key is up.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.32
    ' Determines whether the Ctrl key is up or down at the time the function is called.
      DECLARE FUNCTION ZI_IsCtrlKeyPressed LIB "GDIMAGE.DLL" ALIAS "ZI_IsCtrlKeyPressed" () AS LONG
    ' Return:
    ' TRUE = the Ctrl key is down, FALSE = the Ctrl key is up.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.34
    ' Create a GDImage OpenGL panorama view.
      DECLARE SUB ZI_UseGLPanoramaView LIB "GDIMAGE.DLL" ALIAS "ZI_UseGLPanoramaView" ( _
      BYVAL Vert AS DOUBLE, _  ' The vertical orientation angle in degree.
      BYVAL Horz AS DOUBLE _   ' The horizontal orientation angle in degree.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.35
      TYPE ZGLTEXTURE
          ID       AS LONG
          FullName AS ASCIIZ * 260
          Texture  AS LONG
      END TYPE
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.35
    ' Load multiple OpenGL "Named texture" at once.
      DECLARE FUNCTION ZI_SetMutipleGLTextureFromFile LIB "GDIMAGE.DLL" ALIAS "ZI_SetMutipleGLTextureFromFile" ( _
      BYVAL ztp AS ZGLTEXTURE PTR, _         ' A DWORD PTR to a ZGLTEXTURE array.
      BYVAL N AS LONG _                      ' Number of element in the array
      ) AS LONG
    ' Return:
    ' An OpenGL error code in case of Error.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.35
    ' Assign a new texture to an existing OpenGL "Named texture".
      DECLARE FUNCTION ZI_UpdateNamedGLTextureFromFile LIB "GDIMAGE.DLL" ALIAS "ZI_UpdateNamedGLTextureFromFile" ( _
      zFullName AS ASCIIZ, _       ' Full qualified path name.
      BYVAL NamedTexture AS LONG _ ' An existing OpenGL NamedTexture
      ) AS LONG
    ' Return:
    ' An OpenGL error code in case of Error.
    '****************************************************************************
    '
    '****************************************************************************
    
      %WM_MMTIMER = &H400 + 2060 ' MultiMedia timer message
    
      MACRO GLenum     = DWORD   ' 32-Bit unsigned.
      MACRO GLboolean  = BYTE    ' 8-Bit  unsigned.
      MACRO GLbitfield = DWORD   ' 32-Bit unsigned.
      MACRO GLbyte     = BYTE    ' 8-Bit  signed.
      MACRO GLshort    = INTEGER ' 16-Bit signed.
      MACRO GLint      = LONG    ' 32-Bit signed.
      MACRO GLubyte    = BYTE    ' 8-Bit  unsigned.
      MACRO GLushort   = WORD    ' 16-Bit unsigned.
      MACRO GLuint     = DWORD   ' 32-Bit unsigned.
      MACRO GLsizei    = LONG    ' 32-Bit signed.
      MACRO GLfloat    = SINGLE  ' single precision float.
      MACRO GLclampf   = SINGLE  ' single precision float in [0,1].
      MACRO GLdouble   = DOUBLE  ' double precision float.
      MACRO GLclampd   = DOUBLE  ' double precision float in [0,1].
      MACRO GLvoid     = ANY     ' No need for it.
    
    
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.39
    ' FlipReverse :
      %ZD_Normal  = 0 ' Orientation unchanged (default)
      %ZD_Flip    = 1 ' Swap top / bottom
      %ZD_Reverse = 2 ' Swap left / right
    ' Allows you to crop / create a new bitmap from an existing one using new coordinates that must lie within the range of the previous one.
      DECLARE FUNCTION ZI_CropBitmap LIB "GDIMAGE.DLL" ALIAS "ZI_CropBitmap" ( _
      BYVAL hBmp AS LONG, _          ' Handle to an existing bitmap.
      BYVAL x AS LONG, _             ' X top left corner of the croping section.
      BYVAL y AS LONG, _             ' Y top corner of the croping section.
      BYVAL w AS LONG, _             ' Width of the crop.
      BYVAL h AS LONG, _             ' Height of the crop.
      BYVAL FlipReverse AS LONG _    ' Orientation of the resulting croped section.
      ) AS LONG
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.01 '// 1.39
    ' Save multiple layers into a  single disk file, using any of the supported graphic format.
      %RotateNoneFlipNone = 0
      %Rotate90FlipNone = 1
      %Rotate180FlipNone = 2
      %Rotate270FlipNone = 3
      DECLARE FUNCTION ZI_RenderLayersToFile LIB "GDIMAGE.DLL" ALIAS "ZI_RenderLayersToFile" ( _
      BYVAL hGDImageCtrl AS LONG, _      ' The GDimage control handle.
      zFullName AS ASCIIZ, _             ' Full qualified path name.
      BYVAL Quality AS LONG, _           ' For JPEG only, quality ranges from 0-100 (100 = best quality)
      BYVAL Rotation AS LONG, _          ' Orientation
      OPTIONAL BYVAL UseWidth AS LONG, _ ' Optional parameter to fit the image into a specific width.
      OPTIONAL BYVAL UseHeight AS LONG _ ' Optional parameter to fit the image into a specific height.
      ) AS LONG
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.39
    ' Replace a RGB color with another RGB color, using a bitmap handle.
      DECLARE SUB ZI_ReplaceRGBColorBitmap LIB "GDIMAGE.DLL" ALIAS "ZI_ReplaceRGBColorBitmap" ( _
      BYVAL hBitmap AS LONG, _      ' A valid bitmap handle.
      BYVAL WasColor AS LONG, _     ' RGB Pixel color to replace
      BYVAL NewColor AS LONG _      ' New RGB pixel color
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.41
    ' Change the zooming value of a GDImage Zoom window control ( ZI_ZoomWindow property).
      DECLARE SUB ZI_SetZoomValue LIB "GDIMAGE.DLL" ALIAS "ZI_SetZoomValue"( _
      BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
      BYVAL ZoomValue AS SINGLE _   ' The zoom factor as a floating value.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.41
    ' Get the zoom factor of a GDImage Zoom window control ( ZI_ZoomWindow property).
      DECLARE FUNCTION ZI_GetZoomValue LIB "GDIMAGE.DLL" ALIAS "ZI_GetZoomValue" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
      ) AS SINGLE
    ' Return:
    ' The zoom factor as a floating value
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.41
    ' Computes location and size to stretch a bitmap preserving its aspect.
      DECLARE SUB ZI_Iconise LIB "GDIMAGE.DLL" ALIAS "ZI_Iconise" ( _
      BYVAL xPicSize AS LONG, _ ' The real image width.
      BYVAL yPicSize AS LONG, _ ' The real image height.
      BYVAL xCell AS LONG, _    ' The fit into wdith.
      BYVAL yCell AS LONG, _    ' The fit inot height.
      BYREF xPos AS LONG, _     ' New X computed value.
      BYREF yPos AS LONG, _     ' New Y computed value.
      BYREF xSize AS LONG, _    ' New Width computed value.
      BYREF ySize AS LONG _     ' New Height computed value.
      )
    
      %WM_USER          = 1024
      %ZM_Size          = %WM_USER + 1001
      %ZM_Crop          = %WM_USER + 1002
      %ZM_CENTER_DIALOG = %WM_USER + 1003
      %ZM_CropRedEye    = %WM_USER + 1004
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.41
    ' Retrieve the current selected bitmap from a specific Device Context.
      DECLARE FUNCTION ZI_GetBitmapFromDC LIB "GDIMAGE.DLL" ALIAS "ZI_GetBitmapFromDC" ( _
      BYVAL hDC AS LONG _ ' A Windows valid DC
      ) AS LONG
    ' Return:
    ' The bitmap handle matching the specific DC if any.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.41
    ' Enhanced HALFTONE StretchBlt function
      DECLARE FUNCTION ZD_StretchBlt LIB "GDIMAGE.DLL" ALIAS "ZD_StretchBlt" ( _
      BYVAL hDCdest AS LONG, _    ' Handle to destination DC.
      BYVAL xDest AS LONG, _      ' X-coord of destination upper-left corner.
      BYVAL yDest AS LONG, _      ' Y-coord of destination upper-left corner.
      BYVAL DestWidth AS LONG, _  ' Width of destination rectangle.
      BYVAL DestHeight AS LONG, _ ' Height of destination rectangle.
      BYVAL hDCsrce AS LONG, _    ' Handle to source DC.
      BYVAL xSrce AS LONG, _      ' X-coord of source upper-left corner.
      BYVAL ySrce AS LONG, _      ' Y-coord of source upper-left corner.
      BYVAL SrceWidth AS LONG, _  ' Width of source rectangle.
      BYVAL SrceHeight AS LONG _  ' Height of source rectangle.
      ) AS LONG
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.41
    ' Split multiple parts of a full path name.
      DECLARE SUB zSplitN LIB "GDIMAGE.DLL" ALIAS "zSplitN" ( _
      BYVAL FullName AS STRING,  _
      PathName AS STRING, _
      FilName AS STRING _
      )
    ' Return:
    ' The qualified path name plus the single file name.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.41
    ' Load image from file and return a valid GDIPLUS image handle
      DECLARE FUNCTION zLoadImageFromFile LIB "GDIMAGE.DLL" ALIAS "zLoadImageFromFile" ( _
      zFullName AS ASCIIZ, _      ' Full path name to any of the supported graphic format.
      BYREF imgW AS LONG, _       ' Return the image width.
      BYREF imgH AS LONG, _       ' Return the image height.
      BYVAL Orientation AS LONG _ ' Orientation to create the memory image.
      ) AS LONG
    ' Return:
    ' A valid GDIPLUS image handle, suitable with the low level GDIPLUS flat API.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 1.41
    ' Save image to file using a valid GDIPLUS image handle.
      DECLARE FUNCTION zSaveImageToFile LIB "GDIMAGE.DLL" ALIAS "zSaveImageToFile" ( _
      zFullName AS ASCIIZ, _      ' Full path name destination.
      BYVAL Img AS LONG, _        ' A valid GDIPLUS handle.
      BYVAL Quality AS LONG _     ' Quality applies to the JPEG format only.
      ) AS LONG
    ' Return:
    ' Null in case of success, else a GDIPLUS error code.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.00
    ' Assign a label to any sprite object.
      DECLARE SUB ZD_SetObjectImageLabel LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectImageLabel" ( _
      BYVAL ObjID AS LONG, _  ' The unique sprite object identifier.
      zUseText AS ASCIIZ _    ' The label to use.
      )
    ' Comment:
    ' This label is a complement to the unique identifier being used for a sprite.
    ' It can be used to dialog with the user when using a ZI_EventMessage callback.
    ' Remark:
    ' Maximum label size is 64 characters.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.00
    ' Retrieve the label matching a specific sprite object identifier.
      DECLARE FUNCTION ZD_GetObjectImageLabel LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectImageLabel" ( _
      BYVAL ObjID AS LONG _  ' The unique sprite object identifier.
      ) AS STRING
    ' Return:
    ' The label matching the identifier if any.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.00
    ' Setup the scroll with background property of a specific sprite object.
      DECLARE SUB ZD_SetObjectScroll LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectScroll" ( _
      BYVAL ObjID AS LONG, _     ' The unique sprite object identifier.
      BYVAL TrueFalse AS LONG _  ' The TRUE or FALSE scroll mode.
      )
    ' Remark:
    ' If scroll mode is set to false (default),
    ' then the sprite looks floating above the backround when you scroll it.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.00
    ' Retrieve the scroll status of a specific sprite object identifier.
      DECLARE FUNCTION ZD_GetObjectScroll LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectScroll" ( _
      BYVAL ObjID AS LONG _ ' The unique sprite object identifier.
      ) AS LONG
    ' Return:
    ' Null = scrolling disabled, Else = scrolling enabled.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.00
    ' Set the mouse lock status of a specific sprite object.
      DECLARE SUB ZD_SetObjectLocked LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectLocked" ( _
      BYVAL ObjID AS LONG, _     ' The unique sprite object identifier.
      BYVAL TrueFalse AS LONG _  ' The TRUE or FALSE lock mode.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.00
    ' Retrieve the mouse lock status of a specific sprite object identifier.
      DECLARE FUNCTION ZD_GetObjectLocked LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectLocked" ( _
      BYVAL ObjID AS LONG _ ' The unique sprite object identifier.
      ) AS LONG
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.00
    ' Use full variable opacity with 32-bit PNG transparent.
      DECLARE SUB ZD_UsePngOpacity LIB "GDIMAGE.DLL" ALIAS "ZD_UsePngOpacity" ( _
      BYVAL ObjID AS LONG, _     ' The unique sprite object identifier.
      BYVAL TrueFalse AS LONG _  ' TRUE = enable, FALSE = disable (default).
      )
    ' Remark:
    ' This feature is only available with PNG 32-bit, because they have an alpha channel.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.00
    ' To customize the default Load / Save Dialog messages.
      DECLARE SUB ZI_SetSaveDialogMsg LIB "GDIMAGE.DLL" ALIAS "ZI_SetSaveDialogMsg" ( _
      zCaptionLoad AS ASCIIZ, _ ' Caption for the Load dialog.
      zCaptionSave AS ASCIIZ, _ ' caption for the Save dialog.
      zDefaultName AS ASCIIZ _  ' Default file name for the Save dialog.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.00
    ' Monitor the Windows message flow using a callback to take control over the GDImage default procedure.
      DECLARE SUB ZI_EventMessage LIB "GDIMAGE.DLL" ALIAS "ZI_EventMessage" ( _
      BYVAL pCodePtr AS DWORD, _   ' Pointer to a MyCallback function (see remark below).
      BYVAL WM_Message AS LONG, _  ' The Windows message to filter.
      BYVAL SetReset AS LONG _     ' TRUE = enable, FALSE = disable callback for the specific message.
      )
    
    ' Remark:
    ' FUNCTION MyCallBack( _       ' Use any name, and provide its code pointer to ZI_EventMessage
    ' BYVAL hWnd AS LONG, _        ' The GDImage control handle sending the event.
    ' BYVAL Msg AS LONG, _         ' Any standard Windows message.
    ' BYVAL wParam AS LONG, _      ' The contents of this parameter depend on the value of the Msg parameter.
    ' BYVAL lParam AS LONG _       ' The contents of this parameter depend on the value of the Msg parameter.
    ' ) EXPORT AS LONG             ' See MSDN documentation about using a WindowProc function.
    '
    ' Important:
    ' If you want to stop further processing of the message by GDImage, then the callback function must return TRUE.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.00
    ' Retrieve the unique object IDentifier of the sprite that has the GDImage focus.
    ' Its primary purpose it to be used from a ZI_EventMessage callback.
      DECLARE FUNCTION ZI_GetObjectFocusID LIB "GDIMAGE.DLL" ALIAS "ZI_GetObjectFocusID" () AS LONG
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.00
    ' Retrieve the unique object IDentifier of the sprite hover the mouse.
    ' Its primary purpose it to be used from a ZI_EventMessage callback.
      DECLARE FUNCTION ZI_MouseOverObjectID LIB "GDIMAGE.DLL" ALIAS "ZI_MouseOverObjectID" () AS LONG
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.00
    ' Retrieve the GDImage mouse captured X,Y location.
    ' Its primary purpose it to be used from a ZI_EventMessage callback.
      DECLARE SUB ZD_GetObjectXYcapture LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectXYcapture" ( _
      BYVAL ObjID AS LONG, _  ' The unique sprite object identifier.
      BYREF x AS LONG, _      ' Return the mouse X cursor location.
      BYREF y AS LONG _       ' Return the mouse Y cursor location.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.00
    ' Retrieve the Item of the sprite being moved.
    ' Its primary purpose it to be used from a ZI_EventMessage callback.
      DECLARE FUNCTION ZI_GetMovingSpriteItem LIB "GDIMAGE.DLL" ALIAS "ZI_GetMovingSpriteItem" () AS LONG
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.00
    ' Retrieve the unique IDentifier of the sprite being moved.
    ' Its primary purpose it to be used from a ZI_EventMessage callback.
      DECLARE FUNCTION ZI_GetMovingSpriteID LIB "GDIMAGE.DLL" ALIAS "ZI_GetMovingSpriteID" () AS LONG
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.00
    ' Retrieve the DIB bitmap handle of the GDImage control background.
      DECLARE FUNCTION ZI_GetBMP LIB "GDIMAGE.DLL" ALIAS "ZI_GetBMP" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
      ) AS LONG
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.00
    ' Create an OpenGL transparent texture from 32-bit PNG using variable opacity.
    ' GDImage takes care of all the hard stuff to create a correct OpenGL texture.
      DECLARE FUNCTION ZI_CreateGLTextureFrom32Bit LIB "GDIMAGE.DLL" ALIAS "ZI_CreateGLTextureFrom32Bit" ( _
      zFullPathName AS ASCIIZ, _        ' Name of the graphic file to create the texture from.
      xPower2 AS LONG, _                ' A value in the range: 2, 4, 16, 32, 64, 128, 256, 512, etc.
      yPower2 AS LONG, _                ' A value in the range: 2, 4, 16, 32, 64, 128, 256, 512, etc.
      PixelArray() AS BYTE _            ' Byte array holding the texture.
      ) AS LONG
    ' Remark:
    ' It can also be used to create opaque texture from a file without alpha channel.
    ' Return:
    ' If the function succeeds the returned value is %TRUE,
    ' and the PixelArray is full of bytes that are already converted to the internal RGBA OpenGL format.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.00
    ' Create on the fly an OpenGL transparent texture from a PNG 32-bit using variable opacity.
      DECLARE FUNCTION ZI_SetGLTextureFrom32Bit LIB "GDIMAGE.DLL" ALIAS "ZI_SetGLTextureFrom32Bit" ( _
      zFullPathName AS ASCIIZ _        ' Name of the graphic file to create the texture from.
      ) AS LONG
    ' Return:
    ' An OpenGL error code in case of Error.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.00
    ' Load multiple OpenGL transparent "Named texture" at once from PNG 32-bit using variable opacity.
      DECLARE FUNCTION ZI_SetMutipleGLTextureFrom32Bit LIB "GDIMAGE.DLL" ALIAS "ZI_SetMutipleGLTextureFrom32Bit" ( _
      BYVAL ztp AS ZGLTEXTURE PTR, _         ' A DWORD PTR to a ZGLTEXTURE array.
      BYVAL N AS LONG _                      ' Number of element in the array
      ) AS LONG
    ' Return:
    ' An OpenGL error code in case of Error.
    
    ' Version 2.00
    '  DECLARE FUNCTION ZI_FitImageFrom32Bit LIB "GDIMAGE.DLL" ALIAS "ZI_FitImageFrom32Bit" (zFullPath AS ASCIIZ, BYVAL Xin AS LONG, BYVAL Yin AS LONG) AS LONG
    
    ' Version 2.01
    ' To force the default folder being used by ZI_LoadDialog
      DECLARE FUNCTION ZI_LoadSavePath LIB "GDIMAGE.DLL" ALIAS "ZI_LoadSavePath" ( _
      zUseThisPath AS ASCIIZ, _              ' The new folder path
      BYVAL SetGet AS LONG _                 ' The Set/Get boolean property: Set = 1, Get = 0.
      ) AS STRING
    ' Return:
    ' The folder path when SetGet is in Get mode.
    
    ' Version 2.02 is DotNET compatible.
    
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.07
    ' Create a valid GDI BITMAP handle from FILE using any of the supported GDImage format,
    ' and using a mirror reflection effect.
      DECLARE FUNCTION ZI_CreateMirrorBitmapFromFile LIB "GDIMAGE.DLL" ALIAS "ZI_CreateMirrorBitmapFromFile" ( _
      zFullImagePath AS ASCIIZ, _      ' The name of an image file.
      BitmapWidth AS LONG, _           ' The width of the bitmap.
      BitmapHeight AS LONG _           ' The Height of the bitmap.
      ) AS LONG
    ' Return:
    ' A valid GDI bitmap handle (do not confuse GDI bitmap handle and GDI+ Image handle).
    ' Important:
    ' You must use DeleteObject(GDIBitmapHandle) when you do not need it anymore.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.09
    ' Twin any GDImage object (sprite bitmap, text, vector object)
    ' The duplicated object will have exactly the same parameters as the original except for the x, y location.
      DECLARE FUNCTION ZD_TwinObject LIB "GDIMAGE.DLL" ALIAS "ZD_TwinObject" ( _
      BYVAL IDtoTwin AS LONG, _       ' The unique IDentifier of the object to duplicate.
      BYVAL TwinID AS LONG, _         ' The unique IDentifier of the new Twin object.
      BYVAL x AS LONG, _              ' The X location in pixel coordinates.
      BYVAL y AS LONG _               ' The Y location in pixel coordinates.
      ) AS LONG
    ' Important:
    ' The duplicated object will have exactly the same parameters as the original except for the x, y location.
    ' However it uses a distinct Font handle for OBJECT_TEXT and a distinct Bitmap handle for OBJECT_IMAGE.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.10
    ' Clone any GDImage object (sprite bitmap, text, vector object)
      DECLARE FUNCTION ZD_CloneObject LIB "GDIMAGE.DLL" ALIAS "ZD_CloneObject" ( _
      BYVAL IDtoClone AS LONG, _      ' The unique IDentifier of the object to duplicate.
      BYVAL CloneID AS LONG, _        ' The unique IDentifier of the new Twin object.
      BYVAL x AS LONG, _              ' The X location in pixel coordinates.
      BYVAL y AS LONG _               ' The Y location in pixel coordinates.
      ) AS LONG
    ' Important:
    ' The clone shares the same handles and parameters than the original, except for the x, y location.
    ' It it doesn't create a distinct Font handle for OBJECT_TEXT, nor a distinct Bitmap handle for OBJECT_IMAGE.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.10
    ' Delete any GDImage object (sprite bitmap, text, vector object)
      DECLARE SUB ZD_DeleteObject LIB "GDIMAGE.DLL" ALIAS "ZD_DeleteObject" ( _
      BYVAL ObjID AS LONG _ ' The unique sprite object identifier.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.10
    ' Apply a scale factor to resize a sprite on the fly
      DECLARE SUB ZD_SetObjectScale LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectScale" ( _
      BYVAL ObjID AS LONG, _       ' The unique sprite object identifier.
      BYVAL ScaleValue AS SINGLE _ ' The scale factor 0.5, 0.75, 0.80, etc.
      )
    ' Note:
    ' The real size of the sprite bitmap stay unchanged, it just affect the way it is being shown.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 2.10
    ' Get the scale factor for the specific sprite identifier
      DECLARE FUNCTION ZD_GetObjectScale LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectScale" ( _
      BYVAL ObjID AS LONG _ ' The unique sprite object identifier.
      ) AS SINGLE
    ' Return:
    ' The current scale factor (default = 1, means no scale factor).
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
    ' Delete all objects matching a specific GDImage control
      DECLARE SUB ZI_DeleteCtrlObject LIB "GDIMAGE.DLL" ALIAS "ZI_DeleteCtrlObject" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
    ' Associate a new memory bitmap matching the client size of the GDImage control
    ' to be used as a private DC.
      DECLARE SUB ZI_SetCtrlEmptyBitmap LIB "GDIMAGE.DLL" ALIAS "ZI_SetCtrlEmptyBitmap" ( _
      BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
      BYVAL RGBcolor AS LONG _      ' The RGB color to paint the memory bitmap background.
      )
    ' Note:
    ' The size of the memory bitmap will match exactly the client size of the GDImage control.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
    ' Get the horizontal scroll range for a specific GDImage control
      DECLARE FUNCTION ZI_GetXscroll LIB "GDIMAGE.DLL" ALIAS "ZI_GetXscroll" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
      ) AS LONG
    ' Return:
    ' The horizontal scroll range in pixel.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
    ' Get the vertical scroll range for a specific GDImage control
      DECLARE FUNCTION ZI_GetYscroll LIB "GDIMAGE.DLL" ALIAS "ZI_GetYscroll" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
      ) AS LONG
    ' Return:
    ' The verical scroll range in pixel.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
    ' Enable/disable the keyboard hook being used to move the sprite with the direction keys.
      DECLARE FUNCTION ZI_DisableKeybHook LIB "GDIMAGE.DLL" ALIAS "ZI_DisableKeybHook" ( _
      BYVAL EnableDisable AS LONG, _ ' TRUE = Disable, FALSE = Enable
      BYVAL RW AS LONG _             ' TRUE = Set EnableDisable value, FALSE = Read EnableDisable value
      ) AS LONG
    ' Remark:
    ' Do it only once per session from the main program section.
    ' Return:
    ' The current status.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
      %OBJECT_TEXT        = 1
      %OBJECT_ELLIPSE     = 2
      %OBJECT_RECT        = 3
      %OBJECT_CURVE       = 4
      %OBJECT_ARROW       = 5
      %OBJECT_POLYLINE    = 6
      %OBJECT_BITMAP      = 7
      %OBJECT_BEZIER      = 8
      %OBJECT_POLYPOLYGON = 9
      %OBJECT_TEXTBITMAP  = 10
    
    ' Retrieve the type of a GDImage sprite object.
      DECLARE FUNCTION ZD_GetObjectType LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectType" ( _
      BYVAL ObjID AS LONG _ ' The unique sprite object identifier.
      ) AS LONG
    ' Return:
    ' The object type
    
    ' Change the type of a GDImage sprite object.
      DECLARE SUB ZD_SetObjectType LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectType" ( _
      BYVAL ObjID AS LONG, _       ' The unique sprite object identifier.
      BYVAL ObjectType AS LONG _   ' The object type (see ZD_GetObjectType)
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
    ' Retrieve the rotation angle of a GDImage sprite object.
      DECLARE FUNCTION ZD_GetObjectAngle LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectAngle" ( _
      BYVAL ObjID AS LONG _
      ) AS LONG
    ' Return:
    ' The rotation angle in degree (0-360).
    
    ' Set the rotation angle of a GDImage sprite object.
      DECLARE SUB ZD_SetObjectAngle LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectAngle" ( _
      BYVAL ObjID AS LONG, _       ' The unique sprite object identifier.
      BYVAL AngleDegree AS LONG, _ ' Value must fit within the 0-360 degree range.
      BYVAL RedrawParent AS LONG _ ' TRUE causes immediat redraw of the object parent.
      )
    ' Remark:
    ' Full rotation angle applies only to bitmap objects (OBJECT_BITMAP and OBJECT_TEXTBITMAP).
    '****************************************************************************
    '
    '****************************************************************************
      %InterpolationModeDefault = 0
      %InterpolationModeLowQuality = 1
      %InterpolationModeHighQuality = 2'%QualityModeHigh
      %InterpolationModeBilinear = 3
      %InterpolationModeBicubic = 4
      %InterpolationModeNearestNeighbor = 5
      %InterpolationModeHighQualityBilinear = 6
      %InterpolationModeHighQualityBicubic = 7
    
    ' Version 3.00
    ' Get the rendering quality (interpolation mode) of a GDImage sprite object.
      DECLARE FUNCTION ZD_GetObjectQuality LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectQuality" ( _
      BYVAL ObjID AS LONG _  ' The unique sprite object identifier.
      ) AS LONG
    ' Return:
    ' An interpolation mode constant (int the range 0-7).
    
    ' Set the rendering quality of a GDImage sprite object.
      DECLARE SUB ZD_SetObjectQuality LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectQuality" ( _
      BYVAL ObjID AS LONG, _       ' The unique sprite object identifier.
      BYVAL Quality AS LONG, _     ' One interpolation mode constant (in the range 0-7).
      BYVAL RedrawParent AS LONG _ ' TRUE causes immediat redraw of the object parent.
      )
    ' Remark:
    ' Quality must match one interpolation mode constant.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
    ' Get the 32-bit ARGB color of a GDImage object.
      DECLARE FUNCTION ZD_GetObjectARGBcolor LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectARGBcolor" ( _
      BYVAL ObjID AS LONG _ ' The unique sprite object identifier.
      ) AS LONG
    ' Return:
    ' The ARGB color with Alpha channel.
    
    ' Set the 32-bit ARGB color of a GDImage object (including its Alpha channel)
      DECLARE SUB ZD_SetObjectARGBcolor LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectARGBcolor" ( _
      BYVAL ObjID AS LONG, _  ' The unique sprite object identifier.
      BYVAL UseARGB AS LONG _ ' The ARGB color with Alpha channel.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
    ' Get the flip mode of a specific bitmap sprite object.
      DECLARE FUNCTION ZD_GetObjectFlipMode LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectFlipMode" ( _
      BYVAL ObjID AS LONG _ ' The unique sprite object identifier.
      ) AS LONG
    ' Return:
    ' The flip mode, that is a combination of the (ZD_Reverse = 2) and/or (ZD_Flip = 1) constant.
    
    ' Set the flip mode of a specific bitmap sprite object.
      DECLARE SUB ZD_SetObjectFlipMode LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectFlipMode" ( _
      BYVAL ObjID AS LONG, _      ' The unique sprite object identifier.
      BYVAL FipMode AS LONG _     ' A combination of the (ZD_Reverse = 2) and/or (ZD_Flip = 1) constant.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
    ' Get the rotation angle of a specific bitmap sprite object.
      DECLARE FUNCTION ZD_GetObjectRotation LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectRotation" ( _
      BYVAL ObjID AS LONG _ ' The unique sprite object identifier.
      ) AS LONG
    ' Return:
    ' The rotation angle in degree.
    
    ' Set the rotation mode of a specific bitmap sprite object.
      DECLARE SUB ZD_SetObjectRotation LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectRotation" ( _
      BYVAL ObjID AS LONG, _      ' The unique sprite object identifier.
      BYVAL AngleDegree AS LONG _ ' The rotation angle in degree.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
    ' Update the clone ID parameter of a specific bitmap sprite object.
      DECLARE SUB ZD_SetObjectClone LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectClone" ( _
      BYVAL ObjID AS LONG, _  ' The unique sprite object identifier.
      BYVAL CloneID AS LONG _ ' The new clone ID to use
      )
    ' Remark:
    ' Internal use only!
    
    ' Get the clone ID parameter of a specific bitmap sprite object.
      DECLARE FUNCTION ZD_GetObjectClone LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectClone" ( _
      BYVAL ObjID AS LONG _ ' The unique sprite object identifier.
      ) AS LONG
    ' Return:
    ' The unique ID of the clone object if any.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
    ' Get the TRUE/FALSE PNG variable opacity status of a bitmap sprite object.
      DECLARE FUNCTION ZD_GetObjectOpacity LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectOpacity" ( _
      BYVAL ObjID AS LONG _ ' The unique sprite object identifier.
      ) AS LONG
    ' Return:
    ' A boolean True(-1) or False(0) value.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
    ' To change (on the fly) the bitmap associated to a GDImage bitmap sprite object.
      DECLARE FUNCTION ZD_SetObjectBitmapFromFile LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectBitmapFromFile" ( _
      zFullName AS ASCIIZ, _       ' Full path name to any of the supported graphic format.
      BYVAL ObjID AS LONG, _       ' The unique sprite object identifier.
      BYVAL RedrawParent AS LONG _ ' TRUE causes immediat redraw of the object parent.
      ) AS LONG
    ' Remark:
    ' The file can use any of the supported raster graphic format.
    ' Return:
    ' The new bitmap handle
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
    ' Create a bitmap sprite object from a text using a True Type Font.
      DECLARE FUNCTION ZD_CreateBitmapFromText LIB "GDIMAGE.DLL" ALIAS "ZD_CreateBitmapFromText" ( _
      zUseText AS ASCIIZ, _                 ' The text string to convert to bitmap.
      zUseFont AS ASCIIZ, _                 ' The True Type Font to use.
      BYVAL UseSize AS LONG, _              ' The pixel size to use.
      BYVAL ColrARGB AS LONG, _             ' The ARGB color to use
      OPTIONAL BYVAL Use3D AS LONG, _       ' The shadow 3D offset.
      OPTIONAL BYVAL UseStrFormat AS LONG _ ' Not needed
      ) AS LONG
    ' Return:
    ' The bitmap handle of the new OBJECT_TEXTBITMAP.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
    ' Replace the bitmap of an existing bitmap sprite object with a new one.
      DECLARE SUB ZD_SetObjectBitmapFromBitmap LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectBitmapFromBitmap" ( _
      BYVAL hBitmap AS LONG, _     ' The new bitmap to use.
      BYVAL ObjID AS LONG, _       ' The unique sprite object identifier.
      BYVAL RedrawParent AS LONG _ ' TRUE causes immediat redraw of the object parent.
      )
    ' Remark:
    ' This is suitable to perform animation of a bitmap sprite object.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
    ' GDImage 32-bit alphablend API to display bitmap with transparent or semitransparent pixels.
      DECLARE SUB ZI_AlphaBlendEx LIB "GDIMAGE.DLL" ALIAS "ZI_AlphaBlendEx" ( _
      BYVAL hDCDest AS LONG, _     ' Hhandle to destination DC.
      BYVAL xDest AS LONG, _       ' X-coord of upper-left corner.
      BYVAL yDest AS LONG, _       ' Y-coord of upper-left corner.
      BYVAL wDest AS LONG, _       ' Destination width.
      BYVAL hDest AS LONG, _       ' Destination height.
      BYVAL hDCSrce AS LONG, _     ' Handle to source DC.
      BYVAL xSrce AS LONG, _       ' X-coord of upper-left corner.
      BYVAL ySrce AS LONG, _       ' Y-coord of upper-left corner.
      BYVAL wSrce AS LONG, _       ' Source width.
      BYVAL hSrce AS LONG, _       ' Source height.
      BYVAL Alpha AS LONG, _       ' Alpha level in the range 0-255 (0 = transparent, 255 = opaque).
      BYVAL AngleDegree AS LONG, _ ' Rotation angle in degree.
      BYVAL Quality AS LONG _      ' Interpolation mode.
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
    ' Display the common save to file dialog providing a valid hParent and hGDImageCtrl handle.
      DECLARE FUNCTION ZI_SaveLayersDialog LIB "GDIMAGE.DLL" ALIAS "ZI_SaveLayersDialog" ( _
      BYVAL hParent AS LONG, _      ' The parent window handle.
      BYVAL hGDImageCtrl AS LONG, _ ' The GDImage control handle.
      BYVAL Quality AS LONG,  _     ' Use this for JPEG quality.
      BYVAL Orientation AS LONG, _  ' Orientation mode.
      BYVAL UseWidth AS LONG, _     ' Optional parameter to fit the image into a specific width.
      BYVAL UseHeight AS LONG _     ' Optional parameter to fit the image into a specific height.
      ) AS LONG
    ' Return:
    ' Error code in case of error, zero if succesful.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
    ' Update the SCROLLINFO structure of a GDImage Zoom control.
      DECLARE SUB ZI_SetZoomScrollInfo LIB "GDIMAGE.DLL" ALIAS "ZI_SetZoomScrollInfo" ( _
      BYVAL hGDImageCtrl AS LONG, _   ' The GDImage control handle.
      BYVAL OldZoomValue AS SINGLE, _ ' Old zoom value
      BYVAL ZoomValue AS SINGLE _     ' New zoom value
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.00
    ' Set the positive or negative value of the 3D shadow offset for text and vector sprite objects.
      DECLARE SUB ZD_SetObjectUse3Dshadow LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectUse3Dshadow" ( _
      BYVAL ObjID AS LONG, _  ' The unique sprite object identifier.
      BYVAL Use3D AS LONG _   ' The positive or negative shadow offset value.
      )
    ' Remark:
    ' Negative value = shadow offset bottom left.
    ' Positive value = shadow offset bottom right.
    
    ' Get the sprite object 3D shadow offset.
      DECLARE FUNCTION ZD_GetObjectUse3Dshadow LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectUse3Dshadow" ( _
      BYVAL ObjID AS LONG _ ' The unique sprite object identifier.
      ) AS LONG
    ' Return:
    ' The positive or negative value for the 3D shadow offset if any.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.01
    ' Get the bitmap associated to a GDImage sprite OBJECT_BITMAP.
      DECLARE FUNCTION ZD_GetObjectBitmap LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectBitmap" ( _
      BYVAL ObjID AS LONG _ ' The unique sprite object identifier.
      ) AS LONG
    ' Return:
    ' The OBJECT_BITMAP handle if any.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.01
    ' Resize an existing bitmap into a new one using the specificied width and height size.
      DECLARE FUNCTION ZI_ResizeBitmapFromBitmap LIB "GDIMAGE.DLL" ALIAS "ZI_ResizeBitmapFromBitmap" ( _
      BYVAL BmpSrce AS LONG, _  ' The bitmap to duplicate.
      BYVAL UseWidth AS LONG, _ ' Width of the new bitmap to create.
      BYVAL UseHeight AS LONG _ ' Height of the new bitmap to create.
      ) AS LONG
    ' Return:
    ' A valid GDI bitmap handle, or NULL in case of error.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.01
    ' Load and resize a bitmap from file into one single step.
      DECLARE FUNCTION ZI_ResizeBitmapFromFile LIB "GDIMAGE.DLL" ALIAS "ZI_ResizeBitmapFromFile" ( _
      zFullName AS ASCIIZ, _    ' Full path name to any of the supported graphic format.
      BYVAL UseWidth AS LONG, _ ' Width of the new bitmap to create.
      BYVAL UseHeight AS LONG _ ' Height of the new bitmap to create.
      ) AS LONG
    ' Return:
    ' A valid bitmap handle or NULL in case of error.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.02
    ' Enable the drawing of a rectangular section in XOR mode using the left mouse button.
      DECLARE SUB ZI_EnableCropRectangle LIB "GDIMAGE.DLL" ALIAS "ZI_EnableCropRectangle" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
      )
    ' Remark:
    ' Once selected, the rectangular section can be resized.
    ' Once done, click on the right mouse button to pop up the contextuel menu "Select, Cancel"
    ' or use "double click" to validate the selection.
    '
    ' Important:
    ' In case of validation, GDImage post a WM_COMMAND message to the parent owner of the control
    ' using a ZM_Crop notification this way:
    ' PostMessage(GetParent(GDImageControl), WM_COMMAND, MAKLNG(GetDlgCtrlID(GDImageControl), ZM_Crop), MenuChoice)
    ' The (lParam) MenuChoice = 1, means the selection has been validated.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.02
    ' Disable (cancel) the drawing of a rectangular section.
      DECLARE SUB ZI_DisableCropRectangle LIB "GDIMAGE.DLL" ALIAS "ZI_DisableCropRectangle" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
      )
    ' See also:
    ' ZI_EnableCropRectangle
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.02
    ' Disable any drawing tool.
      DECLARE SUB ZI_DisableAllTools LIB "GDIMAGE.DLL" ALIAS "ZI_DisableAllTools" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
      )
    ' See also:
    ' ZI_EnableCropRectangle
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.02
    ' To edit the language being used for the contextual popup menu.
      DECLARE SUB ZI_SetCropPopupText LIB "GDIMAGE.DLL" ALIAS "ZI_SetCropPopupText" ( _
      zMenu AS ASCIIZ _ ' The text of the popup menu (use "," as delimiter) ex: "Select,Cancel"
      )
    ' See also:
    ' ZI_EnableCropRectangle
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.02
    ' Get the coordinates of the rectangular selected area.
      DECLARE SUB ZI_GetCropCoordinates LIB "GDIMAGE.DLL" ALIAS "ZI_GetCropCoordinates" ( _
      BYREF x AS LONG, _        ' Crop X location
      BYREF y AS LONG, _        ' Crop Y location
      BYREF UseWidth AS LONG, _ ' Crop Width
      BYREF UseHeight AS LONG _ ' Crop Height
      )
    ' Remark:
    ' This must be done in the GDImage parent form,
    ' while you process the WM_COMMAND message to detect for the ZM_Crop notification.
    ' See also:
    ' ZI_EnableCropRectangle
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.02
    ' Create a bitmap matching a GDImage control selected area.
      DECLARE FUNCTION ZI_CropWindowToBitmap LIB "GDIMAGE.DLL" ALIAS "ZI_CropWindowToBitmap"( _
      BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
      BYVAL x AS LONG, _            ' Crop X location
      BYVAL y AS LONG, _            ' Crop Y location
      BYVAL UseWidth AS LONG, _     ' Crop Width
      BYVAL UseHeight AS LONG _     ' Crop Height
      ) AS LONG
    ' Return:
    ' A valid GDI bitmap handle, or NULL in case of error.
    ' See also:
    ' ZI_EnableCropRectangle
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.02
    ' Copy a GDImage DIB into the clipboard as a compatible bitmap.
      DECLARE FUNCTION ZI_PutBitmapToClipboard LIB "GDIMAGE.DLL" ALIAS "ZI_PutBitmapToClipboard" ( _
      BYVAL ThisBitmap AS LONG _ ' A valid GDImage DIB bitmap handle
      ) AS LONG
    ' Return:
    ' A boolean True(-1) in case of succes or False(0) in case of error.
    ' Remark:
    ' The clipboard is unable to store bitmap larger than 16Gb.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.02
    ' Get the TRUE or FALSE selected status of a sprite object.
      DECLARE FUNCTION ZD_GetObjectSelected LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectSelected" ( _
      BYVAL ObjID AS LONG _  ' The unique sprite object identifier.
      ) AS LONG
    ' Return:
    ' True(-1) if selected or False(0) if unselected.
    ' See also:
    ' ZD_SetObjectSelected
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.02
    ' Set the TRUE or FALSE selected status of a sprite object.
      DECLARE SUB ZD_SetObjectSelected LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectSelected" ( _
      BYVAL ObjID AS LONG, _       ' The unique sprite object identifier.
      BYVAL OnOff AS LONG, _       ' True = Enabled (Selected) or False = Disabled (default)
      BYVAL RedrawParent AS LONG _ ' TRUE causes immediat redraw of the object parent
      )
    ' See also:
    ' ZD_GetObjectSelected
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.02
    ' Clear all selected objects matching a specific GDImage control.
      DECLARE SUB ZI_ClearObjectSelected LIB "GDIMAGE.DLL" ALIAS "ZI_ClearObjectSelected" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDImage control handle.
      )
    ' See also:
    ' ZD_GetObjectSelected, ZD_SetObjectSelected
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.02
    ' Detect if there is any selected object in a specific GDImage control.
      DECLARE FUNCTION ZI_ObjectSelected LIB "GDIMAGE.DLL" ALIAS "ZI_ObjectSelected" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDImage control handle.
      ) AS LONG
    ' Return:
    ' The ID of the first selected object found.
    ' See also:
    ' ZD_GetObjectSelected, ZD_SetObjectSelected, ZI_ClearObjectSelected
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.02
    ' Retrieve all the properties of a GDImage sprite object in one single step.
      DECLARE SUB ZD_GetObjectProperties LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectProperties" ( _
      BYVAL ObjID AS LONG, _       ' The unique sprite object identifier.
      zDetail AS ZOBJECT _         ' Reference to the matching ZOBJECT structure.
      )
    ' Remark:
    ' This is a low level GDImage API.
    ' See also:
    ' ZD_SetObjectProperties
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.02
    ' Update all the propreties of a GDImage sprite object in one single step.
      DECLARE SUB ZD_SetObjectProperties LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectProperties" ( _
      BYVAL ObjID AS LONG, _       ' The unique sprite object identifier.
      zDetail AS ZOBJECT _         ' Reference to the matching ZOBJECT structure.
      )
    ' Remark:
    ' This is a low level GDImage API.
    ' See also:
    ' ZD_GetObjectProperties
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.02
    ' Flatten all layers (visible sprite objects) with respect of their z-order, into a new memory bitmap.
      DECLARE FUNCTION ZI_RenderLayersToBitmap LIB "GDIMAGE.DLL" ALIAS "ZI_RenderLayersToBitmap" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDImage control handle.
      ) AS LONG
    ' Return:
    ' The handle of the new memory bitmap.
    ' See also:
    ' ZI_RenderLayersToFile
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.50
    ' Low level procedure to get the Windows temp directory path.
      DECLARE FUNCTION zGetTempPath LIB "GDIMAGE.DLL" ALIAS "zGetTempPath" () AS STRING
    ' Return:
    ' The full qualified Windows temp directory path.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.50
    ' Low level procedure to delete file (remove) file from disk (the file is not sent to tray).
      DECLARE FUNCTION zKillFile LIB "GDIMAGE.DLL" ALIAS "zKillFile" (zFullName AS ASCIIZ) AS LONG
    ' Return:
    ' Error code in case of error, zero if succesful.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.50
    ' Move the specified file to tray.
      DECLARE FUNCTION ZI_MoveToTray LIB "GDIMAGE.DLL" ALIAS "ZI_MoveToTray"(zFullName AS ASCIIZ) AS LONG
    ' Return:
    ' Error code in case of error, zero if succesful.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.50
    ' Display the GDImage dialog True Type Font Text editor.
      DECLARE FUNCTION ZI_FontBox LIB "GDIMAGE.DLL" ALIAS "ZI_FontBox" ( _
      BYVAL hParent AS LONG, _  ' The parent window handle.
      zCaption AS ASCIIZ, _     ' The font box caption.
      zUseText AS ASCIIZ, _     ' The string to edit.
      zUseFont AS ASCIIZ, _     ' The font to use.
      BYREF UseSize AS LONG, _  ' The pixel size to use.
      BYREF ColrARGB AS LONG, _ ' The ARGB color to use
      BYREF Use3D AS LONG _     ' The shadow 3D offset.
      ) AS LONG
    ' Return:
    ' Return = 2 when the user clic the "Ok" button to validate the input, any other value must be ignored.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.50
    ' To change the default Font Box parameters.
      DECLARE SUB ZI_SetFontBoxParameters LIB "GDIMAGE.DLL" ALIAS "ZI_SetFontBoxParameters" ( _
      BYVAL SquareSize AS LONG, _    ' Default 640 x 640 pixels
      BYVAL MaxFontSize AS LONG, _   ' Default 512 pixels
      BYVAL TextCharLength AS LONG _ ' Default 64 characters
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.50
    ' The Crop tool status mode.
      DECLARE FUNCTION ZI_GetToolCropStatus LIB "GDIMAGE.DLL" ALIAS "ZI_GetToolCropStatus" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
      ) AS LONG
    ' Return:
    ' True = Crop status is On, False = Crop status is false.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.50
    ' Get the font string format of a text sprite object.
      DECLARE FUNCTION ZD_GetStringFormat LIB "GDIMAGE.DLL" ALIAS "ZD_GetStringFormat" ( _
      BYVAL ObjID AS LONG _        ' The unique object IDentifier (each object MUST USE A UNIQUE one)
      ) AS LONG
    ' Return:
    ' A constant value, matching the current string format: ZD_TextHorzUp, ZD_TextVertUp, ZD_TextVertDn
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.50
    ' Set the font string format of a text sprite object.
      DECLARE SUB ZD_SetStringFormat LIB "GDIMAGE.DLL" ALIAS "ZD_SetStringFormat" ( _
      BYVAL ObjID AS LONG, _       ' The unique object IDentifier (each object MUST USE A UNIQUE one)
      BYVAL StrFormat AS LONG, _   ' The constant value to use: ZD_TextHorzUp, ZD_TextVertUp, ZD_TextVertDn
      BYVAL RedrawParent AS LONG _ ' TRUE causes immediat redraw of the object parent
      )
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.51
    ' List of parameters
    ' szProfileName =  A profile name, limited to 256 characters or less. This is the profile
    '                  to use when logging on. If you pass an empty string, and the flFlags
    '                  parameter is set to %MAPI_LOGON_UI, MAPILogon displays a logon dialog
    '                  box with an empty name field.
    ' szPassword    =  A credential string, limited to 256 characters or less. If the
    '                  messaging system does not require password credentials, or if it
    '                  requires that the user enter them, the strPassword parameter should be
    '                  an empty string. When the user must enter credentials, the flFlags
    '                  parameter must be set to %MAPI_LOGON_UI to allow a logon dialog box to
    '                  be displayed.
    ' szSubject     =  Subject of the email.
    ' szNote        =  Email text.
    ' szAddresses   =  A list of email addresses separated by ;'s Make sure to put in the
    '                  message type preceded by a : if it's not being delivered to an MS Mail
    '                  post office. For example, if you're sending mail out to the internet
    '                  via MS Mail, the mail type is SMTP. You will need to preceed the
    '                  address with SMTP:
    '                  e.g. "SMTP:[email protected];SMTP:[email protected]"
    ' szFiles       =  A list of ; delimited file names (full drive letter, file path and file
    '                  name must be included). If the file doesn't exist (DIR$(FileName) = "")
    '                  then it will be ignored.
      DECLARE FUNCTION zSendMapiMail LIB "GDIMAGE.DLL"  ALIAS "zSendMapiMail" ( _
      szProfileName AS ASCIIZ, _
      szPassword AS ASCIIZ, _
      szSubject AS ASCIIZ, _
      szNote AS ASCIIZ, _
      szNames AS ASCIIZ, _
      szAddresses AS ASCIIZ, _
      szFiles AS ASCIIZ _
      ) AS DWORD
    ' Return:
    ' A MAPI Error code if any, and null in case of success.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.51 (pro version only)
    ' Put the focus on a specific GDImage sprite object.
      DECLARE SUB ZI_SetObjectFocusID LIB "GDIMAGE.DLL" ALIAS "ZI_SetObjectFocusID" ( _
      BYVAL ObjID AS LONG _        ' The unique object IDentifier (each object MUST USE A UNIQUE one)
      )
    ' Remark:
    ' Same effect that to clic with the left mouse button on a GDImage sprite object.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.51
    ' Get the number of objects being used in a specific GDImage control.
      DECLARE FUNCTION ZI_GetCtrlObjectCount LIB "GDIMAGE.DLL" ALIAS "ZI_GetCtrlObjectCount" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
      ) AS LONG
    ' Return:
    ' The object count.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.51
    ' Get the alpha channel value of a specific GDImage object.
      DECLARE FUNCTION ZD_GetObjectAlpha LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectAlpha" ( _
      BYVAL ObjID AS LONG _        ' The unique object IDentifier (each object MUST USE A UNIQUE one)
      ) AS LONG
    ' Return:
    ' The alpha channel value in the range 0-255 (0 = full transparency, 255 = full opacity).
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.51
    ' To create a tooltip, to be used with a GDImage control.
      DECLARE FUNCTION ZI_CreateToolTip LIB "GDIMAGE.DLL" ALIAS "ZI_CreateToolTip" ( _
      BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
      zText AS ASCIIZ _             ' The tooltip text to display.
      ) AS LONG
    ' Return:
    ' The handle of the tooltip.
    '
    ' Remark:
    ' This function must be called only once, to create the initial tooltip container.
    ' To change the text of the tooltip when the mouse hover a specific object, use ZI_SetToolTipText.
    '
    ' Usualy the tooltip text matches the object label.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.51
    ' To change the text of an existing GDImage control tooltip.
      DECLARE SUB ZI_SetToolTipText LIB "GDIMAGE.DLL" ALIAS "ZI_SetToolTipText" ( _
      BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
      zText AS ASCIIZ _             ' The tooltip text to display.
      )
    ' Remark:
    ' The tooltip must have been first created with ZI_CreateToolTip.
    ' Usualy the tooltip text matches the object label.
    ' It is of the programmer's responsability to change the text of the tooltip
    ' when the mouse hover a specific GDImage object.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.52
    ' Create a square canvas using a specific size to stretch the source bitmap into it.
    ' Note: a sprite always use a square size to ease further rotation computation.
      DECLARE FUNCTION ZI_CreateSpriteFileFromBitmap LIB "GDIMAGE.DLL" ALIAS "ZI_CreateSpriteFileFromBitmap" ( _
      zFullPathName AS ASCIIZ, _      ' The full path name of the sprite graphic file to create
      BYVAL BmpSrce AS LONG, _        ' The source bitmap to create the sprite from.
      BYVAL UseSize AS LONG, _        ' The size of the sprites's canvas square (16, 32, 64, 128, 256, 512)
      BYVAL JpegQuality AS LONG _     ' In case of JPEG format, the encoding quality 1-100
      )AS LONG
    ' Return:
    ' A status error code, or null in case of success.
    ' Remark:
    ' Stretching is done using high quality bicubic interpolation.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 3.52
    ' Open the GDImage common save dialog to select a specific folder and enter/edit the filename.
      DECLARE FUNCTION ZI_ChooseSaveFileName LIB "GDIMAGE.DLL" ALIAS "ZI_ChooseSaveFileName" ( _
      BYVAL hParent AS LONG, _        ' The parent window handle.
      zDefaultName AS ASCIIZ _        ' The default file name to edit.
      ) AS STRING
    ' Return:
    ' The full path name of the file to save.
    ' Remark:
    ' Once you have got the file name, you can use: ZI_SaveToFile
    ' See also:
    ' ZI_SaveDialog
    '****************************************************************************
    '
    '****************************************************************************
    '//3.55
    ' To create a variable opacity PNG file from any of the supported graphic file format.
      DECLARE FUNCTION ZI_CreateVariableOpacityPGN LIB "GDIMAGE.DLL" ALIAS "ZI_CreateVariableOpacityPGN" ( _
      zInputName AS ASCIIZ, _  ' Full path name of the input graphic file to convert.
      zOutputName AS ASCIIZ _  ' Full path name to the output PNG graphic file to create.
      ) AS LONG
    ' Remark:
    ' The zOutputName is always a PNG graphic file using the .png extension.
    ' Return:
    ' A status generic error or null if all went fine.
    '****************************************************************************
    '
    '****************************************************************************
    '//3.55
    ' Create a variable opacity memory bitmap, from any of the supported graphic file format.
      DECLARE FUNCTION ZI_CreateVariableOpacityBitmap LIB "GDIMAGE.DLL" ALIAS "ZI_CreateVariableOpacityBitmap" ( _
      zInputName AS ASCIIZ, _  ' Full path name of the input graphic file source.
      imgW AS LONG, _          ' Width of the image.
      imgH AS LONG _           ' Height of the image.
      ) AS LONG
    ' Return:
    ' A valid bitmap handle or null in case of error.
    '****************************************************************************
    '
    '****************************************************************************
    '//3.55
    ' Add a TEXT bitmap sprite object to a GDImage control.
      DECLARE FUNCTION ZD_DrawTextBitmapToCtrl LIB "GDIMAGE.DLL" ALIAS "ZD_DrawTextBitmapToCtrl" ( _
      BYVAL hGDImageCtrl AS LONG, _        ' The GDImage control handle.
      BYVAL x AS LONG, _                   ' The X coordinate.
      BYVAL y AS LONG, _                   ' The Y coordinate.
      BYVAL hBitmap AS LONG, _             ' The TEXT bitmap to use.
      BYVAL ColrARGB AS LONG, _            ' The ARGB color to use.
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL ZS_STYLE AS LONG _             ' The object Generic STYLE (use at least %ZS_VISIBLE to show it).
      ) AS LONG
    ' Remark:
    ' The TEXT bitmap must have been created first using ZD_CreateBitmapFromText
    ' Return:
    ' TRUE (-1) if success, FALSE (0) if error.
    '****************************************************************************
    '
    '****************************************************************************
    ' Version 4.01
    ' Return the number of selected object in a specific GDImage control.
      DECLARE FUNCTION ZI_SelectedCount LIB "GDIMAGE.DLL" ALIAS "ZI_SelectedCount" ( _
      BYVAL hGDImageCtrl AS LONG _ ' The GDImage control handle.
      ) AS LONG
    ' Return:
    ' The selected object Count.
    ' See also:
    ' ZD_GetObjectSelected, ZD_SetObjectSelected, ZI_ClearObjectSelected
    '****************************************************************************
    '
    '****************************************************************************
    '//3.57
    ' Retrieve the unique IDentifier of the first object whose bound limits are hovered by the mouse.
    ' Its primary purpose it to be used from a ZI_EventMessage callback.
      DECLARE FUNCTION ZI_MouseHoverBoundID LIB "GDIMAGE.DLL" ALIAS "ZI_MouseHoverBoundID" () AS LONG
    ' Return:
    ' The unique IDentifier of the matching GDImage sprite object.
    '****************************************************************************
    '
    '****************************************************************************
    '//3.57
    ' Create a GDIPLUS compatible 32-bit DIB DC.
      DECLARE FUNCTION ZI_Create32bitDC LIB "GDIMAGE.DLL" ALIAS "ZI_Create32bitDC" ( _
      BYVAL nWidth AS LONG, _      ' The DIB width.
      BYVAL nHeight AS LONG, _     ' The DIB height.
      BYVAL ARGBcolor AS LONG _    ' FULL ARGB color to paint the DIB background.
      ) AS LONG
    ' Return:
    ' The DC (device context) of the 32-bit DIB or NULL in case of error.
    '****************************************************************************
    '
    '****************************************************************************
    '//3.57
    ' Create an empty image background (Bitmap) into a GDImage control.
    ' Use it to perform direct drawing, everything lying out of it (overlay objects) would be clipped.
      DECLARE FUNCTION ZI_CreateImageBackgroundEx LIB "GDIMAGE.DLL" ALIAS "ZI_CreateImageBackgroundEx" ( _
      BYVAL hGDImageCtrl AS LONG, _        ' The GDImage control handle.
      BYVAL BitmapWidth AS LONG, _         ' The width of the bitmap.
      BYVAL BitmapHeight AS LONG, _        ' The Height of the bitmap.
      BYVAL UseColor AS LONG, _            ' a 24-bit RGB color or 32-bit ARGB color if BitPerPixel = 32
      BYVAL BitPerPixel AS LONG _          ' 24 or 32-bit
      ) AS LONG
    ' Return:
    ' A valid GDImage DC (ZI_GetDC) you can use to draw in.
    ' Note: After drawing into the provided DC, use ZI_UpdateWindow to refresh the display.
    '****************************************************************************
    '
    '****************************************************************************
    '//3.56
    ' Paint a sprite object onto the background of a specific GDImage control.
      DECLARE FUNCTION ZD_CopyToBackground LIB "GDIMAGE.DLL" ALIAS "ZD_CopyToBackground" ( _
      BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
      BYVAL ObjID AS LONG, _        ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL ClearBack AS LONG, _    ' Boolean flag, use %TRUE to paint first the background with the following RGBcolor.
      BYVAL RGBColor AS LONG _      ' The RGB color to use to paint the bitmap background if ClearBack = %TRUE.
      ) AS LONG
    ' Return:
    ' None.
    '****************************************************************************
    '
    '****************************************************************************
    '//2.11
    ' Flip a bitmap sprite object horizontaly.
      DECLARE SUB ZD_FlipObjectX LIB "GDIMAGE.DLL" ALIAS "ZD_FlipObjectX" ( _
      BYVAL ObjID AS LONG _        ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      )
    ' Remark:
    ' The type of the sprite object must be: OBJECT_BITMAP or OBJECT_TEXTBITMAP exclusively.
    '****************************************************************************
    '
    '****************************************************************************
    '//2.11
    ' Flip a bitmap sprite object verticaly.
      DECLARE SUB ZD_FlipObjectY LIB "GDIMAGE.DLL" ALIAS "ZD_FlipObjectY" ( _
      BYVAL ObjID AS LONG _        ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      )
    ' Remark:
    ' The type of the sprite object must be: OBJECT_BITMAP or OBJECT_TEXTBITMAP exclusively.
    '****************************************************************************
    '
    '****************************************************************************
    '//2.11
    ' Rotate a bitmap sprite object by step of 90° counter clock.
      DECLARE SUB ZD_RotateObjectCounterclock90 LIB "GDIMAGE.DLL" ALIAS "ZD_RotateObjectCounterclock90" ( _
      BYVAL ObjID AS LONG _        ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      )
    ' Remark:
    ' The type of the sprite object must be: OBJECT_BITMAP or OBJECT_TEXTBITMAP exclusively.
    '****************************************************************************
    '
    '****************************************************************************
    '//2.11
    ' Rotate a bitmap sprite object by step of 90° clock wise.
      DECLARE SUB ZD_RotateObjectClockWise90 LIB "GDIMAGE.DLL" ALIAS "ZD_RotateObjectClockWise90" ( _
      BYVAL ObjID AS LONG _        ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      )
    ' Remark:
    ' The type of the sprite object must be: OBJECT_BITMAP or OBJECT_TEXTBITMAP exclusively.
    '****************************************************************************
    '
    '****************************************************************************
    '//3.56
    ' To retrieve the IDentifier of the sprite object that has captured the mouse.
      DECLARE FUNCTION ZD_ObjectMouseCaptured LIB "GDIMAGE.DLL" ALIAS "ZD_ObjectMouseCaptured" () AS LONG
    ' Return:
    ' A GDImage sprite object IDentifier or NULL if none has captured the mouse.
    '****************************************************************************
    '
    '****************************************************************************
    '//3.57
    ' Replace the bitmap of a specific GDImage sprite object with a new one.
    ' Note: it also affects this new bitmap to the related clones if any.
      DECLARE SUB ZD_ReplaceObjectBitmap LIB "GDIMAGE.DLL" ALIAS "ZD_ReplaceObjectBitmap" ( _
      BYVAL hBitmap AS LONG, _     ' The new bitmap to use.
      BYVAL ObjID AS LONG, _       ' The unique sprite object identifier.
      BYVAL RedrawParent AS LONG _ ' TRUE causes immediat redraw of the object parent.
      )
    ' Remark:
    ' The type of the sprite object must be: OBJECT_BITMAP or OBJECT_TEXTBITMAP exclusively.
    '****************************************************************************
    '
    '****************************************************************************
    
    
    
    
    ' Undocumented features
    ' *********************
    '//3.53
    ' To set/get the default Load Dialog file extension.
      DECLARE FUNCTION ZI_SetLoadExtension LIB "GDIMAGE.DLL" ALIAS "ZI_SetLoadExtension" ( _
      zExtension AS ASCIIZ, _  ' The file extension to use.
      BYVAL RW AS LONG _       ' TRUE = Set extension, FALSE = Read extension.
      ) AS STRING
    ' Remark:
    ' File extension must be of the form "*.PCS (PhotoComposer Script)|*.pcs"
    
    '//3.53
    ' To set/get the default Save Dialog file extension.
      DECLARE FUNCTION ZI_SetSaveExtension LIB "GDIMAGE.DLL" ALIAS "ZI_SetSaveExtension" ( _
      zExtension AS ASCIIZ, _  ' The file extension to use.
      BYVAL RW AS LONG _       ' TRUE = Set extension, FALSE = Read extension.
      ) AS STRING
    ' Remark:
    ' File extension must be of the form "*.PCS (PhotoComposer Script)|*.pcs"
    
    '//3.56
    ' Returns a registry string.
      DECLARE FUNCTION zGetReg LIB "GDIMAGE.DLL" ALIAS "zGetReg" (BYVAL hLocation AS DWORD, zSubKeys AS ASCIIZ, zValueName AS ASCIIZ) AS STRING
    
    '//3.56
    ' Saves a string value to the registry, returns nonzero if successful.
      DECLARE FUNCTION zSetReg LIB "GDIMAGE.DLL" ALIAS "zSetReg" (BYVAL hLocation AS DWORD, zSubKeys AS ASCIIZ, zValueName AS ASCIIZ, zData AS ASCIIZ) AS LONG
    
    '//3.56
    ' To check the Hidden status of a GDImage sprite object.
      DECLARE FUNCTION ZD_IsObjectHidden LIB "GDIMAGE.DLL" ALIAS "ZD_IsObjectHidden" ( _
      BYVAL ObjID AS LONG _         ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      ) AS LONG
    ' See also:
    ' ZD_SetObjectHidden
    
    '//3.56
    ' Set the HIDDEN state of a GDImage sprite object.
      DECLARE SUB ZD_SetObjectHidden LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectHidden" ( _
      BYVAL ObjID AS LONG, _        ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL OnOff AS LONG _         ' Boolean TRUE / FALSE condition.
      )
    ' Remark:
    ' Hidden state should not be confused with the Visibility state.
    ' This is a low level feature being used to draw Hollow sprite objects.
    ' Such object can be used to follow or replace the mouse cursor.
    ' See also:
    ' ZD_IsObjectHidden.
    
    '//3.57
    ' Create a GDIPLUS image attribute to remap a specific ARGB color from one color to another.
      DECLARE FUNCTION ZI_RemapImageColor LIB "GDIMAGE.DLL" ALIAS "ZI_RemapImageColor" ( _
      BYVAL nColorFrom AS LONG, _  ' Previous ARGB color to remap .
      BYVAL nColorTo AS LONG _     ' New ARGB color to use.
      ) AS LONG
    ' Return:
    ' A GDIPLUS ImageAttribute
    
    '//3.57
    ' Create a GDIPLUS image attribute to remap a specific ARGB color along the full alpha channel range (0-255).
      DECLARE FUNCTION ZI_RemapAlphaColor LIB "GDIMAGE.DLL" ALIAS "ZI_RemapAlphaColor" ( _
      BYVAL nColorFrom AS LONG, _  ' Previous ARGB color to remap .
      BYVAL nColorTo AS LONG _     ' New ARGB color to use.
      ) AS LONG
    ' Return:
    ' A GDIPLUS ImageAttribute
    
    ''//3.57
    '' Fills a rectangle using a specific 32-bit ARGB color.
    '  DECLARE SUB ZI_PaintBrushBitmap LIB "GDIMAGE.DLL" ALIAS "ZI_PaintBrushBitmap" ( _
    '  BYVAL hDC AS LONG, _        ' A valid 32-bit DC
    '  BYVAL x AS LONG, _          ' The top left horizontal coordinate of the rectangle
    '  BYVAL y AS LONG, _          ' The top left vertical coordinate of the rectangle
    '  BYVAL xW AS LONG, _         ' The rectangle width
    '  BYVAL yH AS LONG, _         ' The rectangle height
    '  BYVAL ARGBcolor AS LONG _   ' The ARGB color to use
    '  )
    
    '//4.03
    '  DECLARE FUNCTION zClockCtrl LIB "GDIMAGE.DLL" ALIAS "zClockCtrl" ( _
    '  BYVAL hOwner AS LONG, _
    '  zFullpathImageName AS ASCIIZ, _
    '  BYVAL x AS LONG, BYVAL y AS LONG, BYVAL W AS LONG, BYVAL H AS LONG, BYVAL ButID AS LONG, _
    '  BYVAL ARGB1 AS LONG, BYVAL ARGB2 AS LONG, OPTIONAL BYVAL GMToffset AS LONG) AS LONG
     
       DECLARE FUNCTION zClockCtrl LIB "GDIMAGE.DLL" ALIAS "zClockCtrl" ( _
       BYVAL hOwner AS LONG, _
       zFullpathImageName AS ASCIIZ, _
       BYVAL x AS LONG, _
       BYVAL y AS LONG, _
       BYVAL W AS LONG, _
       BYVAL H AS LONG, _
       BYVAL ButID AS LONG, _
       BYVAL ARGB1 AS LONG, _
       BYVAL ARGB2 AS LONG, _
       OPTIONAL BYVAL GMToffset AS LONG _
       ) AS LONG
     
    '//4.05
    ' Useful to embend an image into a fixed size square to perform image rotation from the center
    ' Example 512 x 512 or 1024 x 1024 or 2048 x 2048 or 1024 x 512 (for texture creation)
      DECLARE FUNCTION ZI_FitBitmapFromFile LIB "GDIMAGE.DLL" ALIAS "ZI_FitBitmapFromFile" ( _
      zFullPath AS ASCIIZ, _       ' Full path name to image
      BYVAL Xin AS LONG, _         ' Width of the container
      BYVAL Yin AS LONG _          ' Height of the container
      ) AS LONG
      
    ' Paper size 152 x 102 or 233 x 152  
      DECLARE FUNCTION ZI_FitImageToPaper LIB "GDIMAGE.DLL" ALIAS "ZI_FitImageToPaper" ( _
      zImageSrce AS ASCIIZ, _      ' Full path to image source
      BYVAL nPaperW AS LONG, _     ' paper width in mm
      BYVAL nPaperH AS LONG, _     ' paper height in mm
      zCropedImageDest AS ASCIIZ _ ' Full path to the resulting croped image
      ) AS LONG
    
    ' Effects
    
    '//4.05
      DECLARE FUNCTION ZD_GetObjectBrightness LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectBrightness" ( _
      BYVAL ObjID AS LONG _                ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      ) AS LONG
    
    '//4.05
      DECLARE SUB ZD_SetObjectBrightness LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectBrightness" ( _
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL Brightness AS LONG, _          ' The brightness level in the range (range 0-255, 0 = default).
      BYVAL RedrawParent AS LONG _         ' TRUE causes immediat redraw of the object parent
      )
    
    '//4.05
      DECLARE FUNCTION ZD_GetObjectContrast LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectContrast" ( _
      BYVAL ObjID AS LONG _                ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      ) AS LONG
    
    '//4.05
      DECLARE SUB ZD_SetObjectContrast LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectContrast" ( _
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL Contrast AS LONG, _            ' The contrast level in the range (range 0-255, 0 = default).
      BYVAL RedrawParent AS LONG _         ' TRUE causes immediat redraw of the object parent
      )
    
    '//4.05
      DECLARE FUNCTION ZD_GetObjectRed LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectRed" ( _
      BYVAL ObjID AS LONG _                ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      ) AS LONG
    
    '//4.05
      DECLARE SUB ZD_SetObjectRed LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectRed" ( _
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL nRed AS LONG, _                ' The red level in the range (range 0-255, 0 = default).
      BYVAL RedrawParent AS LONG _         ' TRUE causes immediat redraw of the object parent
      )
    
    '//4.05
      DECLARE FUNCTION ZD_GetObjectGreen LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectGreen" ( _
      BYVAL ObjID AS LONG _                ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      ) AS LONG
    
    '//4.05
      DECLARE SUB ZD_SetObjectGreen LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectGreen" ( _
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL nGreen AS LONG, _              ' The green level in the range (range 0-255, 0 = default).
      BYVAL RedrawParent AS LONG _         ' TRUE causes immediat redraw of the object parent
      )
    
    '//4.05
      DECLARE FUNCTION ZD_GetObjectBlue LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectBlue" ( _
      BYVAL ObjID AS LONG _                ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      ) AS LONG
    
    '//4.05
      DECLARE SUB ZD_SetObjectBlue LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectBlue" ( _
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL nBlue AS LONG, _               ' The blue level in the range (range 0-255, 0 = default).
      BYVAL RedrawParent AS LONG _         ' TRUE causes immediat redraw of the object parent
      )
    
    '//4.05
      DECLARE FUNCTION ZD_GetObjectHue LIB "GDIMAGE.DLL" ALIAS "ZD_GetObjectHue" ( _
      BYVAL ObjID AS LONG _                ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      ) AS LONG
    
    '//4.05
      DECLARE SUB ZD_SetObjectHue LIB "GDIMAGE.DLL" ALIAS "ZD_SetObjectHue" ( _
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL nHue AS LONG, _                ' The Hue level in the range (range 0-255, 0 = default).
      BYVAL RedrawParent AS LONG _         ' TRUE causes immediat redraw of the object parent
      )
    
    '//4.05
    ' Apply the effects to an object bitmap.
    ' Return: The new object bitmap handle.
      DECLARE FUNCTION ZD_RenderEffectToBitmapObject LIB "GDIMAGE.DLL" ALIAS "ZD_RenderEffectToBitmapObject" ( _
      BYVAL ObjID AS LONG, _               ' The unique object IDentifier (each object MUST USE A UNIQUE one).
      BYVAL RedrawParent AS LONG _         ' TRUE causes immediat redraw of the object parent
      ) AS LONG
    
    '//4.05
      DECLARE FUNCTION ZI_CreateBitmapFromImage LIB "GDIMAGE.DLL" ALIAS "ZI_CreateBitmapFromImage" ( _
      BYVAL hImage AS LONG _
      ) AS LONG
    
    '//4.05
      DECLARE FUNCTION ZI_IsAnyArrowPressed LIB "GDIMAGE.DLL" ALIAS "ZI_IsAnyArrowPressed" () AS LONG
    
    '//4.05
      DECLARE FUNCTION ZI_ApplyEffectToFile LIB "GDIMAGE.DLL" ALIAS "ZI_ApplyEffectToFile" ( _
      zImageSrce AS ASCIIZ, _
      zObj AS ZOBJECT, _
      zImageDest AS ASCIIZ _
      ) AS LONG
    
    '//4.05 Create a Disabled Window that works with any control created directly with the API
      DECLARE FUNCTION ZI_CreateDW LIB "GDIMAGE.DLL" ALIAS "ZI_CreateDW" ( _
      BYVAL hParent AS LONG _
      ) AS LONG
    
    '//4.05 Show the Disabled Window
      DECLARE SUB ZI_ShowDW LIB "GDIMAGE.DLL" ALIAS "ZI_ShowDW"( _
      BYVAL hDW AS LONG _
      )
    
    '//4.05 Hide the Disabled Window
      DECLARE SUB ZI_HideDW LIB "GDIMAGE.DLL" ALIAS "ZI_HideDW" ( _
      BYVAL hDW AS LONG _
      )
    
    '//4.06 Paint image in tiling mode
      DECLARE SUB ZI_ImageTilePaint LIB "GDIMAGE.DLL" ALIAS "ZI_ImageTilePaint" ( _
      BYVAL graphics AS LONG, _
      BYVAL Img AS LONG, _
      BYVAL xOffset AS LONG, _
      BYVAL yOffset AS LONG, _
      BYVAL nPaintWidth AS LONG, _
      BYVAL nPaintHeight AS LONG _
      )
    
    '//4.06 Computes location and size to stretch a bitmap preserving its aspect.
      DECLARE SUB ZI_ComputeAspect LIB "GDIMAGE.DLL" ALIAS "ZI_ComputeAspect" ( _
      BYVAL xPicSize AS LONG, _
      BYVAL yPicSize AS LONG, _
      BYVAL xCell AS LONG, _
      BYVAL yCell AS LONG, _
      BYREF xPos AS LONG, _
      BYREF yPos AS LONG, _
      BYREF xSize AS LONG, _
      BYREF ySize AS LONG _
      )
    
    '//4.06 Create a Skin background matching a specific size
      DECLARE FUNCTION ZI_CreateSkinBackground LIB "GDIMAGE.DLL" ALIAS "ZI_CreateSkinBackground" ( _
      zImageDest AS ASCIIZ, _
      BYVAL rwX AS LONG, _
      BYVAL rwY AS LONG, _
      zUseBackground AS ASCIIZ, _
      zSkinFolder AS ASCIIZ _
      ) AS LONG
    
    '//4.07 To perform self image rotation
    '// %Rotate90FlipNone = 1
    '// %Rotate180FlipNone = 2
    '// %Rotate270FlipNone = 3
    '// %RotateNoneFlipX = 4
    '// %Rotate90FlipX = 5
    '// %Rotate180FlipX = 6
    '// %Rotate270FlipX = 7
      DECLARE FUNCTION ZI_SetImageFileOrientation LIB "GDIMAGE.DLL" ALIAS "ZI_SetImageFileOrientation" ( _
      zImageSrce AS ASCIIZ, _
      BYVAL Orientation AS LONG _
      ) AS LONG
    
      DECLARE FUNCTION ZI_SetImageAlpha LIB "GDIMAGE.DLL" ALIAS "ZI_SetImageAlpha" ( _
      BYVAL Alpha AS LONG _
      ) AS LONG
      
    '//4.08
      DECLARE FUNCTION ZI_SetImageAttributesHue LIB "GDIMAGE.DLL" ALIAS "ZI_SetImageAttributesHue" ( _
      BYVAL nHue AS LONG _
      ) AS LONG  
    
      DECLARE FUNCTION zBitmapToImage LIB "GDIMAGE.DLL" ALIAS "zBitmapToImage" ( _
      BYVAL hDC AS LONG _
      ) AS LONG
    
      DECLARE FUNCTION ZI_CreateDIBSection LIB "GDIMAGE.DLL" ALIAS "ZI_CreateDIBSection" ( _
      BYVAL hDC AS LONG, _
      BYVAL nWidth AS LONG, _
      BYVAL nHeight AS LONG, _
      BYVAL BitCount AS LONG _
      ) AS LONG
    
      DECLARE FUNCTION Rgb2Gray LIB "GDIMAGE.DLL" ALIAS "Rgb2Gray" ( _
      BYVAL RGBValue AS DWORD _
      ) AS DWORD
    
      DECLARE SUB zAlphaBlend LIB "GDIMAGE.DLL" ALIAS "zAlphaBlend" ( _
      BYVAL hDcDest AS LONG, _
      BYVAL xDest AS LONG, _
      BYVAL yDest AS LONG, _
      BYVAL wDest AS LONG, _
      BYVAL hDest AS LONG, _
      BYVAL hDcSrce AS LONG, _
      BYVAL xSrce AS LONG, _
      BYVAL ySrce AS LONG, _
      BYVAL wSrce AS LONG, _
      BYVAL hSrce AS LONG _
      )
    
      DECLARE SUB ZI_AlphaBlend LIB "GDIMAGE.DLL" ALIAS "ZI_AlphaBlend" ( _
      BYVAL hDCDest AS LONG, _
      BYVAL xDest AS LONG, _
      BYVAL yDest AS LONG, _
      BYVAL nWidth AS LONG, _
      BYVAL nHeight AS LONG, _
      BYVAL hDCSrce AS LONG, _
      BYVAL xCurrentScroll AS LONG, _
      BYVAL yCurrentScroll AS LONG _
      )
    
    '//4.09
      TYPE ZGLTEXTUREX
          ID       AS LONG
          FullName AS ASCIIZ * 260
          Texture  AS LONG
          Square   AS LONG            '// boolean TRUE or FALSE value 
      END TYPE
      
    '//4.09
      DECLARE SUB ZI_MakeMultipleTexture LIB "GDIMAGE.DLL" ALIAS "ZI_MakeMultipleTexture" ( _
      BYVAL tp AS ZGLTEXTUREX PTR, _
      BYVAL N AS LONG _
      )
    
    '//4.09
      DECLARE FUNCTION ZI_CreateGLTextureFromFileEX LIB "GDIMAGE.DLL" ALIAS "ZI_CreateGLTextureFromFileEX" ( _
      zFullPath AS ASCIIZ, _
      Xin AS LONG, _
      Yin AS LONG, _
      PixelArray() AS BYTE, _
      BYVAL SquareTexture AS LONG _
      ) AS LONG
    
    '//4.11
      DECLARE FUNCTION ZI_CenterDialog LIB "GDIMAGE.DLL" ALIAS "ZI_CenterDialog" ( _
      BYVAL nFlag AS LONG, _
      BYVAL RW AS LONG _
      ) AS LONG
    
    '//4.14
      DECLARE FUNCTION ZD_ARGB LIB "GDIMAGE.DLL" ALIAS "ZD_ARGB" ( _
      BYVAL A AS BYTE, _
      BYVAL R AS BYTE, _
      BYVAL G AS BYTE, _
      BYVAL B AS BYTE _
      ) AS LONG
    
    '//4.14
      DECLARE FUNCTION ZI_ImageFromResource LIB "GDIMAGE.DLL" ALIAS "ZI_ImageFromResource" ( _
      BYVAL nInstance AS LONG, _
      zName AS ASCIIZ _
      ) AS LONG
    
    '//4.14
      DECLARE SUB ZI_RemoveRedEye LIB "GDIMAGE.DLL" ALIAS "ZI_RemoveRedEye" ( _
      BYVAL hDC AS LONG, _
      BYVAL x AS LONG, _
      BYVAL y AS LONG, _
      BYVAL UseWidth AS LONG, _
      BYVAL UseHeight AS LONG _
      )
    
    '//4.14
      DECLARE SUB ZD_RemoveRedEyeFromBitmapObject LIB "GDIMAGE.DLL" ALIAS "ZD_RemoveRedEyeFromBitmapObject" ( _
      BYVAL nObjectID AS LONG, _
      BYVAL x AS LONG, _
      BYVAL y AS LONG, _
      BYVAL UseWidth AS LONG, _
      BYVAL UseHeight AS LONG _
      )
    
    '//4.14
    ' Enable red eye crop selection
      DECLARE SUB ZI_EnableCropRedEye LIB "GDIMAGE.DLL" ALIAS "ZI_EnableCropRedEye" ( _
      BYVAL hWnd AS LONG _
      )

    Leave a comment:


  • Martin Francom
    replied
    Patrice,
    This won't compile. Missing the GDImage.Inc file

    Leave a comment:


  • Patrice Terrier
    replied
    Source code utility to create a custom OTB file

    Here is the DoOTB utility that creates a default OTB file that you can customize to match your specific needs.

    It detects existing parameters, but you can add more shortcuts if you want.


    Source code:

    Code:
    '+--------------------------------------------------------------------------+
    '|                                 DoOTB                                    |
    '|                                                                          |
    '|   Create a "Default.OTB" to be used as template to create a customized   |
    '|                          "OfTheBay.OTB" file.                            |
    '|                                                                          |
    '+--------------------------------------------------------------------------+
    '|                                                                          |
    '|                         Author Patrice TERRIER                           |
    '|                            copyright(c) 2008                             |
    '|                           www.zapsolution.com                            |
    '|                        [email protected]                          |
    '|                                                                          |
    '+--------------------------------------------------------------------------+
    '|                  Project started on : 11-27-2008 (MM-DD-YYYY)            |
    '|                        Last revised : 11-27-2008 (MM-DD-YYYY)            |
    '+--------------------------------------------------------------------------+
    
    #COMPILE EXE "DoOTB.exe"
    
    #INCLUDE "Win32API.inc"
    #INCLUDE "GDImage.inc"
    #INCLUDE "OfTheBay.inc"
    
    '------------------------------------------------------------------------------------------
    ' LOCAL section
    '-----------------------------------------------------------------------------------------
    
    TYPE gSpriteArrayStruct
        ShellTo   AS ASCIIZ * 260
        IconPath  AS ASCIIZ * 260
        WorkDir   AS ASCIIZ * 260
        UseLabel  AS ASCIIZ * 128
        CmdLine   AS ASCIIZ * 260
        ShowCmd   AS LONG
    END TYPE
    
    ''''''''''''''''''''''''''''''''''''''''''''
    
    ''''''''''''''''''''''''''''''''''''''''''''
    
    SUB WriteOTB(BYVAL sMsg AS STRING) STATIC
        DIM szFileName AS ASCIIZ * %MAX_PATH
        DIM hDebug AS LONG
        DIM NeverBeenThere AS LONG
        IF hDebug AND LEN(sMsg$) = 0 THEN
           CALL zsFClose(hDebug)
           NeverBeenThere = 0
           EXIT SUB
        END IF
        IF NeverBeenThere = 0 THEN
           NeverBeenThere = -1
           szFileName = "Default.OTB"
           CALL zsKillFile(szFileName)
           CALL zsFOpen(szFileName, 2, 4, hDebug)
        END IF
        CALL zsFPut(hDebug, sMsg + $CRLF)
    END SUB
    
    '// Main entry point
    FUNCTION WINMAIN (BYVAL hInstance     AS LONG, _
                      BYVAL hPrevInstance AS LONG, _
                      BYVAL lpCmdLine     AS ASCIIZ PTR, _
                      BYVAL iCmdShow      AS LONG) AS LONG
    
        DIM gS(1 TO 1) AS gSpriteArrayStruct
    
        LOCAL hProgMan, hListView AS DWORD
        LOCAL K, nCount, nItemCount AS LONG, sLink, sEnableShortcutTrueFalse AS STRING
    
        hProgMan  = FindWindow("Progman", "Program Manager")
        hListView = FindWindowEx(hProgMan, 0, "SHELLDLL_DefView", "")
        hListView = FindWindowEx(hListView, 0, "SysListView32", "FolderView")
        nItemCount = SendMessage(hListView, %LVM_GETITEMCOUNT, 0, 0)
        IF nItemCount THEN
           LOCAL dwProcessId, hProcess, dwSize, lpData AS DWORD
           CALL GetWindowThreadProcessId(hListView, dwProcessId)
           hProcess = OpenProcess(%PROCESS_VM_OPERATION OR %PROCESS_VM_READ OR %PROCESS_VM_WRITE, %FALSE, dwProcessId)
           IF hProcess THEN
              '// Compute the size of our reserved memory buffer
              dwSize = SIZEOF(POINTAPI) + SIZEOF(LVITEM) + %MAX_PATH * 2
    
              lpData = VirtualAllocEx(hProcess, BYVAL %NULL, dwSize, %MEM_COMMIT, %PAGE_READWRITE)
              IF lpData THEN
    
                 LOCAL pWsh AS IWshShell
                 pWsh = NEWCOM "WScript.Shell"
                 LOCAL pLnk AS IWshShortcut
    
                 LOCAL sDeskTopPub, sDeskTopAdm AS STRING
                 sDeskTopAdm = zsFolderGet(%CSIDL_DESKTOP)
                 sDeskTopPub = zsFolderGet(%CSIDL_COMMON_DESKTOPDIRECTORY)
                 '// Setup pointers
                 LOCAL lpPosition, lpItem, lpText AS LONG
                 lpPosition = lpData
                 lpItem = lpData + SIZEOF(POINTAPI)
                 lpText = lpData + SIZEOF(POINTAPI) + SIZEOF(LVITEM)
    
                 LOCAL lvi AS LVITEM
                 LOCAL szTxt AS ASCIIZ * 128, szLnk AS ASCIIZ * (%MAX_PATH * 2)  ' Allow room for unicode
                 LOCAL DoLnk AS LONG
                 FOR K = 0 TO nItemCount - 1
                     '// Init LVITEM structure and copy it to our reserved memory buffer
                     lvi.mask       = %LVIF_TEXT
                     lvi.iItem      = K
                     lvi.iSubItem   = 0
                     lvi.pszText    = lpText
                     lvi.cchTextMax = %MAX_PATH * 2
                     CALL WriteProcessMemory(hProcess, lpItem, lvi, sizeof(LVITEM), 0)
                     '// Get text label and x,y location
                     CALL SendMessage(hListView, %LVM_GETITEMTEXT, K, lpItem)
                     CALL SendMessage(hListView, %LVM_GETITEMPOSITION, K, lpPosition)
                     '// Copy from process memory to local variables
                     szTxt = ""
                     CALL ReadProcessMemory(hProcess, lpText, szTxt, SIZEOF(szTxt), 0)
                     LOCAL p AS POINTAPI
                     CALL ReadProcessMemory(hProcess, lpPosition, p, SIZEOF(POINTAPI), 0)
                     IF LEN(szTxt) THEN szLnk = szTxt + ".lnk"
    
                     IF ISFILE(sDeskTopAdm + szLnk) THEN
                        sLink = sDeskTopAdm + szLnk
                     ELSEIF ISFILE(sDeskTopPub + szLnk) THEN
                        sLink = sDeskTopPub + szLnk
                     ELSE
                        sLink = ""
                     END IF
    
                     sTarget$ = ""
                     IF LEN(sLink) THEN
                        DoLnk = -1
                        pLnk = pWsh.CreateShortcut(UCODE$(sLink))
                        sTarget$ = RTRIM$(ACODE$(pLnk.TargetPath))
                        IF LEN(sTarget$) = 0 THEN sTarget$ = ResolveLnk((sLink))
                     ELSE
                        DoLnk = 0
                        sTarget$ = ResolveShortcutName(szTxt)
                     END IF
                     IF LEN(sTarget$) THEN
                        INCR nCount
                        REDIM PRESERVE gS(1 TO nCount)
                        gs(K).IconPath = "@[email protected]\48x48\????.png"
                        IF DoLnk THEN gS(nCount).ShellTo = LCASE$(ACODE$(pLnk.TargetPath))
                        IF DoLnk THEN gS(nCount).WorkDir = ACODE$(pLnk.WorkingDirectory)
                        gS(nCount).UseLabel = szTxt
                        IF DoLnk THEN gS(nCount).ShowCmd = pLnk.WindowStyle
                     END IF
                 NEXT
    
                 '// Freeup memory
                 CALL VirtualFreeEx(hProcess, lpData, 0, %MEM_RELEASE)
    
              END IF
    
              '// Close process
              CALL CloseHandle(hProcess)
              
              LET pWsh = NOTHING
              
           END IF
        END IF
        
        IF nCount THEN
        
           WriteOTB "'+--------------------------------------------------------------------------+"
           WriteOTB "'|                               Of The Bay                                 |"
           WriteOTB "'|                                                                          |"
           WriteOTB "'|                         User shorcut definition                          |"
           WriteOTB "'|                                                                          |"
           WriteOTB "'+--------------------------------------------------------------------------+"
           WriteOTB "'|                                                                          |"
           WriteOTB "'|                         Author Patrice TERRIER                           |"
           WriteOTB "'|                            copyright(c) 2008                             |"
           WriteOTB "'|                           www.zapsolution.com                            |"
           WriteOTB "'|                         [email protected]                          |"
           WriteOTB "'|                                                                          |"
           WriteOTB "'+--------------------------------------------------------------------------+"
           WriteOTB "'Use @[email protected] to match either the OfTheBay.EXE path or the ShellTo target path"
           WriteOTB "'"
           WriteOTB "'Icon:"
           WriteOTB "'Use either 32x32 or larger (will be converted to 48x48)"
           WriteOTB "'in case of 32x32 the program adds the active icon background else not."
           WriteOTB "'"
           WriteOTB "'""ShellTo, UseLabel, IconName, WorkDir, CmdLine, EnableShortcutTrueFalse"""
           WriteOTB "'EnableShortcutTrueFalse = 2 '// To inform OTB that this one refers to the ""Recycle Bin""" 
           WriteOTB "'"
           WriteOTB "'Replace ""@[email protected]\48x48\????.png"" with a custom PNG file."
           WriteOTB "'"
           FOR K = 1 TO nCount
               sEnableShortcutTrueFalse = ", 1"""
               IF LEN(gS(K).ShellTo) = 0 THEN
                  gS(K).ShellTo = gS(K).UseLabel
               ELSE
                  IF INSTR(gS(K).ShellTo, "ofthebay.exe") THEN sEnableShortcutTrueFalse = ", 0""" ' Don't show it
                  IF PATHNAME$(PATH, gS(K).ShellTo) = RTRIM$(LCASE$(gS(K).WorkDir), "\") + "\" THEN gS(K).WorkDir = "@[email protected]"
               END IF
               WriteOTB """" + gS(K).ShellTo + ", " + gS(K).UseLabel + ", " + gs(K).IconPath + ", " + gS(K).WorkDir + ", " + gS(K).CmdLine + sEnableShortcutTrueFalse
           NEXT
           WriteOTB "'"
           WriteOTB "'End of file."
           WriteOTB ""
        END IF
    
        MsgBox """Default.OTB"" file, has been created." + $cr + $cr + _
               "You must edit and save it under the name of:" + $cr + _
               """OfTheBay.OTB""", , "Of The Bay"
    
    END FUNCTION
    Instructions for use are provided into the resulting OTB file.
    ...
    Attached Files

    Leave a comment:


  • Patrice Terrier
    replied
    Version 1.55 (official public version)

    Version 1.55

    A new parameter has been added to the OTB file:
    '"ShellTo, UseLabel, IconName, WorkDir, CmdLine, EnableShortcutTrueFalse"

    EnableShortcutTrueFalse = 0, means do not show this shortcut.
    EnableShortcutTrueFalse = 1, means show this shortcut.
    EnableShortcutTrueFalse = 2, means this shortcut refers to the "Recycle Bin"

    "Recycle Bin" is a special shortcut case, because the icon can represent a full or empty recycle bin, thus you must provide two custom icons for it, and they must be named "RecycleBinEmpty.png" and "RecycleBinFull.png".

    Example of version 1.55 custom OTB file:

    Code:
    '+--------------------------------------------------------------------------+
    '|                               Of The Bay                                 |
    '|                                                                          |
    '|                         User shorcut definition                          |
    '|                                                                          |
    '+--------------------------------------------------------------------------+
    '|                                                                          |
    '|                         Author Patrice TERRIER                           |
    '|                            copyright(c) 2008                             |
    '|                           www.zapsolution.com                            |
    '|                         [email protected]                          |
    '|                                                                          |
    '+--------------------------------------------------------------------------+
    '|                  Project started on : 11-20-2008 (MM-DD-YYYY)            |
    '|                        Last revised : 11-20-2008 (MM-DD-YYYY)            |
    '+--------------------------------------------------------------------------+
    
    'Use @[email protected] to match either the OfTheBay.EXE path or the ShellTo target path
    
    'Icon:
    'Use either 32x32 or larger (will be converted to 48x48)
    'in case of 32x32 the program adds the active icon background else not.
    
    '"ShellTo, UseLabel, IconName, WorkDir, CmdLine, EnableShortcutTrueFalse"
    'EnableShortcutTrueFalse = 2 '// To inform OTB that this one refers to the "Recycle Bin" 
    
    "Ordinateur, Ordinateur, @[email protected]\48x48\Computer.png, , ,1"
    "C:\program files\cc hyper file\cc120hf.exe, Centre de Contrôle HF, @[email protected]\48x48\Control.png, @[email protected], ,1"
    "C:\Program Files\Google\Picasa3\Picasa3.exe, Picasa 3, @[email protected]\48x48\Picasa.png, @[email protected], ,1"
    "D:\SED\SED_116.exe, PBWin9, @[email protected]\48x48\PowerBASIC.png, @[email protected], ,1"
    "D:\Disque_P\AssignDsk.bat, Promotech, @[email protected]\48x48\Param1.png, @[email protected], ,1"
    "C:\Program Files\Phoenix\Bin\PHOENIX.EXE, Phoenix, @[email protected]\48x48\Phoenix.png, , ,1"
    "C:\travail\sdk\template\BassBox24\BassBox.exe, BassBox24, @[email protected]\48x48\Woofer.png, @[email protected], ,1"
    "C:\Program Files\HP\QuickPlay\QP.exe, QuickPlay, @[email protected]\48x48\QuickPlay.png, @[email protected], ,1"
    "D:\wd11-us\programs\windev11.exe, WD11 US, @[email protected]\48x48\WD11.png, @[email protected], ,1"
    "C:\travail\sdk\template\MovieBox2\MovieBox.exe, MovieBox, @[email protected]\48x48\MovieProjector.png, @[email protected], ,1"
    "C:\windev 12\programmes\windev12.exe, WinDev 12, @[email protected]\48x48\WD12.png, @[email protected], ,1"
    "C:\program files\vahelp\vahelp73.exe, HelpMaker, @[email protected]\48x48\Vizacc.png, @[email protected], ,1"
    "C:\windev 12\zoleigest.bat, Z oleigest, @[email protected]\48x48\Run.png, @[email protected], ,1"
    "Corbeille, Corbeille, @[email protected]\48x48\RecycleBinEmpty.png, , ,2" '// This one refers to the "Recycle Bin"
    "C:\windows\installer\{e4ddba93-769b-49d8-ba33-8814e45ed0c1}\_40c4cb6f6690400fa04ba2.exe, HP Help and Support, @[email protected]\48x48\HP.png, C:\Windows\Help\OEM\scripts\, ,1"
    "C:\windev 10\programmes\windev10.exe, WinDev 10, @[email protected]\48x48\WD10.png, @[email protected], ,1"
    "C:\windev11\programmes\windev11.exe, WinDev 11, @[email protected]\48x48\WD11.png, @[email protected], ,1"
    "C:\WinDev 10\disquez.bat, Disque Z, @[email protected]\48x48\HD.png, C:\WinDev 10, ,1"
    "C:\Windows\System32\cmd.exe, Prompt, @[email protected]\48x48\Prompt.png, C:\travail, ,1"
    "Son - Raccourci, Son - Raccourci, @[email protected]\48x48\Sound.png, , ,1"
    "C:\Windows\installer\{5c82dae5-6eb0-4374-9254-be3319ba4e82}\skype.ico, Skype, @[email protected]\48x48\Skype.png, C:\Program Files\Skype\, ,1"
    "C:\VS2005\zMoviePlayer\bin\Debug\zMoviePlayer.exe, zMoviePlayer, @[email protected]\48x48\MediaPlayer.png, @[email protected], ,1"  
    "C:\program files\acronis\trueimagehome\trueimage.exe, Acronis True Image Home 10.0, @[email protected]\48x48\Acronis.png, @[email protected], ,1"
    "C:\Program Files\FileZilla Client\filezilla.exe, FileZilla, @[email protected]\48x48\FileZilla.png, @[email protected], ,1"
    "C:\travail\PhotoComposer\PhotoCompo.exe, PhotoComposer, @[email protected]\48x48\PhotoComposer.png, @[email protected], ,1"
    "C:\program files\blender foundation\blender\blender.exe, Blender, @[email protected]\48x48\Blender.png, @[email protected], ,1"
    "C:\travail\sdk\template\goldfish\xpaero\ofthebay\ofthebay.exe, Of The Bay, @[email protected]\48x48\OTB.png, @[email protected], ,0" ' <-- Hide OTB
    "D:\Photosetup\PhotoSetup.exe, PhotoSetup, @[email protected]\48x48\PhotoSetup.png, @[email protected], ,1"
    Note: If there is no "OfTheBay.OTB" file into the EXE's folder, then the program uses the default 32x32 icon embedded into the shorcut target.

    The "UserIcon" folder has a subfolder named "48x48" to store large icon, but you can add a new "32x32" subfolder to store your custom icons if you want them to be surrounded with the icon frame background.

    Click here to download the official public version 1.55
    It is provided with a "OfTheBay.OTB.txt" file, that must be renamed "OfTheBay.OTB" after it has been customized to match your own need.

    .
    Attached Files
    Last edited by Patrice Terrier; 27 Nov 2008, 08:44 AM.

    Leave a comment:


  • Patrice Terrier
    replied
    Version 1.54 - With custom icon set

    Updated to version 1.54

    This one allows you to substitute your own icon set, to replace the default extracted from the shorcut targets.

    The custom icon set, must be stored in the "UserIcon" subfolder,
    that contains already those you can see in this screen shot:



    To use a custom icon set, you must have a valid OTB file in the same folder than "OfTheBay.exe", and it must be named "OfTheBay.OTB".

    Here is an example of OTB file, that must be customized according to your own shortcuts:

    Code:
    '+--------------------------------------------------------------------------+
    '|                               Of The Bay                                 |
    '|                                                                          |
    '|                         User shorcut definition                          |
    '|                                                                          |
    '+--------------------------------------------------------------------------+
    '|                                                                          |
    '|                         Author Patrice TERRIER                           |
    '|                            copyright(c) 2008                             |
    '|                           www.zapsolution.com                            |
    '|                         [email protected]                          |
    '|                                                                          |
    '+--------------------------------------------------------------------------+
    '|                  Project started on : 11-20-2008 (MM-DD-YYYY)            |
    '|                        Last revised : 11-20-2008 (MM-DD-YYYY)            |
    '+--------------------------------------------------------------------------+
    
    'Use @[email protected] to match either the OfTheBay.EXE path or the ShellTo target path
    
    'Icon:
    'Use either 32x32 or larger (will be converted to 48x48)
    'in case of 32x32 the program adds the active icon background else not.
    
    '"ShellTo, UseLabel, IconName, WorkDir, CmdLine"
    
    "Ordinateur, Ordinateur, @[email protected]\Computer_48x48.png, , "
    "C:\program files\cc hyper file\cc120hf.exe, Centre de Contrôle HF, @[email protected]\Control_48x48.png, @[email protected], "
    "C:\Program Files\Google\Picasa3\Picasa3.exe, Picasa 3, @[email protected]\Picasa48x48.png, @[email protected],  "
    "D:\SED\SED_116.exe, PBWin9, @[email protected]\PowerBASIC_48x48.png, @[email protected], "
    "D:\Disque_P\AssignDsk.bat, Promotech, @[email protected]\Param1_48x48.png,  D:\Disque_P,  "
    "C:\Program Files\Phoenix\Bin\PHOENIX.EXE, Phoenix, @[email protected]\Phoenix_48x48.png, , "
    "C:\travail\sdk\template\BassBox24\BassBox.exe, BassBox24, @[email protected]\Woofer48x48.png,   @[email protected],  "
    "C:\Program Files\HP\QuickPlay\QP.exe, QuickPlay, @[email protected]\QuickPlay_48x48.png, @[email protected], "
    "D:\wd11-us\programs\windev11.exe, WD11 US, @[email protected]\WD11_48x48.png, @[email protected], "
    "C:\travail\sdk\template\MovieBox2\MovieBox.exe, MovieBox, @[email protected]\MovieProjector.png,  @[email protected],  "
    "C:\windev 12\programmes\windev12.exe, WinDev 12, @[email protected]\WD12_48x48.png, @[email protected], "
    "C:\program files\vahelp\vahelp73.exe, HelpMaker, @[email protected]\Vizacc_48x48.png, @[email protected], "
    "C:\windev 12\zoleigest.bat, Z oleigest, @[email protected]\Run_48x48.png, @[email protected], "
    "Corbeille, Corbeille, @[email protected]\Trash_48x48.png, , "
    "C:\windows\installer\{e4ddba93-769b-49d8-ba33-8814e45ed0c1}\_40c4cb6f6690400fa04ba2.exe, HP Help and Support, @[email protected]\HP_48x48.png, C:\Windows\Help\OEM\scripts\, "
    "C:\windev 10\programmes\windev10.exe, WinDev 10, @[email protected]\WD10_48x48.png, @[email protected], "
    "C:\windev11\programmes\windev11.exe, WinDev 11, @[email protected]\WD11_48x48.png, @[email protected], "
    "C:\WinDev 10\disquez.bat, Disque Z, @[email protected]\HD_48x48.png, C:\WinDev 10,  "
    "C:\Windows\System32\cmd.exe, Prompt, @[email protected]\Prompt_48x48.png, C:\travail,  "
    "Son - Raccourci, Son - Raccourci, @[email protected]\Sound_48x48.png, , "
    "C:\Windows\installer\{5c82dae5-6eb0-4374-9254-be3319ba4e82}\skype.ico, Skype, @[email protected]\Skype_48x48.png, C:\Program Files\Skype\,  "
    "C:\VS2005\zMoviePlayer\bin\Debug\zMoviePlayer.exe, zMoviePlayer, @[email protected]\MediaPlayer_48x48.png, @[email protected], "  
    "C:\program files\acronis\trueimagehome\trueimage.exe, Acronis True Image Home 10.0, @[email protected]\Acronis_48x48.png, @[email protected], "
    "C:\Program Files\FileZilla Client\filezilla.exe, FileZilla, @[email protected]\FileZilla_48x48.png, @[email protected], "
    "C:\travail\PhotoComposer\PhotoCompo.exe, PhotoComposer, @[email protected]\PhotoComposer_48x48.png, @[email protected], "
    "C:\program files\blender foundation\blender\blender.exe, Blender, @[email protected]\Blender_48x48.png, @[email protected], "
    "C:\travail\sdk\template\goldfish\xpaero\ofthebay\ofthebay.exe, Of The Bay, @[email protected]\OTB_48x48.png, @[email protected], "
    "D:\Photosetup\PhotoSetup.exe, PhotoSetup, @[email protected]\PhotoSetup48x48.png,  @[email protected],  "
    In this version, i have (again) reworked the centering of the common dialog OpenFile for better integration with multiple display (and to work around the Windows bug when it popups on the second monitor).

    Note: When OTB has the focus, you can close it, from the contextual popup menu, or using the Escape key.


    Click here to download the latest public version.

    ...

    Leave a comment:


  • Patrice Terrier
    replied
    Version 1.53

    Roger,

    I have reworked the hook to center the DIALOG OPEN/SAVE and let it work with dual monitor display, see below in the source code the comment :
    4.13 - 4.11 Shall we center the dialog?
    Code:
             CASE %CDN_INITDONE
    
                  hParent& = GetParent(hWnd&)
    
                  hSysListView& = GetDlgItem(hParent&, %lst1)
    
                  CALL GetWindowRect(hSysListView&, rw)
                  lp.X = rw.nLeft: lp.Y = rw.nTop: CALL ScreenToClient(hParent&, lp) ' 11-03-2003
                  yPos& = lp.Y
                  SquareSize& = rw.nBottom - rw.nTop
                  IF GetSystemMetrics(%SM_CXSCREEN) < 801 THEN
                     SquareSize& = MIN&(150, SquareSize&)
                  END IF
    
                  CALL GetClientRect(hParent&, rc)       ' Get dialog pos. and size
                  xPos& = rc.nRight                      ' New width
    
                  Style& = %WS_CHILD OR %WS_VISIBLE ' OR %WS_BORDER
                  StyleEx& = %WS_EX_STATICEDGE
                  hWndPreview& = CreateWindowEx(StyleEx&, $GDImageClassName, _
                                     "", _               ' Optional full path name to picture
                                     Style&, _
                                     xPos&, yPos&, SquareSize&, SquareSize&, _
                                     hParent&, _
                                     %NULL, _
                                     zInstance,_
                                     BYVAL 0)                 ' creation parameters
                  CALL ZI_SetProperty(hWndPreview&, %ZI_GradientTop, GetSysColor(%COLOR_BTNSHADOW))
                  CALL ZI_SetProperty(hWndPreview&, %ZI_GradientBottom, GetSysColor(%COLOR_BTNSHADOW))
                  CALL ZI_SetProperty(hWndPreview&, %ZI_FitToWindow, %ZI_QualityDefault)
    
                ' Set new size and center dialog in program window
                  CALL GetWindowRect(GetParent(hParent&), rc)     ' Get program pos. and size
                  W& = rc.nRight  - rc.nLeft
                  H& = rc.nBottom - rc.nTop
                  x& = rc.nLeft + (W& \ 2)                        ' Relative Center x&
                  y& = rc.nTop  + (H& \ 2)                        ' Relative Center y&
    
                  CALL GetWindowRect(hParent&, rc)                ' Get dialog pos. and size
                  W& = rc.nRight  - rc.nLeft + SquareSize& + 7    ' New width
                  H& = rc.nBottom - rc.nTop                       ' Same height
                  x& = x& - (W& \ 2)                              ' Centered in program
                  y& = y& - (H& \ 2)
    
    '              hDC& = GetDC(0)                                 ' Make sure it's on screen
    '              IF x& < 0 THEN x& = 0
    '              IF x& + W& > GetDeviceCaps(hDC&, %HORZRES) THEN x& = GetDeviceCaps(hDC&, %HORZRES) - W&
    '              IF y& < 0 THEN y& = 0
    '              IF y& + H& > GetDeviceCaps(hDC&, %VERTRES) THEN y& = GetDeviceCaps(hDC&, %VERTRES) - H&
    '              CALL ReleaseDC(0, hDC&)
    
    
                  '//4.13 - 4.11 Shall we center the dialog?
                  IF ZI_CenterDialog(0, 0) THEN
                      LOCAL hMonitor AS LONG, tmi AS MONITORINFO
                      hMonitor = MonitorFromWindow(GetParent(hParent&), %MONITOR_DEFAULTTONEAREST)
                      tmi.cbSize = SIZEOF(tmi)
                      IF GetMonitorInfo(hMonitor, tmi) THEN
                         x& = tmi.rcWork.nLeft + ((tmi.rcWork.nRight - tmi.rcWork.nLeft) - W&) \ 2
                         y& = tmi.rcWork.nTop + ((tmi.rcWork.nBottom - tmi.rcWork.nTop) - H&) \ 2
                      END IF
                      ZI_CenterDialog(0, 1)
                  END IF
    
                  CALL SetWindowPos(hParent&, hParent&, x&, y&, W&, H&, %SWP_NOZORDER) ' Resize and center
    
                  '//4.11
                  CALL PostMessage(GetParent(hParent&), %ZM_CENTER_DIALOG, hParent&, MAKLNG(x&,y&))
    
                ' INCREASE HEIGHT OF DROPPED LIST IN FILETYPE COMBO (AUTO-ADJUSTS TO ITEM COUNT)
                  hftCombo& = GetDlgItem(hParent&, %cmb1)         ' handle, Filetype combo
                  IF hftCombo& THEN                               ' if we get handle
                     CALL GetClientRect(hftCombo&, rc)            ' get combo's width and set new height
                     CALL SetWindowPos(hftCombo&, %NULL, 0, 0, rc.nRight, 200, %SWP_NOMOVE OR %SWP_NOZORDER)
                  END IF
    
                  FUNCTION = 1: EXIT FUNCTION
    I tested it sucessfuly on VISTA, i hope it will work the same on your XP system, please let me know.

    The latest public version is there

    ...

    Leave a comment:


  • Patrice Terrier
    replied
    Roger,

    Yes, the latest source code is always available on José's.

    Because setting the location on second display has never worked on Windows, i had to ressort on a complex code to work around the Windows bug.

    But i don't think this is the problem.

    I have been faced with another Windows bug when using common dialog
    See below the comment about:
    To avoid bug in drwtsn32.exe (alias Doctor Watson)
    Code:
    FUNCTION ZI_LoadDialog ALIAS "ZI_LoadDialog" (BYVAL hDlg&) EXPORT AS STRING
    
        ' 06-10-2007
        'STATIC WasExt$
    
        WasPath$ = ZI_LoadSavePath("", 0)
        '//3.51
        '//IF LEN(WasPath$) = 0 THEN WasPath$ = zGetReg(%HKEY_LOCAL_MACHINE, $RegistryKey, $RegistryPath)
        '//IF LEN(WasExt$) = 0 THEN WasExt$ = PARSE$(cfgStr$(37), 1)
        Path$ = WasPath$
        f$ = ""
    
        Style& = %OFN_FILEMUSTEXIST OR %OFN_LONGNAMES OR %OFN_ENABLEHOOK OR %OFN_EXPLORER
    
        IF zOpenFileDialog(hDlg&, cfgStr$(35), f$, Path$, ZI_SetLoadExtension("", 0), WasExt$, Style&) THEN
           IF LEN(f$) THEN
              CALL zSplitN(f$, WasPath$, SingleName$)
              '//3.51 CALL zSetReg(%HKEY_LOCAL_MACHINE, $RegistryKey, $RegistryPath, (WasPath$))
              CALL ZI_LoadSavePath((WasPath$), 1)
              So& = INSTR(-1, SingleName$, $Dot)
              IF So& THEN
                 UseExt$ = UCASE$(MID$(SingleName$, So&)) + $Dot
    
                 ' 06-10-2007
                 'IF INSTR($GDIPLUSEXT, UseExt$) THEN WasExt$ = TRIM$(UseExt$, $Dot)
    
                 'IF ZI_LoadSaveExtDisable(0, 0) THEN WasExt$ = ""
    
              END IF
           END IF
           CALL apiSleep(20)              ' To avoid bug in drwtsn32.exe (alias Doctor Watson)
           '//CALL ZI_UpdateWindow(hDlg&, %TRUE) ' 08-08-2006 Do not erase background (ZoomPlus)
           CALL ZI_UpdateWindow(hDlg&, 0) ' To avoid bug in drwtsn32.exe (alias Doctor Watson)
           FUNCTION = f$
        END IF
    
    END FUNCTION
    ZI_LoadDialog call zOpenFileDialog

    Code:
    FUNCTION zOpenFileDialog (BYVAL hWnd AS DWORD, _           ' parent window
                              BYVAL Caption AS STRING, _       ' caption
                              Filespec AS STRING, _            ' filename
                              BYVAL InitialDir AS STRING, _    ' start directory
                              BYVAL Filter AS STRING, _        ' filename filter
                              BYVAL DefExtension AS STRING, _  ' default extension
                              Flags AS DWORD ) AS LONG         ' flags
    
        LOCAL Ofn AS OPENFILENAMEEX
        LOCAL zFile       AS ASCIIZ * %MAX_PATH
        LOCAL zFileTitle  AS ASCIIZ * %MAX_PATH
        LOCAL zInitialDir AS ASCIIZ * %MAX_PATH
        LOCAL zTitle      AS ASCIIZ * %MAX_PATH
        LOCAL zDefExt     AS ASCIIZ * %MAX_PATH
    
        REPLACE $zLim WITH $NUL IN Filter
        Filter = Filter + $NUL
    
        IF LEN(InitialDir) = 0 THEN InitialDir = CURDIR$
    
        zInitialDir = InitialDir   + $NUL
        zFile       = Filespec     + $NUL
        zDefExt     = DefExtension + $NUL
        zTitle      = Caption      + $NUL
    
        IF zOsVersion < 500 THEN ' IF 95/98/ME
           ofn.lStructSize       = SIZEOF(ofn) - 12
        ELSE
           ofn.lStructSize       = SIZEOF(ofn)
        END IF
        ofn.hWndOwner         = hWnd
        ofn.lpstrFilter       = STRPTR(Filter)
        ofn.lpstrFile         = VARPTR(zFile)
        ofn.nMaxFile          = SIZEOF(zFile)
        ofn.lpstrFileTitle    = VARPTR(zFileTitle)
        ofn.nMaxFileTitle     = SIZEOF(zFileTitle)
        ofn.lpstrInitialDir   = VARPTR(zInitialDir)
        IF LEN(zTitle) THEN
           ofn.lpstrTitle     = VARPTR(zTitle)
        END IF
        ofn.Flags             = Flags
        ofn.lpfnHook          = CODEPTR(zDlgHookProc)
        ofn.lpstrDefExt       = VARPTR(zDefExt)
    
        ofn.FlagsEx           = %OFN_EX_NOPLACESBAR
    
        'Note: following Select Case table must be adjusted to match used Filter string
        '      (also remember to do the same in zDlgHookProc procedure..)
        UperExt$ = UCASE$(DefExtension)
        IF UperExt$     = PARSE$(cfgStr$(40), 1) THEN
                          ofn.nFilterIndex = 1 ' PNG nFilterIndex decides Filytype combo's listitem
        ELSEIF UperExt$ = PARSE$(cfgStr$(40), 2) THEN
                          ofn.nFilterIndex = 2 ' JPG
        ELSEIF UperExt$ = PARSE$(cfgStr$(40), 3) THEN
                          ofn.nFilterIndex = 3 ' BMP
        ELSEIF UperExt$ = PARSE$(cfgStr$(40), 4) THEN
                          ofn.nFilterIndex = 4 ' TIF
        ELSE
                          ofn.nFilterIndex = 8 ' *.*
        END IF
    
        FUNCTION = GetOpenFilename(BYVAL VARPTR(ofn))
    
        Filespec = zFile
        Flags    = ofn.Flags
    
    END FUNCTION
    and here the hook procedure being used:

    Code:
    ' Dialog hook procedure, for centering the dialog and
    ' increasing height of filetype combo (to avoid tiny scrollbuttons..)
    FUNCTION zDlgHookProc(BYVAL hWnd&, BYVAL Msg&, BYVAL wParam&, BYVAL lParam&) AS LONG
    
        LOCAL rw AS RECT, rc AS RECT, ofnPtr AS OFNOTIFY PTR, zTxt AS ASCIIZ * %MAX_PATH
        LOCAL lp    AS POINTAPI
    
        STATIC hWndPreview&, SquareSize&
    
        SELECT CASE LONG Msg&
    
        CASE %WM_NOTIFY
    
             ofnPtr = lParam&
             SELECT CASE LONG @ofnPtr.hdr.Code
    
             CASE %CDN_INITDONE
    
                  hParent& = GetParent(hWnd&)
    
                  hSysListView& = GetDlgItem(hParent&, %lst1)
    
                  CALL GetWindowRect(hSysListView&, rw)
                  lp.X = rw.nLeft: lp.Y = rw.nTop: CALL ScreenToClient(hParent&, lp) ' 11-03-2003
                  yPos& = lp.Y
                  SquareSize& = rw.nBottom - rw.nTop
                  IF GetSystemMetrics(%SM_CXSCREEN) < 801 THEN
                     SquareSize& = MIN&(150, SquareSize&)
                  END IF
    
                  CALL GetClientRect(hParent&, rc)       ' Get dialog pos. and size
                  xPos& = rc.nRight                      ' New width
    
                  Style& = %WS_CHILD OR %WS_VISIBLE ' OR %WS_BORDER
                  StyleEx& = %WS_EX_STATICEDGE
                  hWndPreview& = CreateWindowEx(StyleEx&, $GDImageClassName, _
                                     "", _               ' Optional full path name to picture
                                     Style&, _
                                     xPos&, yPos&, SquareSize&, SquareSize&, _
                                     hParent&, _
                                     %NULL, _
                                     zInstance,_
                                     BYVAL 0)                 ' creation parameters
                  CALL ZI_SetProperty(hWndPreview&, %ZI_GradientTop, GetSysColor(%COLOR_BTNSHADOW))
                  CALL ZI_SetProperty(hWndPreview&, %ZI_GradientBottom, GetSysColor(%COLOR_BTNSHADOW))
                  CALL ZI_SetProperty(hWndPreview&, %ZI_FitToWindow, %ZI_QualityDefault)
    
                ' Set new size and center dialog in program window
                  CALL GetWindowRect(GetParent(hParent&), rc)     ' Get program pos. and size
                  W& = rc.nRight  - rc.nLeft
                  H& = rc.nBottom - rc.nTop
                  x& = rc.nLeft + (W& \ 2)                        ' Relative Center x&
                  y& = rc.nTop  + (H& \ 2)                        ' Relative Center y&
    
                  CALL GetWindowRect(hParent&, rc)                ' Get dialog pos. and size
                  W& = rc.nRight  - rc.nLeft + SquareSize& + 7    ' New width
                  H& = rc.nBottom - rc.nTop                       ' Same height
                  x& = x& - (W& \ 2)                              ' Centered in program
                  y& = y& - (H& \ 2)
    
    '              hDC& = GetDC(0)                                 ' Make sure it's on screen
    '              IF x& < 0 THEN x& = 0
    '              IF x& + W& > GetDeviceCaps(hDC&, %HORZRES) THEN x& = GetDeviceCaps(hDC&, %HORZRES) - W&
    '              IF y& < 0 THEN y& = 0
    '              IF y& + H& > GetDeviceCaps(hDC&, %VERTRES) THEN y& = GetDeviceCaps(hDC&, %VERTRES) - H&
    '              CALL ReleaseDC(0, hDC&)
    
    
                  '//4.11 Shall we center the dialog?
                  IF ZI_CenterDialog(0, 0) THEN
                     LOCAL hMonitor, ptmd AS DWORD, trcWork AS RECT
                   ' zGetDisplayMonitors() should be called in control InitXXX procedure or during WM_CREATE.
                   ' It should also be called in response to WM_DISPLAYCHANGE
                   ' WM_DISPLAYCHANGE needs to be forwarded to control
                     ptmd = zGetDisplayMonitors()
                     IF ptmd THEN
                        hMonitor = MonitorFromWindow(GetParent(hParent&), %MONITOR_DEFAULTTONEAREST)
                        IF zGetMonitorRect(hMonitor, %MONITOR_AREA OR %MONITOR_SCREEN, trcWork) THEN
                           x& = trcWork.nLeft + ((trcWork.nRight - trcWork.nLeft) - W&) \ 2
                           y& = trcWork.nTop + ((trcWork.nBottom - trcWork.nTop) - H&) \ 2
                        END IF    
                        CALL HeapFree(GetProcessHeap(), 0, ptmd)
                     END IF
                     ZI_CenterDialog(0, 1)
                  END IF
    
    
                  CALL SetWindowPos(hParent&, hParent&, x&, y&, W&, H&, %SWP_NOZORDER) ' Resize and center
    
                  '//4.11
                  CALL PostMessage(GetParent(hParent&), %ZM_CENTER_DIALOG, hParent&, MAKLNG(x&,y&))
    
                ' INCREASE HEIGHT OF DROPPED LIST IN FILETYPE COMBO (AUTO-ADJUSTS TO ITEM COUNT)
                  hftCombo& = GetDlgItem(hParent&, %cmb1)         ' handle, Filetype combo
                  IF hftCombo& THEN                               ' if we get handle
                     CALL GetClientRect(hftCombo&, rc)            ' get combo's width and set new height
                     CALL SetWindowPos(hftCombo&, %NULL, 0, 0, rc.nRight, 200, %SWP_NOMOVE OR %SWP_NOZORDER)
                  END IF
    
                  FUNCTION = 1: EXIT FUNCTION
    
             CASE %CDN_SELCHANGE ' Triggered when the selection changes in the file listbox
                  picFileName$ = SPACE$(%MAX_PATH)
                  df& = Sendmessage(@ofnPtr.hdr.hwndFrom, %CDM_GETFILEPATH, LEN(picFileName$), STRPTR(picFileName$))
                  IF df& > 0 THEN
                     picFileName$ = LEFT$(picFileName$, df& - 1)
                     So& = INSTR(-1, picFileName$, $Dot)
                     IF So& THEN
                        ImgType$ = UCASE$(MID$(picFileName$, So&)) + $Dot
                        ImageType& = INSTR($GDIPLUSEXT, ImgType$)
                        IF ImageType& THEN
    
                           NewImage& = zLoadImageFromFile((picFileName$), bmW&, bmH&, 0)
                           IF zSetGdipImageHandle(hWndPreview&, NewImage&) THEN CALL ZI_UpdateWindow(hWndPreview&, %TRUE)
    
                        END IF
                     END IF
    '
                  END IF
                  picFileName$ = ""
    
             CASE %CDN_TYPECHANGE
                ' Standard Save dialog blindly adds new extension, this changes it properly instead
                  IF @[email protected] < 5 THEN             ' ignore last one, *.*
                     hftCombo& = GetDlgItem(GetParent(hWnd&), %cmb1)  ' handle, File type combo
                     IF zOsVersion < 500 THEN ID& = %edt1 ELSE ID& = %cmb13
                     hftEdit&  = GetDlgItem(GetParent(hWnd&), ID&)    ' handle, File name text field
                     CALL GetWindowText(hftEdit&, zTxt, SIZEOF(zTxt)) ' get name in text field
                     IF LEN(zTxt) THEN                                ' if we have something
                        lRes& = INSTR(-1, zTxt, $Dot)                 ' look for prefix (file type part)
                        IF lRes& THEN zTxt = LEFT$(zTxt, lRes& - 1)   ' if success, remove prefix
                        SELECT CASE LONG @[email protected]  ' compare selection against combo list
                        CASE 1: zTxt = zTxt + $Dot + LCASE$(PARSE$(cfgStr$(40), 1)) ' ".png"                  ' and add matching prefix
                        CASE 2: zTxt = zTxt + $Dot + LCASE$(PARSE$(cfgStr$(40), 2)) ' ".jpg"
                        CASE 3: zTxt = zTxt + $Dot + LCASE$(PARSE$(cfgStr$(40), 3)) ' ".bmp"
                        CASE 4: zTxt = zTxt + $Dot + LCASE$(PARSE$(cfgStr$(40), 4)) ' ".tif"
                        CASE 5: zTxt = zTxt + $Dot + LCASE$(PARSE$(cfgStr$(40), 5)) ' ".gif"
                        CASE 6: zTxt = zTxt + $Dot + LCASE$(PARSE$(cfgStr$(40), 6)) ' ".zmi"
                        END SELECT
                        CALL SetWindowText(hftEdit&, zTxt)            ' set corrected name to text field
                    END IF
                 END IF
             END SELECT
    
        CASE %WM_DESTROY ' Destroy what we have created to avoid nasty memory leaks
    
        END SELECT
    
    END FUNCTION
    This is the code being used to center the dialog

    '//4.11 Shall we center the dialog?
    IF ZI_CenterDialog(0, 0) THEN
    LOCAL hMonitor, ptmd AS DWORD, trcWork AS RECT
    ' zGetDisplayMonitors() should be called in control InitXXX procedure or during WM_CREATE.
    ' It should also be called in response to WM_DISPLAYCHANGE
    ' WM_DISPLAYCHANGE needs to be forwarded to control
    ptmd = zGetDisplayMonitors()
    IF ptmd THEN
    hMonitor = MonitorFromWindow(GetParent(hParent&), %MONITOR_DEFAULTTONEAREST)
    IF zGetMonitorRect(hMonitor, %MONITOR_AREA OR %MONITOR_SCREEN, trcWork) THEN
    x& = trcWork.nLeft + ((trcWork.nRight - trcWork.nLeft) - W&) \ 2
    y& = trcWork.nTop + ((trcWork.nBottom - trcWork.nTop) - H&) \ 2
    END IF
    CALL HeapFree(GetProcessHeap(), 0, ptmd)
    END IF
    ZI_CenterDialog(0, 1)
    END IF

    Leave a comment:


  • Roger Garstang
    replied
    App is running. I right click and select to change the icon or table/desktop underneath the icons. Most of the time this works fine and I can select the file. Sometimes when I select the option in the right click menu the selection dialog doesn't open and the app just closes. This leaves the desktop without icons, etc. This time when it did it the process stayed open and would not end task so I could restart OTB and exit to get icons back...had to reboot Windows. Appears to have started after you made the dialog center. Usually there is a hook required to do this, so possibly it is incorrect.

    Is the source code over at the other forum updated with each version? I may play with it next week since I'm on vacation...
    Last edited by Roger Garstang; 21 Nov 2008, 02:49 PM.

    Leave a comment:


  • Patrice Terrier
    replied
    Still having some issues with random closing on the file selection boxes coming up for icon and background themes.
    Roger,

    What do you mean exactly?

    ...

    Leave a comment:


  • Roger Garstang
    replied
    Still having some issues with random closing on the file selection boxes coming up for icon and background themes.

    Leave a comment:


  • Patrice Terrier
    replied
    Updated to version 1.51 (added wallpaper support)

    Under request of Emil Weiss,

    I have added a new menu option to change the desktop wallpaper.

    The background image will be resized to match the primary desktop size, while preserving the ratio aspect of the original picture.

    ...

    Leave a comment:

Working...
X