About GDImage 3.52
 Top Next
GDImage is a graphic image control provided under the form of a Win32 DLL.

GDImage controls are persistent, you'll never worry about redrawing when your window is minimized or temporarily covered, because they handle all the messy Windows details for you.

Create once... and forget, GDImage handles everything, automatically!

GDImage supports ARGB colors, this means RGB colors plus Alpha channel to perform alphablending (translucency).

GDImage supports a mix of raster bitmap and vectorial drawing.

GDImage allows you to use either child controls, popup layered windows, and/or popup shapped windows (a windows using a region based on a transparent bitmap color)

GDImage allows you to create sprite animation, dynamic image rotation, and stunning visual effects.

GDImage has zooming capabilities and is able to handle very large pictures.

With GDImage you can display sprite objects (image, text, line, arrow, ellipse, rectangle, polyline, polypoligon, curve) they are floating above the image background as multiple transparent or opaque layers that can overlap.

You can change all object's properties on the fly:
z-order, location, color, pen size, translucency, text string, draft or antialias mode.

With GDImage you can use a mix of GDI and GDI+ procedures inside of the same image control, giving you the best of the two API.

Width GDImage you can create OpenGL 3D graphics with ease, using any of the supported graphic format to create texture (even transparent, with variable opacity).

Note:
· The GDIPLUS.DLL, is a prerequisite when used on operating system previous to XP.
You can download the GDIPLUS.DLL from this link: Download GDIPLUS from MSDN .
· See MSDN documentation for the use of the OpenGL API or the OpenGL web site .


www.zapsolution.com

Web site
 Previous Top Next
The GDImage web site can be found there:
www.zapsolution.com

Patrice Terrier is the author of GDImage.
He has a long experience in multimedia and graphic programming.

GDImage is based on his work to create zDraw , and ZAP Media Solution+ .

zDraw

ZAP Media Solution+


Glossary
A few words definition.

· Graphic 32-bit
This graphic mode allows you to use full ARGB colors, RGB colors + Alpha channel.
· Layer
Refers to a specific plan along the Z-axis (in GDImage each object uses a specific layer).
· Object
In GDImage, everything except the image background is an object.
An object has properties that you can change on the fly, for example:
X,Y location. Color. Size. Orientation. Opacity. Drawing mode. Etc.
· Overlay
It is almost the same than a sprite but with transparent parts that you can see through.
· Raster
A raster graphics image, digital image, or bitmap, is a data file or structure representing a generally rectangular grid of pixels. The color of each pixel is defined in the RGB color space, plus one alpha channel in case of 32-bit. Raster graphics are distinguished from vector graphics.
· Sprite
Usualy the word sprite is used in graphic animation for two-dimensional pre-rendered pictures moving hover a fixed background.
· Vector
A vector graphics represent an image through the use of geometric objects such as curves and polygons.
· Z-order
Refers to the order of objects along the Z-axis.


List of functions
These functions require the GDImage Pro version.

The Pro version allows you to create interactive application using callback events,
together with mouse and keyboard support for easy sprite manipulation,
plus transparent OpenGL texture based on 32-bit PNG using variable opacity.

It has a built-in True Type Font Text dialog editor.

· ZI_EventMessage

· ZI_CreateGLTextureFrom32Bit
· ZI_GetMovingSpriteID
· ZI_GetMovingSpriteItem
· ZI_GetObjectFocusID
· ZI_MouseOverObjectID
· ZI_SetGLTextureFrom32Bit
· ZI_SetMutipleGLTextureFrom32Bit
· ZI_SetObjectFocusID

· ZI_FontBox
· ZI_SetFontBoxParameters

· ZD_GetObjectXYcapture
· ZD_SetObjectImageLabel
· ZD_GetObjectImageLabel
· ZD_SetObjectScroll
· ZD_GetObjectScroll
· ZD_SetObjectLocked
· ZD_GetObjectLocked
· ZD_UsePngOpacity


RegisterGDImageClass
Load the GDImage.dll, this is a prerequisite before using any of the provided functions.

FUNCTION RegisterGDImageClass () AS LONG

Return:
0 = means failure, any other value means registered.


RegisterGLImageClass
Load the GDImage.dll, this is a prerequisite before using any of the provided functions.

FUNCTION RegisterGLImageClass () AS LONG

Note:
Do not use this function if you have already loaded the GDImage.dll using RegisterGDImageClass .

Return:
0 = means failure, any other value means registered.


Data types
These are the data types being used in GDImage.dll.

BYTE     8-bit  (1 byte), unsigned integers ranging in value from 0 to 255.
WORD    16-bit (2 bytes), unsigned from 0 to 65,535.
INTEGER 16-bit (2 bytes), signed from -32,768 to 32,767.
LONG    32-bit (4 bytes), signed from -2,147,483,648 to 2,147,483,647.
DWORD   32-bit (4 bytes), unsigned from 0 to 4,294,967,295.
SINGLE  32-bit (4 bytes), from 8.43 x 10 ^ -37 to 3.40 x 10 ^ 38.
DOUBLE  64-bit (8 bytes), from 4.19 x 10 ^ -307 to 1.79 x 10 ^ 308.

STRING  Dynamic string variable. Contain character data of arbitrary length.
        Internally, each string variable uses four bytes that contain a handle number,
        which is used to identify and locate information about a string.
        Dynamic strings can contain up to approximately 2 Gb (2^31) characters.

ASCIIZ  A fixed-length strings where the last character is always a NULL terminator.
        Like fixed-length strings, ASCIIZ strings contain character data of fixed length
        and any attempt to assign a string longer than the defined length will result in truncation.
        ASCIIZ strings are usually defined with a length of at least two bytes.


Class name
The GDImage class name constant:

GDImageClassName  = "ZIMAGECTRL" ' The GDImage control class name.

zLim              = "|"          ' Internal delimiter.
Anti              = "\"          ' To parse file name.
Dot               = "."          ' To dectect file name extension.


Drawing parameters
DRAWING constants:

The contants 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.

GDImage Text orientation.
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  ' HIDDEN.
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.
ZD_DRAW_OUTLINE  = 1        ' Draw only the perimeter using the pen ARGB color.
ZD_DRAW_FILLED   = 2        ' The shape is filled with the ARGB color.
ZD_DRAW_3DIN     = 3        ' The shape is filled with a 3D in gradient effect.
ZD_DRAW_3DOUT    = 4        ' The shape is filled with a 3D out gradien,t effect.
ZD_DRAW_OPEN     = 5        ' The figure is open (polyline).

ZD_DRAW_REDRAW   = -1       ' Forces immediat redraw of parent object.
ZD_DRAW_DEFERRED = 0        ' Defers redraw of parent object.

GDImage z-order.
ZD_ORDER_TOP     = &HFFFFFF ' Z-order Top
ZD_ORDER_BOTTOM  = &HFFFF   ' Z-Order Bottom


Image formats
Image formats.

GDIPLUSIMG        = ".DIB.EMF.GIF.JPG.JPEG.PNG.TIF.TIFF.WMF."
GDIPLUSEXT        = $GDIPLUSIMG + "BMP.ICO."

Support for Multiple Image Formats
GDI+ provides the Image, Bitmap, and Metafile classes, which allow you to load, save and manipulate images in a variety of formats.
The following formats are supported:
· BMP
· GIF
· JPEG
· Exif
· PNG
· TIFF
· ICON
· WMF
· EMF

The DIB format is also supported for fast bit manipulation.


Image parameters
IMAGE control constants:

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 ' Set/Get GDImage Zoom control status
ZI_ZoomFactor     = 12 ' Set/Get the zooming factor of a GDImage Zoom control
ZI_Orientation    = 13 ' Set/Get orientation

Extend_cbWndExtra = ZI_FlagByte

ZI_GDIPLUSHANDLE  = 1  ' Load GDIPLUS Image handle

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

OpenGL constants:
ZI_GLDC           = 8  ' OpenGL Device Context
ZI_GLRC           = 9  ' OpenGL Rendering Context


Macro
These MACRO are used to speed up GDImage computations.

MACRO Pi = 3.141592653589793##
MACRO PiDiv4 = 0.785398163397448##
MACRO DegreesToRadians(Deg) = Deg * 0.0174532925199432957##

Note:
If your language doesn't allows you to use macro,
then use CONSTANT and FUNCTION for DegreesToRadians.


Slide Show
Slide show constants:

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.


Object type
Each sprite object matches one of this type:

OBJECT_TEXT        = 1   ' Text object using a True Type Font.
OBJECT_ELLIPSE     = 2   ' Vector object to draw an ellipse.
OBJECT_RECT        = 3   ' Vector object to draw a rectangle.
OBJECT_CURVE       = 4   ' Vector object to draw a curve.
OBJECT_ARROW       = 5   ' Vector object to draw an arrow.
OBJECT_POLYLINE    = 6   ' Vector object to draw a polyline.
OBJECT_BITMAP      = 7   ' Bitmap image object.
OBJECT_BEZIER      = 8   ' Vector object to draw a bezier curve.
OBJECT_POLYPOLYGON = 9   ' Vector object to draw a polypolygon.
OBJECT_TEXTBITMAP  = 10  ' Bitmap text object (suitable to perform text rotation)


Interpolation mode
These constants are being used to setup the rendering quality.

InterpolationModeDefault             = 0 ' Default quality.
InterpolationModeLowQuality          = 1 ' Low quality.
InterpolationModeHighQuality         = 2 ' High quality.
InterpolationModeBilinear            = 3 ' Bilinear mode.
InterpolationModeBicubic             = 4 ' Bicubic mode.
InterpolationModeNearestNeighbor     = 5 ' Nearest neighbor mode.
InterpolationModeHighQualityBilinear = 6 ' High quality bilinear mode.
InterpolationModeHighQualityBicubic  = 7 ' High quality bicubic mode.


ZSLIDESHOW
ZSLIDESHOW is to be used with the ZI_SlideAnimate API.

TYPE ZSLIDESHOW
  ' Slide section
    FilName   AS ASCIIZ * 260 ' ASCIIZ string
    Delay     AS LONG         ' 32-bit signed LONG integer
    Effect    AS INTEGER      ' 16-bit signed SHORT integer
    Grain     AS INTEGER      ' 16-bit signed SHORT integer
  ' Font section
    Legend    AS ASCIIZ * 128 ' ASCIIZ string
    FontName  AS ASCIIZ * 64  ' ASCIIZ string
    FontSize  AS INTEGER      ' 16-bit signed SHORT integer
    FontColor AS LONG         ' 32-bit LONG integer
    Shadow    AS BYTE         ' 8-bit unsigned integer
    Location  AS BYTE         ' 8-bit unsigned integer
END TYPE

See also:
Data types


ZGLFONT
ZGLFONT is to be used with the ZI_BuildGLfont API.

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

See also:
Data types


ZGLTEXTURE
ZGLTEXTURE is to be used with the ZI_SetMutipleGLTextureFromFile API.

TYPE ZGLTEXTURE
    ID       AS LONG
    FullName AS ASCIIZ * 260
    Texture  AS LONG
END TYPE

See also:
Data types


ZOBJECT
ZOBJECT internal GDImage structure being used to store details about each sprite object.

CONST METADATA_SIZE = 2048

TYPE ZOBJECT
    hWnd        AS LONG
    objType     AS LONG
    metacount   AS LONG
    metadata    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 WORD
    yCapture    AS WORD
    opacity     AS BYTE ' PNG variable opacity
    scale       AS SINGLE
    clone       AS LONG
    xP          AS WORD
    yP          AS WORD
    angle       AS WORD
    quality     AS BYTE
    flipmode    AS BYTE
    userotate   AS BYTE
    selected    AS BYTE
    reserved    AS STRING * 28
END TYPE ' 2368 bytes

See also:


ZPOLYGON
ZPOLYGON is to be used with the ZD_PolyPolygon API.

TYPE ZPOLYGON
    pXY        AS DWORD    ' 32-bit unsigned POINTS pointer
    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

See also:
Data types


ZI_AdjustWindowRect
Compute the client size for a specific GDImage control that will match exactly the picture size.

SUB 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.


ZI_AlphaBlendEx
GDImage 32-bit alphablend API to display bitmap with transparent or semitransparent pixels.

SUB 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.
)

Remark:
This API is able to display a semitransparent image using any rotation angle in the range 0-360 degree.


ZI_ChooseSaveFileName
Open the GDImage common save dialog to select a specific folder and enter/edit the filename.

Note: a sprite always use a square size to ease further rotation computation.

FUNCTION 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


ZI_ClearObjectSelected
Clear all selected objects matching a specific GDImage control.

SUB ZI_ClearObjectSelected ( _
BYVAL hGDImageCtrl AS LONG _ ' The GDImage control handle.
)

See also:
ZD_GetObjectSelected , ZD_SetObjectSelected , ZI_ObjectSelected


ZI_ClipboardCopy
Copy image to clipboard.

FUNCTION ZI_ClipboardCopy ( _
BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
) AS LONG

Return:
TRUE (-1) if success, FALSE (0) if error.


ZI_ClipboardPaste
Paste image from clipboard.

FUNCTION ZI_ClipboardPaste ( _
BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
) AS LONG

Return:
TRUE (-1) if success, FALSE (0) if error.


ZI_ColorCount
Compute the number of unique color(s) of an image shown in a GDImage control.

FUNCTION 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.


ZI_ConvertToGray
Convert COLOR to 256 shade of GRAY.

FUNCTION 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.


ZI_CreateBitmapFromFile
Create a valid GDI BITMAP handle from FILE using any of the supported GDImage format.

FUNCTION 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.


ZI_CreateImageBackground
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.

FUNCTION 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.


ZI_CreateImageFromFile
Create a valid GDIPLUS Image handle from FILE using any of the supported GDImage format.

FUNCTION 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.


ZI_CreateMirrorBitmapFromFile
Create a valid GDI BITMAP handle from FILE using any of the supported GDImage format,
and add a mirror reflection effect to the bitmap.

FUNCTION 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.


ZI_CreateSpriteFileFromBitmap
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.

FUNCTION 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.


ZI_CreateToolTip
To create a tooltip, to be used with a GDImage control.

FUNCTION 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.

Usualy the tooltip text matches the object label.
To change the text of the tooltip when the mouse hover a specific object, use ZI_SetToolTipText .


ZI_CreateWindow
This function creates a GDImage control
FUNCTION ZI_CreateWindow  ( _
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 method 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


ZI_CreateWindowFromImage
Create a window using a transparent color to build a region on the fly.

Note: You can use this command with either a POPUP or a CHILD window.

FUNCTION 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.


ZI_CropBitmap
Create a new clipped bitmap using coordinates that must lie within the range of the original bitmap.

FUNCTION 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

FlipReverse:
%ZD_Normal  = 0 ' Orientation unchanged (default)
%ZD_Flip    = 1 ' Swap top / bottom
%ZD_Reverse = 2 ' Swap left / right

Return:
The bitmap handle of the new clipped bitmap.


ZI_CropWindowToBitmap
Create a bitmap matching a selected area.

FUNCTION 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


ZI_DeleteControlBitmap
Delete the memory bitmap and device context associated to a GDImage control.

FUNCTION ZI_DeleteControlBitmap ( _
BYVAL hGDImageCtrl AS LONG _        ' The GDImage control handle.
) AS LONG

Return:
TRUE (-1) if success, FALSE (0) if error


ZI_DeleteCtrlObject
Delete ALL objects matching a specific GDImage control.

SUB ZI_DeleteCtrlObject ( _
BYVAL hGDImageCtrl AS LONG _ ' The GDImage control handle.
)

Warning:
This command must be used with care, because all object are deleted in one single step.


ZI_DeleteImageObject
Remove a GDIPLUS Image object from memory.

SUB ZI_DeleteImageObject ( _
hImage AS LONG _                     ' A valid GDIPLUS Image handle
)

Comment:
Use it as you would do with DeleteObject for a standard BITMAP handle.


ZI_DisableAllTools
Disable any drawing tool.

SUB ZI_DisableAllTools ( _
BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
)

See also:
ZI_EnableCropRectangle


ZI_DisableCropRectangle
Disable (cancel) the drawing of a rectangular section.

SUB ZI_DisableCropRectangle ( _
BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
)

See also:
ZI_EnableCropRectangle


ZI_DisableKeybHook
Enable/disable the keyboard hook being used to move the sprite with the direction keys.

FUNCTION 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.


ZI_DrawAlphaBlend
Display an image using a grayed mask to perform gradient translucency.

SUB 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.
)

Note:
The image and its mask must use the same size. The mask color black RGB(0,0,0) means full translucency
and the white color RGB(255,255,255) means full opaque mode.

Example:
Splash.bas


ZI_EnableCropRectangle
Enable the drawing of a rectangular section in XOR mode using the left mouse button.

SUB 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.

See also:
ZI_DisableCropRectangle


ZI_EventMessage

ZI_EventMessage (Pro version only)
 Previous Top Next
Monitor the Windows message flow using a callback to take control over the GDImage default procedure.

Warning: This is an advanced procedure !
If you have a good knowledge of the standard SDK API, you can fully customize a GDImage control with it.

SUB 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.

Example:
AeroGlass.bas


ZI_FitImageFromFile
Load a graphic file and Resize it on the fly to create a Bitmap matching a specific size.

FUNCTION 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).


ZI_FontBox

ZI_FontBox (Pro version only)
 Previous Top Next
Display the GDImage dialog True Type Font Text editor.

FUNCTION 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.

See also:
ZI_SetFontBoxParameters


ZI_GetBMP
Retrieve the DIB bitmap handle of the GDImage control background.

FUNCTION FUNCTION ZI_GetBMP()

Example:
AeroGlass.bas


ZI_GetBitmapFromDC
Retrieve the current selected bitmap from a specific Device Context.

FUNCTION ZI_GetBitmapFromDC ( _
BYVAL hDC AS LONG _  ' A Windows valid DC.
) AS LONG

Return:
The bitmap handle matching the specific DC if any.


ZI_GetBitmapSize
To GET the Width and Height of a STANDARD BITMAP.

SUB 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.
)


ZI_GetCropCoordinates
To edit the language being used for the contextual popup menu.

SUB 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


ZI_GetCtrlObjectCount
Get the number of objects being used in a specific GDImage control.

FUNCTION ZI_GetCtrlObjectCount ( _
BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
) AS LONG

Return:
The count number.


ZI_GetDC
Get the private DC of GDImage control.

FUNCTION 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.

Comment:
DO NOT release this DC and AVOID to use DELETEDC on it!


ZI_GetDIBits
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 .

FUNCTION 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).


ZI_GetImageSizeFromControl
To retrieve the image size of specific GDimage control.

SUB ZI_GetImageSizeFromControl ( _
BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
imgW AS LONG, _               ' Width of the picture.
imgH AS LONG _                ' Height of the picture.
)


ZI_GetImageSizeFromFile
Retrieve the bitmap size from a supported GDI+ disk file (do not load the image).

SUB 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 also:
ZI_AdjustWindowRect , to adjust the client size of a GDImage control.


ZI_GetMovingSpriteID

ZI_GetMovingSpriteID (Pro version only)
 Previous Top Next
Retrieve the unique IDentifier of the sprite being moved.

FUNCTION ZI_GetMovingSpriteID ()

Remark:
Its primary purpose it to be used from a ZI_EventMessage callback.

Example:
AeroGlass.bas


ZI_GetMovingSpriteItem

ZI_GetMovingSpriteItem (Pro version only)
 Previous Top Next
Retrieve the Item of the sprite being moved.

FUNCTION ZI_GetMovingSpriteItem ()

Remark:
Its primary purpose it to be used from a ZI_EventMessage callback.

Example:
AeroGlass.bas


ZI_GetObjectFocusID

ZI_GetObjectFocusID (Pro version only)
 Previous Top Next
Retrieve the unique object IDentifier of the sprite that has the GDImage focus.

FUNCTION ZI_GetObjectFocusID () AS LONG

Remark:
Its primary purpose it to be used from a ZI_EventMessage callback.

Example:
AeroGlass.bas


ZI_GetProperty
Get a specific property of a GDImage control.

FUNCTION ZI_GetProperty ( _
BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
BYVAL Property AS LONG, _     ' A ZI_ IMAGE constant ( See the list there )
) AS LONG

Return:
The matching property value.

See also:
ZI_SetProperty


ZI_GetTiledBackground
Retrieve the Bitmap handle being used to tile a background in a specific GDImage control.

FUNCTION 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.

See also:
ZI_SetTiledBackground


ZI_GetToolCropStatus
The Crop tool status mode.

FUNCTION ZI_GetToolCropStatus ( _
BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
) AS LONG

Return:
True = Crop status is On, False = Crop status is false.


ZI_GetXscroll
Get the horizontal scroll range for a specific GDImage control.

FUNCTION ZI_GetXscroll ( _
BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
) AS LONG

Return:
The horizontal scroll range in pixel.


ZI_GetYscroll
Get the vertical scroll range for a specific GDImage control.

FUNCTION ZI_GetYscroll ( _
BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
) AS LONG

Return:
The vertical scroll range in pixel.


ZI_GetZoomValue
Get the zoom factor of a GDImage Zoom window control ( ZI_ZoomWindow property).

FUNCTION ZI_GetZoomValue (
BYVAL hGDImageCtrl AS LONG _   ' The GDimage control handle.
) AS SINGLE

Return:
The zoom factor as a floating value.

Remark:
In order to create a GDImage Zoom control you must use ZI_SetProperty(hGDImageCtrl, ZI_ZoomWindow, TRUE)

See also:
ZI_SetProperty , ZI_GetProperty , ZI_SetZoomValue

Example:
ZoomPlus.bas


ZI_GradientPaintDC
Paint the background of a GDImage control.

SUB ZI_GradientPaintDC ( _
BYVAL hDC AS LONG, _      ' A Windows valid DC (including ZI_GetDC).
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.
)

See also:
Properties ZI_GradientTop and ZI_GradientBottom.


ZI_Iconise
Computes location and size to stretch a bitmap preserving its aspect.

SUB 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.
)

Remark:
This procedure does the computation only, it doesn't stretch the image.


ZI_LoadBitmap
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)

FUNCTION 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.

Example of resource file syntax:
REDMASK RCDATA DISCARDABLE REDMASK.GIF
ZMAGIC  RCDATA DISCARDABLE ZMAGIE.GIF


ZI_LoadDialog
Display the common file selector dialog using thumbnail preview for the supported graphic format.

FUNCTION ZI_LoadDialog( _
BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
) AS STRING/ASCIIZ

Return:
The FullPathName of the selected picture.

See also:
ZI_LoadSavePath


ZI_LoadFromResource
To load any of the supported graphic format as a program resource directly to a GDImage control as background.

FUNCTION ZI_LoadFromResource ( _
BYVAL hGDImageCtrl AS LONG, _        ' The GDImage control handle.
zResourceName AS ASCIIZ _            ' The resource name identifier.
) AS LONG

Return:
If the hGDImageCtrl control handle is omited, the returned parameter is a Bitmap handle.


ZI_LoadImageFromStream
Read image from a provided text buffer (STREAMING).

FUNCTION 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.


ZI_LoadSavePath
To force the default folder being used by ZI_LoadDialog.

FUNCTION ZI_LoadSavePath ( _
zUseThisPath AS ASCIIZ, _    ' The new folder path to use.
BYVAL SetGet AS LONG _       ' The Set/Get boolean property: Set = 1, Get = 0.
) AS STRING/ASCIIZ

Return:
The folder path when in Get mode.

See also:
ZI_LoadDialog


ZI_MouseOverObjectID

ZI_MouseOverObjectID (Pro version only)
 Previous Top Next
Retrieve the unique object IDentifier of the sprite hover the mouse.

FUNCTION ZI_MouseOverObjectID () AS LONG

Remark:
Its primary purpose it to be used from a ZI_EventMessage callback.

Example:
AeroGlass.bas


ZI_MoveToTray
Move the specified file to tray.

FUNCTION ZI_MoveToTray ( _
zFullName AS ASCIIZ _ ' Full qualified path of the file to move to tray
) AS LONG

Return:
Error code in case of error, zero if succesful.

See also:
zKillFile


ZI_ObjectSelected
Detect if there is any selected object in a specific GDImage control.

FUNCTION 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


ZI_PrintFull
Print the background image + the overlay objects, self centered on the paper sheet.

Print will fit the paper size.

FUNCTION ZI_PrintFull ( _
BYVAL hGDImageCtrl AS LONG _        ' The GDImage control handle.
) AS LONG

Return:
TRUE (-1) if success, FALSE (0) if error.


ZI_PrintImage
Print the background image only, self centered on the paper sheet.

Print will fit the paper size.

FUNCTION ZI_PrintImage ( _
BYVAL hGDImageCtrl AS LONG _        ' The GDImage control handle.
) AS LONG

Return:
TRUE (-1) if success, FALSE (0) if error.


ZI_PutBitmapToClipboard
Copy a GDImage DIB into the clipboard as a compatible bitmap.

FUNCTION 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.


ZI_RenderImageRotationToWindow
Render GDIPLUS Image rotation into a specific GDImage control.

SUB 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).
)

Note:
This procedure performs a rotation animation in a specified GDImage control.


ZI_RenderLayersToBitmap
Flatten all visible layers (sprite objects) with respect of their z-order, into a new memory bitmap.

FUNCTION ZI_RenderLayersToBitmap ( _
BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
) AS LONG

Return:
The handle of the new memory bitmap.

See also:
ZI_RenderLayersToFile


ZI_RenderLayersToFile
Save multiple layers into a single disk file, using any of the supported graphic format.

Note: All layers are flatten using their current z-order to create the new image.

FUNCTION ZI_RenderLayersToFile ( _
BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
zFullName AS ASCIIZ, _        ' Full qualified image path name.
BYVAL Quality AS LONG, _      ' For JPEG only, quality ranges from 0-100 (100 = best quality)
BYVAL Rotation AS LONG _      ' Orientation
) AS LONG

Orientation:
%RotateNoneFlipNone = 0
%Rotate90FlipNone   = 1
%Rotate180FlipNone  = 2
%Rotate270FlipNone  = 3

Return:
NULL means success. ErrorCode in case of error.


ZI_RenderRotationFromImageToBitmap
To render a GDIPLUS Image rotation into a provided Bitmap handle.

FUNCTION 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.

Example:
Gauge.bas


ZI_ReplaceRGBColor
Replace a RGB color with another RGB color.

SUB ZI_ReplaceRGBColor ( _
BYVAL hGDImageDC AS LONG, _   ' A GDImage DC (ZI_GetDC) or any DC using an associated memory bitmap.
BYVAL WasRGBColor AS LONG, _  ' The RGB color to replace.
BYVAL NewRGBColor AS LONG _   ' The new RGB color to use.
)


ZI_ReplaceRGBColorBitmap
Replace a RGB color with another RGB color, using a bitmap handle.

FUNCTION 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
)


ZI_ResizeBitmapFromBitmap
Create a valid GDI BITMAP handle from FILE using any of the supported GDImage format,
and add a mirror reflection effect to the bitmap.

FUNCTION 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 (do not confuse GDI bitmap handle and GDI+ Image handle).


ZI_ResizeBitmapFromFile
Load and resize a bitmap from file into one single step.

FUNCTION 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 GDI bitmap handle, or NULL in case of error (do not confuse GDI bitmap handle and GDI+ Image handle).


ZI_RotateImage
Perform image rotation in the specified DC, using a GDIPLUS Image handle.

SUB 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)
)

Note:
The color transparency and alpha channel are preserved during image rotation.


ZI_SaveBitmapToFile
Save a memory Bitmap to any of the supported GDImage graphic format.

FUNCTION ZI_SaveBitmapToFile ( _
zFullPathName AS ASCIIZ, _           ' Full path name of the graphic file to save.
BYVAL hBitmap AS LONG, _             ' A valid Bitmap handle.
OPTIONAL BYVAL JpegQuality AS LONG _ ' Optional JPEG encoding quality 1-100:
) AS LONG                            ' Default 0 = QalityMax = 100

Return:
NULL means success. ErrorCode in case of error.


ZI_SaveDialog
Display the common save to file dialog providing a valid hGDImageCtrl handle.

FUNCTION ZI_SaveDialog ( _
BYVAL hParent AS LONG, _             ' The parent window handle.
BYVAL hGDImageCtrl AS LONG _         ' The GDImage control handle.
) AS LONG

Return:
NULL means success. ErrorCode in case of error.


ZI_SaveLayersDialog
Display the common save to file dialog providing a valid hParent and hGDImageCtrl handle.

FUNCTION 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.


ZI_SaveToFile

ZI_SaveDialog
Save the content of a GDImage control to any of the supported graphic format.

Must be a supported graphic format, see the GDIPLUSEXT constant.

FUNCTION 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:
NULL means success. ErrorCode in case of error.

See also:
ZI_ChooseSaveFileName


ZI_SetAnchorMode
To anchor a GDImage control to a specific location when resizing parent window.

Note: The procedure allows you to anchor not only a GDImage control, but any type of control:
button, static, edit, listbox, etc.

FUNCTION 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
Anchor contants:

ANCHOR_NONE                = 0
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


ZI_SetCropPopupText
To edit the language being used for the contextual popup menu.

SUB ZI_SetCropPopupText ( _
zMenu AS ASCIIZ _ ' The text of the popup menu (use "," as delimiter) ex: "Select,Cancel"
)

See also:
ZI_EnableCropRectangle


ZI_SetCtrlEmptyBitmap
Associate a new memory bitmap matching the client size of the GDImage control,
to be used as a private DC.

SUB ZI_SetCtrlEmptyBitmap ( _
BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
BYVAL RGBcolor AS LONG _      ' The RGB color to paint the memory bitmap background.
)

Remark:
Use this procedure when you don't use an image background, but want to have a memory bitmap to draw in.

Note:
The size of the memory bitmap will match exactly the client size of the GDImage control.


ZI_SetDIBits
Replace a copy of a bitmap that was retrieved as a device-independent bitmap.

FUNCTION ZI_SetDIBits ( _
BYVAL hGDImageDC AS LONG, _              ' Any memory bitmap Device Context (like ZI_GetDC).
PixelArray() AS LONG, _                  ' Array using 2 dimensions (Y,Y) matching pixel coordinates.
OPTIONAL BYVAL DoNotClearArray AS LONG _ ' Boolean flag, %TRUE = DO NOT clear the array.
) AS LONG

Return:
Null if error, else success.

See also:
ZI_GetDIBit


ZI_SetFontBoxParameters

ZI_SetFontBoxParameters (Pro version only)
 Previous Top Next
To change the default Font Box parameters.

SUB 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
)

See also:
ZI_FontBox


ZI_SetFromFile
Set the image file to use with the control.

Must be a supported graphic format, see the GDIPLUSEXT string constant.

SUB ZI_SetFromFile ( _
BYVAL hGDImageCtrl AS LONG, _  ' The GDimage control handle.
zFullPathName AS ASCIIZ _      ' Full path name to the graphic file to display
)

This procedure is the same than using CALL SendMessage (hCtrl, WM_SETTEXT, 0, zFullPathName


ZI_SetLayeredAlpha
Set the value for the alpha channel of GDImage layered window.

Note: A layered window MUST use the POPUP style.

FUNCTION 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.


ZI_SetObjectFocusID

ZI_SetObjectFocusID (Pro version only)
 Previous Top Next
Put the focus on a specific GDImage sprite object.

SUB ZI_SetObjectFocusID ( _
BYVAL ObjID AS LONG _       ' The unique sprite object identifier.
)

Remark:
Same effect that to clic with the left mouse button on a GDImage sprite object.


ZI_SetProperty
Set a specific property of a GDImage control.

SUB ZI_SetProperty ( _
BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
BYVAL Property AS LONG, _     ' A ZI_ IMAGE constant ( See the list there )
BYVAL Parameter AS LONG _     ' A parameter matching the type of property to set or retrieve.
)

See also:
ZI_GetProperty


ZI_SetSaveDialogMsg
To customize the default Load / Save Dialog messages.

SUB 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.
)


ZI_SetTiledBackground
Use a Bitmap to paint a tiled background in a specific GDImage control.

The bitmap can provide from a file or EXE's resource, using any of the GDImage supported graphic format.

FUNCTION 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.

See also:
ZI_GetTiledBackground


ZI_SetToolTipText
To change the text of an existing GDImage control tooltip.

SUB 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.


ZI_SetZoomScrollInfo
Update the SCROLLINFO structure of a GDImage Zoom control.

SUB ZI_SetZoomScrollInfo ( _
BYVAL hGDImageCtrl AS LONG, _   ' The GDImage control handle.
BYVAL OldZoomValue AS SINGLE, _ ' Old zoom value
BYVAL ZoomValue AS SINGLE _     ' New zoom value
)


ZI_SetZoomValue
Change the zooming value of a GDImage Zoom window control ( ZI_ZoomWindow property).

SUB ZI_SetZoomValue (
BYVAL hGDImageCtrl AS LONG, _   ' The GDimage control handle.
BYVAL ZoomValue AS SINGLE _     ' The zoom factor as a floating value.
)

Remark:
In order to create a GDImage Zoom control you must use ZI_SetProperty(hGDImageCtrl, ZI_ZoomWindow, TRUE)

See also:
ZI_SetProperty , ZI_GetProperty , ZI_GetZoomValue

Example:
ZoomPlus.bas


ZI_UpdateWindow
To force immediate refresh of a GDImage control display.

SUB ZI_UpdateWindow ( _
BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
BYVAL EraseFlag AS LONG _     ' Boolean flag to erase first the background.
)


ZI_Version
Get the GDImage.dll internal version number.

FUNCTION ZI_Version () AS STRING/ASCIIZ

Return:
The version number of the form "#.#".


ZD_CloneObject
Clone any GDImage object (sprite bitmap, text, vector object)

FUNCTION ZD_CloneObject ( _
BYVAL IDtoClone AS LONG, _  ' The unique IDentifier of the object to duplicate.
BYVAL CloneID AS LONG, _    ' The unique IDentifier of the new clone object.
BYVAL x AS LONG, _          ' The X location in pixel coordinates.
BYVAL y AS LONG _           ' The Y location in pixel coordinates.
) AS LONG

Return:
TRUE (-1) if success, FALSE (0) if error.

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.
This feature is very handy to spare memory resources.


ZD_ColorARGB
Compute an ARGB color to ensure compatibility with GDI+.

FUNCTION 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.


ZD_CreateBitmapFromText
Create a bitmap sprite object from a text using a True Type Font.

FUNCTION 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.


ZD_DeleteObject
Delete any GDImage object (sprite bitmap, text, vector object)

SUB ZD_DeleteObject ( _
BYVAL ObjID AS LONG, _  ' The unique IDentifier of the object to delete.
)


ZD_DoEvents
Process pending window or dialog messages during animation sequence.

FUNCTION ZD_DoEvents () AS LONG

Return:
WM_QUIT if user presses on exit button else NULL.


ZD_DrawArrowToCtrl
Create ARROW overlay object in a GDImage control.

An overlay is independant of the image background that stay unchanged.

Each overlay object must use a unique identifier.

FUNCTION 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, _               ' Unique object IDentifier (each object MUST USE A UNIQUE one).
BYVAL ZS_STYLE AS LONG, _            ' The object Generic STYLE (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
Drawing STYLE constants:               Drawing mode:
ZD_DRAW_FILLED                         Fill mode ONLY

Return:
TRUE (-1) if success, FALSE (0) if error.


ZD_DrawBitmapToCtrl
Create BITMAP overlay object in a GDImage control.

FUNCTION 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, _         ' A valid bitmap handle.
BYVAL ColrARGB AS LONG, _        ' Use Alpha channel to set up translucency, RGB parameter is ignored.
BYVAL ObjID AS LONG, _           ' The unique object IDentifier.
BYVAL ZS_STYLE AS LONG _         ' The object Generic STYLE (at least ZS_VISIBLE to show it).
) AS LONG

Return:
TRUE (-1) if success, FALSE (0) if error.

Note:
Only the Alpha member of the ColorARGB parameter is being used to set up the translucency of the image/bitmap object.


ZD_DrawCurveToCtrl
Create CURVE overlay object in a GDImage control.

An overlay is independant of the image background that stay unchanged.

Each overlay object must use a unique identifier.

FUNCTION ZD_DrawCurveToCtrl ( _
BYVAL hGDImageCtrl AS LONG, _     ' The GDImage control handle.
BYVAL pXY AS POINTS PTR, _        ' Pointer to 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, _            ' Unique object IDentifier (each object MUST USE A UNIQUE one).
BYVAL ZS_STYLE AS LONG, _         ' The object Generic STYLE (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.

Drawing STYLE constants:            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


ZD_DrawEllipseToCtrl
Create ELLIPSE overlay object in a GDImage control.

An overlay is independant of the image background that stay unchanged.

Each overlay object must use a unique identifier.

FUNCTION 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 (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 rectangular perimeter.
Drawing STYLE constants:             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.


ZD_DrawPolyLineToCtrl
Create POLYLINE overlay object in a GDImage control.

An overlay is independant of the image background that stay unchanged.

Each overlay object must use a unique identifier.

FUNCTION ZD_DrawPolyLineToCtrl ( _
BYVAL hGDImageCtrl AS LONG, _     ' The GDImage control handle.
BYVAL pXY AS POINTS PTR, _        ' Pointer to 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 (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.

Drawing STYLE constants:            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


ZD_DrawRectangleToCtrl
Create a RECTANGLE overlay object in a GDImage control.

An overlay is independant of the image background that stay unchanged.

Each overlay object must use a unique identifier.

FUNCTION 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 (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

Drawing STYLE constants:              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 not.

See also:
ZD_FillRect


ZD_DrawTextToCtrl
Create a TEXT overlay object in a GDImage control.

An overlay is independant of the image background that stay unchanged.

Each overlay object must use a unique identifier.

FUNCTION 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, _               ' Unique object IDentifier (each object MUST USE A UNIQUE one).
BYVAL ZS_STYLE AS LONG, _            ' The object Generic STYLE (at least ZS_VISIBLE to show it).
OPTIONAL BYVAL UseShadow AS LONG, _  ' The shadow 3D offset.
OPTIONAL BYVAL Orientation AS LONG _ ' The orientation: ZD_TextHorzUp, ZD_TextVertUp, ZD_TextVertDn.
) AS LONG

Return:
TRUE (-1) if success, FALSE (0) if error.

See also:
ZD_SetObjectText


ZD_DrawTextToDC
Draw a text using a True Type Font, ARGB color, optional 3D effect and orientation.

FUNCTION 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 orientation: ZD_TextHorzUp, ZD_TextVertUp, %ZD_TextVertDn.
) AS LONG

Return:
TRUE (-1) if success, FALSE (0) if error.


ZD_FillRect
Fills a rectangle using a specific RGB color.

SUB 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
)

Note:
This procedure uses a standard RGB color (no ARGB).

Comment:
If you want to draw a rectangle with an ARGB color, then use ZD_DrawRectangleToCtrl.

See also:
ZD_DrawRectangleToCtrl


ZD_GetBitmapObjectBits
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 .

To be used with a bitmap object.

FUNCTION ZD_GetBitmapObjectBits ( _
BYVAL ObjID AS LONG, _  ' The unique object IDentifier.
PixelArray() AS LONG _  ' A 2 dimensions dynamic array to store (Y,Y) pixel coordinates.
) AS LONG

Return:
Null if error, else success.


ZD_GetObjectARGB
To get the ARGB parameters of a specific overlay object.

SUB ZD_GetObjectARGB ( _
BYVAL ObjID AS LONG, _     ' The unique object IDentifier.
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).
)

See also:
ZD_SetObjectARGB


ZD_GetObjectARGBcolor
Get the 32-bit ARGB color of a GDImage object.

FUNCTION ZD_GetObjectARGBcolor ( _
BYVAL ObjID AS LONG _     ' The unique sprite object identifier.
) AS LONG

Return:
The ARGB color with Alpha channel.


ZD_GetObjectAlpha
Get the alpha channel value of a specific GDImage object.

FUNCTION ZD_GetObjectAlpha ( _
BYVAL ObjID AS LONG, _     ' The unique sprite object identifier.
) AS LONG

Return:
The alpha channel value in the range 0-255 (0 = full transparency, 255 = full opacity)


ZD_GetObjectAngle
Retrieve the rotation angle of a GDImage sprite object.

FUNCTION ZD_GetObjectAngle ( _
BYVAL ObjID AS LONG _     ' The unique sprite object identifier.
) AS LONG

Return:
The rotation angle in degree (0-360).

Remark:
Full rotation angle applies only to bitmap objects (OBJECT_BITMAP and OBJECT_TEXTBITMAP).


ZD_GetObjectBitmap
Get the bitmap associated to a GDImage sprite OBJECT_BITMAP.

FUNCTION ZD_GetObjectBitmap ( _
BYVAL ObjID AS LONG _         ' The unique object IDentifier.
) AS LONG

Return:
The OBJECT_BITMAP handle if any.


ZD_GetObjectClone
Change the clone ID parameter of a specific bitmap sprite object.

FUNCTION ZD_GetObjectClone ( _
BYVAL ObjID AS LONG _  ' The unique sprite object identifier.
) AS LONG

Return:
The unique ID of the clone object if any.


ZD_GetObjectFlipMode
Get the flip mode of a specific bitmap sprite object.

FUNCTION 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.


ZD_GetObjectImageLabel

ZD_GetObjectImageLabel (Pro version only)
 Previous Top Next
Retrieve the label matching a specific sprite object identifier.

FUNCTION ZD_GetObjectImageLabel ( _
BYVAL ObjID AS LONG, _   ' The unique sprite object identifier.
) AS STRING

Return:
The label matching the identifier if any.

See also:
ZD_SetObjectImageLabel


ZD_GetObjectLocked

ZD_GetObjectLocked (Pro version only)
 Previous Top Next
Retrieve the mouse lock status of a specific sprite object identifier.

FUNCTION ZD_GetObjectLocked ( _
BYVAL ObjID AS LONG, _   ' The unique sprite object identifier.
) AS LONG

Return:
Null = lock is enabled, Else = lock is disabled.

See also:
ZD_SetObjectLocked


ZD_GetObjectOpacity
Get the TRUE/FALSE PNG variable opacity status of a bitmap sprite object.

FUNCTION ZD_GetObjectOpacity ( _
BYVAL ObjID AS LONG _  ' The unique sprite object identifier.
) AS LONG

Return:
A boolean True(-1) or False(0) value.


ZD_GetObjectParent
To retrieve the immediate parent of the overlay object.

FUNCTION ZD_GetObjectParent ( _
BYVAL ObjID AS LONG _           ' The unique object IDentifier.
) AS LONG

Return:
The GDImage control handle of the parent.


ZD_GetObjectProperties
Retrieve all the properties of a GDImage sprite object in one single step.

SUB 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 , ZOBJECT


ZD_GetObjectQuality
Get the rendering quality (interpolation mode) of a GDImage sprite object.

FUNCTION ZD_GetObjectQuality ( _
BYVAL ObjID AS LONG _     ' The unique sprite object identifier.
) AS LONG

Return:
An interpolation mode constant (int the range 0-7).


ZD_GetObjectRotation
Get the rotation angle of a specific bitmap sprite object.

FUNCTION ZD_GetObjectRotation ( _
BYVAL ObjID AS LONG _     ' The unique sprite object identifier.
) AS LONG

Return:
The rotation angle in degree.


ZD_GetObjectScale
Get the scale factor for the specific sprite identifier.

FUNCTION ZD_GetObjectScale ( _
BYVAL ObjID AS LONG, _   ' The unique sprite object identifier.
) AS SINGLE

Return:
The current scale factor (default = 1, means no scale factor).


ZD_GetObjectScroll

ZD_GetObjectScroll (Pro version only)
 Previous Top Next
Retrieve the scroll status of a specific sprite object identifier.

FUNCTION ZD_GetObjectScroll ( _
BYVAL ObjID AS LONG, _   ' The unique sprite object identifier.
) AS LONG

Return:
Null = scrolling disabled, Else = scrolling enabled.

See also:
ZD_SetObjectScroll


ZD_GetObjectSelected
Get the TRUE or FALSE selected status of a sprite object.

FUNCTION 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 , ZI_ClearObjectSelected , ZI_ObjectSelected


ZD_GetObjectStyle
Get the STYLE of a GDImage overlay object.

FUNCTION ZD_GetObjectStyle ( _
BYVAL ObjID AS LONG _         ' The unique object IDentifier.
) AS LONG

Return:
The STYLE of the object.

See also:
ZD_SetObjectStyle


ZD_GetObjectType
Retrieve the type of a GDImage sprite object.

FUNCTION ZD_GetObjectType ( _
BYVAL ObjID AS LONG _     ' The unique sprite object identifier.
) AS LONG

Return:
The object type .


ZD_GetObjectUse3Dshadow
Get the sprite object 3D shadow offset.

FUNCTION 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.

Remark:
Negative value = shadow offset bottom left.
Positive value = shadow offset bottom right.


ZD_GetObjectXY
Get overlay object X,Y coordinates.

SUB ZD_GetObjectXY ( _
BYVAL ObjID AS LONG, _       ' The unique object IDentifier.
BYREF x AS LONG, _           ' The X coordinate.
BYREF y AS LONG _            ' The Y coordinate.
)

See also:
ZD_SetObjectXY


ZD_GetObjectXYcapture

ZD_GetObjectXYcapture (Pro version only)
 Previous Top Next
Retrieve the GDImage mouse captured X,Y location.

SUB 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.
)

Remark:
Its primary purpose it to be used from a ZI_EventMessage callback.

Example:
AeroGlass.bas


ZD_GetObjectZorder
Get the Z-order of an overlay object.

FUNCTION ZD_GetObjectZorder ( _
BYVAL ObjID AS LONG _           ' The unique object IDentifier
) AS LONG

Return:
The overlay object Z-order.

See also:
ZD_SetObjectZorder


ZD_GetStringFormat
Get the font string format of a text sprite object.

FUNCTION ZD_GetStringFormat ( _
BYVAL ObjID AS LONG, _     ' The unique sprite object identifier.
)

Return:
A constant value, matching the current string format: ZD_TextHorzUp, ZD_TextVertUp, ZD_TextVertDn


ZD_GetTextBound
To retrieve the bounding size in pixel of specifc text using a True Type Font of a specific size.

FUNCTION 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 orientation: ZD_TextHorzUp, ZD_TextVertUp, ZD_TextVertDn.
) AS LONG
Return:
The width and height of the bounding rectangle that matches the text being used.


ZD_IsObjectVisible
Check for visibility of a GDImage overlay object.

FUNCTION ZD_IsObjectVisible ( _
BYVAL ObjID AS LONG _         ' The unique object IDentifier.
) AS LONG

Return:
TRUE (-1) if visible, FALSE (0) if not.


ZD_PolyPolygon
Draws a series of closed polygons as overlay objects in a GDImage control.

Each polygon is outlined or filled by using a specific pen size and ARGB color.

FUNCTION ZD_PolyPolygon ( _
BYVAL hGDImageCtrl AS LONG, _        ' The GDImage control handle.
zp() AS ZPOLYGON , _                  ' The polypolygon description.
BYVAL PolygonCount AS LONG _         ' The polygon count.
) AS LONG

Return:
TRUE (-1) if success, FALSE (0) if error.

Note:
The polygons drawn by this procedure can overlap.


ZD_SetBitmapObjectBits
Replace a copy of a bitmap that was retrieved as a device-independent bitmap.

To be used with a bitmap object.

FUNCTION ZD_SetBitmapObjectBits ( _
BYVAL ObjID AS LONG, _              ' The unique object IDentifier.
PixelArray() AS LONG, _             ' A 2 dimensions dynamic array to store (Y,Y) pixel coordinates.
OPTIONAL BYVAL DoNotClear AS LONG _ ' Boolean flag, TRUE = DO NOT clear the array.
) AS LONG

Return:
Null if error, else success.

See also:
ZD_GetBitmapObjectBits


ZD_SetObjectARGB
To set the ARGB parameters of a specific overlay object.

SUB ZD_SetObjectARGB ( _
BYVAL ObjID AS LONG, _     ' The unique object IDentifier.
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).
)

See also:
ZD_GetObjectARGB


ZD_SetObjectARGBcolor
Set the 32-bit ARGB color of a GDImage object (including its Alpha channel).

SUB SetObjectARGBcolor ( _
BYVAL ObjID AS LONG, _  ' The unique sprite object identifier.
BYVAL UseARGB AS LONG _ ' The 32-bit ARGB color with Alpha channel.
)

Remark:
ARGB color are RGB color + Alpha channel.

See also:
ZD_ColorARGB to create a correct UseARGB parameter.


ZD_SetObjectAlpha
To set up the Alpha channel of a specific overlay object

SUB ZD_SetObjectAlpha ( _
BYVAL ObjID AS LONG, _       ' The unique object IDentifier.
BYVAL Alpha AS BYTE, _       ' The alpha channel value (in the range 0-255).
BYVAL RedrawParent AS LONG _ ' TRUE causes immediat redraw of the object parent
)

Note:
The alpha channel ranges between 0 and 255.
255 means opaque, and 0 means transparent (invisible).


ZD_SetObjectAngle
Set the rotation angle of a GDImage sprite object.

SUB 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, OBJECT_TEXTBITMAP.


ZD_SetObjectBitmapFromBitmap
Replace the bitmap of an existing bitmap sprite object with a new one.

SUB 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.


ZD_SetObjectBitmapFromFile
To change (on the fly) the bitmap associated to a GDImage bitmap sprite object.

FUNCTION 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 if successful.


ZD_SetObjectClone
Change the clone ID parameter of a specific bitmap sprite object.

SUB 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!


ZD_SetObjectFlipMode
Set the flip mode of a specific bitmap sprite object.

SUB ZD_SetObjectFlipMode ( _
BYVAL ObjID AS LONG _    ' The unique sprite object identifier.
BYVAL FlipMode AS LONG _ ' A combination of the (ZD_Reverse = 2) and/or (ZD_Flip = 1) constant.
)

Remark:
The flip mode is to be used with bitmap objects (OBJECT_BITMAP and OBJECT_TEXTBITMAP)


ZD_SetObjectImageLabel

ZD_SetObjectImageLabel (Pro version only)
 Previous Top Next
Assign a label to any sprite object.

SUB 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 (ANSI).

See also:
ZD_GetObjectImageLabel


ZD_SetObjectLocked

ZD_SetObjectLocked (Pro version only)
 Previous Top Next
Set the mouse lock status of a specific sprite object (mouse dragging enable / disable).

The default lock status is FALSE (user can drag a sprite around)

SUB ZD_SetObjectLocked ( _
BYVAL ObjID AS LONG, _     ' The unique sprite object identifier.
BYVAL TrueFalse AS LONG _  ' The TRUE or FALSE lock mode.
)

Remark:
While locked, mouse dragging of the sprite is disabled, however the X,Y location can still be changed by programming.

See also:
ZD_GetObjectLocked


ZD_SetObjectProperties
Update all the propreties of a GDImage sprite object in one single step.

SUB 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 , ZOBJECT


ZD_SetObjectQuality
Set the rendering quality of a GDImage sprite object.

SUB 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.


ZD_SetObjectRotation
Set the rotation angle of a specific bitmap sprite object.

SUB ZD_SetObjectRotation ( _
BYVAL ObjID AS LONG, _      ' The unique sprite object identifier.
BYVAL AngleDegree AS LONG _ ' The rotation angle in degree.
)


ZD_SetObjectScale
Apply a scale factor to resize a sprite on the fly.

SUB 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.
)

Remark:
The real size of the sprite bitmap stay unchanged, it just affect the way it is being shown.


ZD_SetObjectScroll

ZD_SetObjectScroll (Pro version only)
 Previous Top Next
Setup the scroll with background property of a specific sprite object.

SUB 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.

See also:
ZD_GetObjectScroll


ZD_SetObjectSelected
Get the TRUE or FALSE selected status of a sprite object.

SUB 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
)

Return:
True(-1) if selected or False(0) if unselected

See also:
ZD_GetObjectSelected , ZI_ClearObjectSelected , ZI_ObjectSelected


ZD_SetObjectStyle
Set the STYLE of a GDImage overlay object.

SUB ZD_SetObjectStyle ( _
BYVAL ObjID AS LONG, _    ' The unique object IDentifier.
BYVAL UseStyle AS LONG _  ' The new style to use (must be a valid GDImage style).
)

Note:
Use ZI_UpdateWindow to refresh the display after the style change.

See also:
ZD_GetObjectStyle


ZD_SetObjectText
To change on the fly the text of a TEXT overlay.

SUB ZD_SetObjectText ( _
BYVAL ObjID AS LONG, _         ' The unique object IDentifier (each object MUST USE A UNIQUE one).
zUseText AS ASCIIZ _           ' The text to display.
)

See also:
ZD_DrawTextToCtr l


ZD_SetObjectType
Change the type of a GDImage sprite object.

SUB ZD_SetObjectType ( _
BYVAL ObjID AS LONG _      ' The unique sprite object identifier.
BYVAL ObjectType AS LONG _ ' The object type (see ZD_GetObjectType)
) AS LONG

Warning:
This is a low level API.
Usualy you should not use it, because the engine sets up already the good type, for each of the object.
(See object type ).


ZD_SetObjectUse3Dshadow
Set the positive or negative value of the 3D shadow offset for text and vector sprite objects.

SUB 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.


ZD_SetObjectVisibility
Show or Hide a specific GDImage overlay object.

SUB 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.
)


ZD_SetObjectXY
Set overlay object X,Y coordinates.

SUB ZD_SetObjectXY ( _
BYVAL ObjID AS LONG, _       ' The unique object IDentifier
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
)

See also:
ZD_GetObjectXY


ZD_SetObjectZorder
Set the Z-order of an overlay object.

FUNCTION ZD_SetObjectZorder ( _
BYVAL ObjID AS LONG, _          ' The unique object IDentifier.
BYVAL SetOrder AS LONG _        ' The new Z-order of the object.
) AS LONG

You can also use these constants:
ZD_ORDER_TOP    = &HFFFFFF      ' Top of Z-order.
ZD_ORDER_BOTTOM = &HFFFF        ' Bottom of Z-order.

Return:
0 = Error, ELSE the PREVIOUS z-order of the object.

See also:
ZD_GetObjectZorder


ZD_SetStringFormat
Get the font string format of a text sprite object.

SUB ZD_SetStringFormat ( _
BYVAL ObjID AS LONG, _       ' The unique sprite object identifier.
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
)

Constant:
ZD_TextHorzUp = Horizontal (default).
ZD_TextVertUp = Vertical bottom to top.
ZD_TextVertDn = Vertical top to bottom.


ZD_ShowObject
To SHOW or HIDE a GDImage overlay object.

SUB ZD_ShowObject ( _
BYVAL ObjID AS LONG, _       ' Unique object IDentifier (each object MUST USE A UNIQUE one).
BYVAL ShowOrHide AS LONG _   ' TRUE = SHOW, FALSE = HIDE.
)

Comment:
Works with any of the ZD_DrawXXXToCtrl procedures.


ZD_ShowObjectList
Show or hide a list of GDImage overlay objects at once.

SUB 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.
)


ZD_StretchBlt
Enhanced HALFTONE StretchBlt function.

FUNCTION 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

Remark:
This function uses antialias to produce better strectching quality.


ZD_TwinObject
Duplicate any GDImage object (sprite bitmap, text, vector object)

FUNCTION ZD_TwinObject ( _
BYVAL IDtoTwin AS LONG, _  ' The unique IDentifier of the object to duplicate.
BYVAL TwinID AS LONG, _    ' The unique IDentifier of the new clone object.
BYVAL x AS LONG, _         ' The X location in pixel coordinates.
BYVAL y AS LONG _          ' The Y location in pixel coordinates.
) AS LONG

Return:
TRUE (-1) if success, FALSE (0) if error.

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


ZD_UsePngOpacity

ZD_UsePngOpacity (Pro version only)
 Previous Top Next
Use full variable opacity with 32-bit PNG transparent.

SUB 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.


ZI_SlideAnimate
Start playing a GDImage slide show.

You must fill the ImageList() array, see the ZSLIDESHOW structure, before calling this API.

SUB 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.
)

See also:
ZI_SlideStop , ZI_SlidePlayIncrOrder , ZI_SlidePlayDecrOrder , ZI_SlidePlay , ZI_SlidePause .

Example:
Slide.bas


ZI_SlideStop

ZI_StopSlide
STOP a playing GDImage slide show.

SUB ZI_StopSlide ()

See also:
ZI_SlideAnimate , ZI_SlidePlayIncrOrder , ZI_SlidePlayDecrOrder , ZI_SlidePlay , ZI_SlidePause .

Example:
Slide.bas


ZI_SlidePlayIncrOrder
Play a GDImage slide show in incremental order.

SUB ZI_SlidePlayIncrOrder ()

See also:
ZI_SlideAnimate , ZI_SlideStop , ZI_SlidePlayDecrOrder , ZI_SlidePlay , ZI_SlidePause .

Example:
Slide.bas


ZI_SlidePlayDecrOrder
Play a GDImage slide show in decremental order.

SUB ZI_SlidePlayDecrOrder ()

See also:
ZI_SlideAnimate , ZI_SlideStop , ZI_SlidePlayIncrOrder , ZI_SlidePlay , ZI_SlidePause .

Example:
Slide.bas


ZI_SlidePlay
PLAY a GDImage slide show that has been previously PAUSED..

SUB ZI_SlidePlay ()

See also:
ZI_SlideAnimate , ZI_SlideStop , ZI_SlidePlayIncrOrder , ZI_SlidePlayDecrOrder , ZI_SlidePause .

Example:
Slide.bas


ZI_SlidePause
PLAY a GDImage slide show that has been previously PAUSED..

SUB ZI_SlidePause ()

See also:
ZI_SlideAnimate , ZI_SlideStop , ZI_SlidePlayIncrOrder , ZI_SlidePlayDecrOrder , ZI_SlidePlay .

Example:
Slide.bas


zFocusBeep
Beep the user.

SUB zFocusBeep ()


zGetCPUspeed
Compute CPU SPEED, handy to compute animation speed.

FUNCTION zGetCPUspeed () AS LONG

Return:
The CPU speed in Mhz.


zGetDIBits
Low level procedure to retrieve a device-independent bitmap.

FUNCTION zGetDIBits ( _
BYVAL hBitmap AS LONG, _  ' A valid bitmap handle.
PixelArray() AS LONG _    ' Array using 2 dimensions (Y,Y) matching the pixel coordinates.
) AS LONG

Return:
If the function succeeds, the return value is the number of scan lines copied.
If the function fails, the return value is zero.


zGetTempPath
Low level procedure to get the Windows temp directory path.

FUNCTION zGetTempPath () AS STRING

Return:
The full qualified Windows temp directory path.


zInstance
Retrieve the instance of the current module.

FUNCTION zInstance () AS LONG

Return:
The instance handle of the running application.


zKillFile
Low level procedure to delete file (remove) file from disk (the file is not sent to tray).

FUNCTION zKillFile ( _
zFullName AS ASCIIZ _  ' Full qualified path of the file to delete
) AS LONG

Return:
Error code in case of error, zero if succesful.

See also:
ZI_MoveToTray


zLoadImageFromFile
Load image from file using a GDIPLUS image handle.

FUNCTION zLoadImageFromFile ( _
zFullName AS ASCIIZ, _      ' Full path name to any of the supported graphic format.
BYREF imgW AS LONG, _       ' Return image width.
BYREF imgH AS LONG, _       ' Return 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.

See also:
zSaveImageToFile


zSaveImageToFile
Save image to file using a valid GDIPLUS image handle.

FUNCTION 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.

See also:
zLoadImageFromFile


zSetDIBits
Low level procedure to replace a copy of a bitmap that was retrieved as a device-independent bitmap.

FUNCTION zSetDIBits ( _
BYVAL hBitmap AS LONG, _  ' A valid bitmap handle.
PixelArray() AS LONG _    ' Array using 2 dimensions (Y,Y) matching the pixel coordinates.
) AS LONG

Return:
If the function succeeds, the return value is the number of scan lines copied from the bitmap.


Compatibility
GDImage - OpenGL requires a compatible graphic card.

These graphic cards have been checked successfuly with OpenGL:
· ALL-IN-WONDER 9700.
· ATI RADEON X600 with 256 Mb.
· ATI Mobility Radeon X700.
· ATI Radeon 9000 with 64 Mb.
· ATI x850.
· Intel 82852/82855 GM/GME Graphics Controller.
· Intel Extreme Graphics 845GV (AGP).
· Nvidia GeForce4 TI 4200.
· Nvidia 6800 GT.
· Nvidia GeForce4 MX 4000.
· Nvidia GeForce FX 5600 XT.
· Nvidia RIVA TNT2 Model64.
· Radeon 7200 Series.


ZI_BuildGLfont
Create an OpenGL font, from a Windows True Type Font, to use with the ZI_DrawGLText procedure.

Drawing text with OpenGL is not obvious, because there is no built-in procedure for that purpose.
GDImage takes care of all the tedious work, to let you use a font as you will do with any standard DC.

When you no longer need the font, call the ZI_DeleteGLFont function to delete it

SUB ZI_BuildGLfont ( _
BYVAL hGLcontrolDC AS LONG, _ ' The GDimage Device Context (see ZI_GetGLDC ).
UseFont AS ZGLFONT _          ' Pointer to a ZGLFONT structure.
)

Ses also:
ZI_DeleteGLFont , ZI_DrawGLText .

Example:
See any of the OpenGL demo.


ZI_CreateGLTextureFrom32Bit

ZI_CreateGLTextureFrom32Bit (Pro version only)
 Previous Top Next
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.

FUNCTION 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

Note:
xPower2 and yPower2 are equal because a GDImage OpenGL texture is always adjusted to a square shape
using a power of 2 for byte alignment, based on the closest value to the original height-width size of the image.
The ratio between width and height is preserved using the top-Left pixel color of the original image
to paint the background of the square shape texture.

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.

Example:
illusion.bas

See also:
ZI_SetGLTextureFromFile , ZI_CreateGLTextureFromFile , ZI_SetGLTextureFrom32Bit


ZI_CreateGLTextureFromFile
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.

FUNCTION 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

Note:
xPower2 and yPower2 are equal because a GDImage OpenGL texture is always adjusted to a square shape
using a power of 2 for byte alignment, based on the closest value to the original height-width size of the image.
The ratio between width and height is preserved using the top-Left pixel color of the original image
to paint the background of the square shape texture.

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.

See also:
ZI_SetGLTextureFromFile , ZI_SetGLTextureFrom32Bit


ZI_DeleteGLfont
Delete a GDImage OpenGL font previously created with ZI_BuildGLfont .

SUB ZI_DeleteGLFont ( _
UseFont AS ZGLFONT _        ' Pointer to a ZGLFONT structure.
)

Ses also:
ZI_BuildGLFont , ZI_DrawGLText .

Example:
See any of the OpenGL demo.


ZI_DoNotSquareTexture
Do not create a (default) SQUARE shape texture.

Most of the time you must use a square shape texture with OpenGL.
However with spherical objects, it is better to use a rectangular texture, where the width is twice as large as the height.
Best size would be 128 x 64, 256 x 128, 512 x 256, 1024 x 512, etc. (always 2^n).

SUB ZI_DoNotSquareTexture()

Ses also:
ZI_SetGLTextureFromFile .


ZI_DrawGLText
Display a Text string on a GDImage OpenGL graphic control.

SUB 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.
)

Ses also:
ZI_BuildGLFont , ZI_DeleteGLFont , ZI_GetGLTextExtent .

Example:
See any of the OpenGL demo.


ZI_GetGLDC
To retrieve the GDImage OpenGL permanent Device Context (CS_OWNDC).

FUNCTION ZI_GetGLDC ( _
BYVAL hGDImageCtrl AS LONG _  ' The GDimage control handle.
) AS LONG

Note:
Do not delete this DC !


ZI_GetGLRC
To retrieve the GDImage OpenGL Rendering Context.

FUNCTION ZI_GetGLRC ( _
BYVAL hGDImageCtrl AS LONG _  ' The GDimage control handle.
) AS LONG

Note:
The OpenGL Rendering Context has the same pixel format as the GDImage Device Context.


ZI_GetGLTextExtent
Return the Width and Height of a string based on a specific ZGLFONT font structure.

Use this whenever you need to compute the exact size (in pixel) of a string.

SUB 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.
)

Ses also:
ZI_DrawGLText .


ZI_GetGLzoom
Get the current GDImage OpenGL zoom.

FUNCTION 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 to 180°.
Ses also:
ZI_SetGLzoom .


ZI_InitGLControl
Enable the use of OpenGL with a previously "bounded" GDImage OpenGL texture.

SUB ZI_InitGLControl  _
BYVAL ARGB AS LONG _ ' The GDImage ARGB color to paint the control background.
)

See also:
ZI_SetGLTextureFromFile


ZI_IsCtrlKeyPressed
Determines whether the Shift key is up or down at the time the function is called.

FUNCTION ZI_IsCtrlKeyPressed () AS LONG (Boolean)

Return:
TRUE = the Ctrl key is down, FALSE = the Ctrl key is up.

See also:
ZI_IsKeyDown , ZI_IsLButtonDown , ZI_IsRButtonDown , ZI_IsShiftKeyPressed .

Example:
The OpenGL Chart.bas demo.


ZI_IsKeyDown
Determines whether a key is up or down at the time the function is called.

FUNCTION ZI_IsKeyDown ( _
BYVAL CheckKey AS LONG _  ' One of 256 possible virtual-key codes.
) AS LONG (boolean)

Return:
TRUE = the key is down, FALSE = the key is up.

See also:
ZI_IsLButtonDown , ZI_IsRButtonDown , ZI_IsShiftKeyPressed , ZI_IsCtrlKeyPressed .

Example:
The OpenGL Chart.bas demo.


ZI_IsLButtonDown
Determines whether the left mouse button is up or down at the time the function is called.

FUNCTION ZI_IsLButtonDown () AS LONG (Boolean)

Return:
TRUE = the mouse button is down, FALSE = the mouse button is up.

See also:
ZI_IsKeyDown , ZI_IsRButtonDown , ZI_IsShiftKeyPressed , ZI_IsCtrlKeyPressed .

Example:
The OpenGL Chart.bas demo.


ZI_IsRButtonDown
Determines whether the right mouse button is up or down at the time the function is called.

FUNCTION ZI_IsRButtonDown () AS LONG (Boolean)

Return:
TRUE = the mouse button is down, FALSE = the mouse button is up.

See also:
ZI_IsKeyDown , ZI_IsLButtonDown , ZI_IsShiftKeyPressed , ZI_IsCtrlKeyPressed .

Example:
The OpenGL Chart.bas demo.


ZI_IsShiftKeyPressed
Determines whether the Shift key is up or down at the time the function is called.

FUNCTION ZI_IsShiftKeyPressed () AS LONG (Boolean)

Return:
TRUE = the Shift key is down, FALSE = the Shift key is up.

See also:
ZI_IsKeyDown , ZI_IsLButtonDown , ZI_IsRButtonDown , ZI_IsCtrlKeyPressed .

Example:
The OpenGL Chart.bas demo.


ZI_ResizeGLWindow
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".

SUB ZI_ResizeGLWindow ( _
BYVAL hGDImageCtrl AS LONG _ ' The GDimage control handle.
)

Note:
To resize automatically a GDImage control use the ZI_SetAnchorMode API.

Example:
See the EYE demo.


ZI_SetGLTextureFrom32Bit

ZI_SetGLTextureFrom32Bit (Pro version only)
 Previous Top Next
Create on the fly an OpenGL transparent texture from a PNG 32-bit using variable opacity..

GDImage takes care of all the hard stuff to create a correct OpenGL texture.

The new texture is "binded" automaticaly to the GImage OpenGL control.

FUNCTION 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.

Example:
illusion.bas

See also:
ZI_CreateGLTextureFromFile , ZI_InitGLControl , ZI_CreateGLTextureFrom32Bit


ZI_SetGLTextureFromFile
Create on the fly an OpenGL texture from any supported GDImage raster graphic file.

GDImage takes care of all the hard stuff to create a correct OpenGL texture.

The new texture is "binded" automaticaly to the GImage OpenGL control.

FUNCTION 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.

See also:
ZI_CreateGLTextureFromFile , ZI_InitGLControl , ZI_CreateGLTextureFrom32Bit


ZI_SetGLzoom
Set the current GDImage OpenGL zoom.

When the degree value of fovy increases, the object takes away from the observer.
Default fovy value is 45° in the range 1 to 180°.

SUB 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.
)

Ses also:
ZI_GetGLzoom .


ZI_SetMutipleGLTextureFrom32Bit

ZI_SetMutipleGLTextureFrom32Bit (Pro version only)
 Previous Top Next
Load multiple OpenGL transparent "Named texture" at once from PNG 32-bit using variable opacity.

FUNCTION ZI_SetMutipleGLTextureFrom32Bit ( _
mt() AS ZGLTEXTURE _         ' A ZGLTEXTURE array.
) AS LONG

Return:
An OpenGL error code in case of Error.

Example:
illusion.bas

See also:
ZI_SetMutipleGLTextureFromFile , ZI_SetGLTextureFromFile , ZI_SetGLTextureFrom32Bit


ZI_SetMutipleGLTextureFromFile
Load multiple OpenGL "Named texture" at once.

FUNCTION ZI_SetMutipleGLTextureFromFile ( _
mt() AS ZGLTEXTURE _         ' A ZGLTEXTURE array.
) AS LONG

Return:
An OpenGL error code in case of Error.

Example:
Chart.bas

See also:
ZI_SetMutipleGLTextureFrom32Bit , ZI_CreateGLTextureFromFile , ZI_SetGLTextureFromFile , ZI_SetGLTextureFrom32Bit


ZI_UpdateGLWindow
Allows you to update a GDImage OpenGL control.

Nothing will be shown into the control, until you use it.

SUB ZI_UpdateGLWindow ()

Note:
This API must be called from your "DrawScene" procedure to display the rendered animation.

Example:
See the EYE demo.


ZI_UpdateNamedGLTextureFromFile
Update an existing OpenGL"Named texture" with a new GDImage texture file.

FUNCTION 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.

Example:
Chart.bas


ZI_UseGLPanoramaView
Create a GDImage OpenGL panorama view.

A panorama view is suitable to display 360° fisheye digital pictures.

SUB ZI_UseGLPanoramaView ( _
BYVAL latitude AS DOUBLE, _  ' The vertical orientation angle in degree.
BYVAL longitude AS DOUBLE _  ' The horizontal orientation angle in degree.
)

Example:
Pano.bas


ZI_UseGLPolarView
Create a GDImage OpenGL polar view.

A polar view defines the viewer's position in polar coordinates.

SUB ZI_UseGLPolarView ( _
BYVAL radius AS DOUBLE, _    ' Distance from the eye to the world space origin.
BYVAL twist AS DOUBLE, _     ' Amount to rotate viewpoint around line of sight using right-hand rule.
BYVAL latitude AS DOUBLE, _  ' Latitude value in degree.
BYVAL longitude AS DOUBLE _  ' Longitude value in degree.
)

Example:
Globe.bas


ZI_glColor4f
Convert a GDImage ARGB color to an OpenGL color.

SUB ZI_glColor4f ( _
BYVAL ARGB AS LONG _  ' A GDImage ARGB color.
)

Note:
The new color applies to all subsequent OpenGL drawing procedures until a new color is defined.


About the examples
GDImage is provided with several source code examples written in PowerBASIC.

The GDImage is a 32-bit DLL that you can interface it with any Win32 programming language.

Note: for the sake of portability, all examples are written in pure SDK programming style.

Why did you use PowerBASIC ?
Because it has the same scope of variables than those available in C, C++, VB, and Delphi.
Its syntax is very closed to the one being used in the Win32 API SDK, however easier to read than C.
It produces small, fast, and lean 32-bit code that won't require any runtime nor extra OCX or DLL.

Some of the examples are also available in C# and WinDev.

C# examples are there: C# demo

Windev (english) examples are there: Windev demo in english
Windev (french) examples are there: Windev demo en français

Provided examples:
· AeroGlass
· Anchor.bas
· Animate.bas
· Carousel.bas
· Chart.bas
· Control.bas
· Drawing.bas
· Eye.bas
· GdwDDT.bas
· Globe.bas
· Hal.bas
· IconMenu.bas
· Illusion.bas
· Image.bas
· Pano.bas
· Reflect.bas
· Resource.bas
· Slide.bas
· Splash.bas
· Sprite.bas
· Vector.bas
· Zoomplus.bas


AeroGlass

AeroGlass (Pro version)
 Previous Top Next
This example shows you how to handle sprites using a callback procedure.
'
· Callback procedure to take control over the default GDImage procedure.
· Use of Event message:
WM_LBUTTONDOWN, WM_RBUTTONDOWN, WM_KEYDOWN, WM_MOUSEMOVE, etc.
· Sprite manipulation using the mouse and/or the keyboard.
· PNG 32-bit variable opacity.
· Screen shot of the desktop.
· Moving group of sprites altogether.
· etc.


Anchor
This example shows you how to anchor a GDImage control.

When a GDImage control is anchored, its size and/or location are updated accordingly to the size of its parent container.
'
· Anchor of a GDImage control.
· Anchor of any standard control type (button, listbox, combo, edit, etc.).
· Gradient background.


Animate
This example shows you how to create a text marquee effect, together with a simple slide show.
'
· Text animation with random color change.
· Simplistic slide show (cut mode).
· How to change the priority of the running application.
· How to create a message loop suitable for animation purpose.
· How to use the low level zGetCpuSpeed.


Carousel

Carousel (Pro version)
 Previous Top Next
Amazing 3D sprite animation.
'
· 360° carousel animation.
· 3D depth.
· Variable opacity.
· Self rotation.
· Scrolling marquee text effect (C# and WinDev only).
· Speed adjustment.
· Focus adjustment.
· Vertical adjustment.
· On/off wallpaper mode.
· Exclusive skinned interface (C# and WinDev only)
· In pause mode you can move the sprite around using either the mouse or keyboard.


Chart
This example shows you how to create an OpenGL 3D chart.
'
· You can move a virtual camera around the chart, change location, zoom in and out.
· Using either the mouse or the keyboard.
· Apply texture to the chart components.
· Zoom in and out the OpenGL scene.

Note:
In order to use OpenGL you must have a compatible graphic card !


Control
This example shows you how to use all the different types of GDImage controls.
'
· Load image using common dialog with thumbnail preview.
· Save image using any of the supported GDIPLUS graphic formats.
· Copy from a GDImage control to the clipboad.
· Paste from clipboad into a GDImage control.
· Display of a popup GDImage control using a bitmap region.
· Display of a popup layered GDImage control.
· Display of a GIF animated into a GDImage control.


Drawing
This example shows you how to use GDImage overlay objects,
built-in print procedure, image streaming, color conversion,
switching between draft and antialias mode.
'
· Select a new image for background.
· Draw multiple GDImage overlay objects.
· Change the z-order of a GDImage object.
· Anchor of GDImage objects with the image background.
· Unique color count detection.
· Convert a colored image into 256 shade of gray.
· Print, sending only the image background to printer.
· Print, sending background + overlay objects (rendering) to the printer.
· Load image from a text buffer (streaming).


Eye
This example shows you how to create an OpenGL texture from a GDImage graphic file.
'
· Display a rotating cube with a mapped image texture.
· Allows you to select a new image texture and use it on the fly.
· Resize a GDImage OpenGL control on the fly.

Note:
In order to use OpenGL you must have a compatible graphic card !


GdwDDT
This example shows you how to use GDImage control with PowerBASIC DDT.
'
· It creates a main GDImage control with scrolling.
· And a fit to control GDImage thumbnail.


Globe
This example shows you how to map a GDImage OpenGL texture over a spherical object.
'
· Display a rotating globe with a mapped "earth" image texture.
· Allows you to select a new image texture and use it on the fly.
· Zoom in and out the OpenGL scene.

Note:
In order to use OpenGL you must have a compatible graphic card !


Hal
This example shows you how to create translucent sprites with GDImage.

Each sprite is created as a GDI BITMAP object from file, but it can also be created from resource.
'
· Display 4 sprites at a random location using a "boucing ball" effect.
· Sprite use translucency (alpha channel).

Note:
Alphablending his much slower because it requires a lot of computation,
however if you have a fast computer and a good graphic card then you will love it.


IconMenu

IconMenu (Pro version)
 Previous Top Next
Animated icon menu with mouse hover effect.
'
· Self rotation.
· Mouse hover effect.
· Fading text.
· Exclusive skinned interface (C# and WinDev only).
· On/off wallpaper mode.
· You can move the icon around using either the mouse or keyboard.


Illusion

Illusion (Pro version)
 Previous Top Next
This example shows you how to use transparent textures with OpenGL.
'
· You can change the transparent texture being used to map the 3D cube.
· Enable / disable the GL depth feature.

Note:
In order to use OpenGL you must have a compatible graphic card !


Image
This example displays an image within a GDImage OpenGL graphic control.
'
· Automatic lighting effect.
· Change image perspective using either the mouse or the keyboard.
· Create a marquee text effect, building an OpenGL font from a Windows TTF.
· Change image on the fly, using any of the supported GDImage graphic format.
· Zoom in and out.

Note:
In order to use OpenGL you must have a compatible graphic card !


Pano
This example displays a 360 panorama image in a GDImage OpenGL graphic control.
'
· Change the view angle using either the keyboard or the control buttons.
· Select a new panorama image on the fly, using any of the supported GDImage graphic format.
· Zoom in and out.

Note:
In order to use OpenGL you must have a compatible graphic card !


Reflect

Reflect (Pro version)
 Previous Top Next
Mirror reflection effect.
'
· Add mirror effect to any bitmap sprite object.
· Move the sprite around using either the mouse or keyboard.


Resource
This example shows you how to load one or more bitmap as EXE's resource,
plus image rotation, sprite display, mouse cursor, tiled background.
'
· The bitmap can use any of the supported GDImage graphic formats.
· Look at the resource.rc file to see the use of RCDATA with binary files.
· Use of image rotation animation.
· Use of moving sprite with translucency.
· Use of DIB manipulation to remove a specific color from the sprite.
· Use of a mouse cursor specific to the GDImage control.
· Use of small bitmap to create a tiled background (like for web page).
· Text animation with dynamic string change.


Slide
This example shows you how to create a GDImage slide show.
'
A GDImage slide show is based on an array of ZSLIDESHOW properties,
where you define:
'
· The full path name to a specific image (must be a supported GDImage graphic format).
· The delay in millisecond to display a specific frame (image) once the transition effect is over.
· The transition Effect to use.
· The Grain that affects the size and/or speed of the effect.
· The optional text legend.
· The TrueType font name that will be used (make sure the font exist on the host computer).
· The size of the font in pixel.
· The ARGB color of the font.
· The optional shadow offset.
· The location of the legend over the slide (see: list of constants ).

Make sure to play with the Grain parameter to understand how it changes the transition effect.


Splash
This example displays a translucent Splash screen.
'
· You can use any Device Context including the Windows desktop.


Sprite
This example shows you how to move multiple sprites with GDImage.

Each sprite is created as a GDI BITMAP object from file, but it can also be created from resource.
'
· Display 4 sprites at a random location.
· Drag a sprite using translucency (alpha channel).


Vector
This example shows you how to use GDImage polypoligon and vector animation.
'
· It draws a map of the USA from an array of point's coordinates,
using a scaling factor to perform animation.
· It shows or hides a polypoligon
using different parameters for each of the four polygons that composed it.


ZoomPlus

ZoomPlus (Pro version)
 Previous Top
This example shows you how to handle large picture with zooming capabilities.
'
· It creates a GDImage zooming control to handle large pictures.
· Zooming is performed using a vertical trackbar.
· Flip the image horizontaly.
· Flip the image verticaly.
· Rotate the image by step of 90° anti-clockwise.
· Rotate the image by setp of 90° clockwise.
· Load picture from file.
· Save picture to file.


This example shows you how to handle large picture with zooming capabilities.
'
·	It creates a GDImage zooming control to handle large pictures.
·	Zooming is performed using a vertical trackbar.
·	Flip the image horizontaly.
·	Flip the image verticaly.
·	Rotate the image by step of 90° anti-clockwise.
·	Rotate the image by setp of 90° clockwise.
·	Load picture from file.
·	Save picture to file.