Function Reference


Initialize Microsoft Windows GDI+

#include <GDIPlus.au3>
_GDIPlus_Startup ( [$sGDIPDLL = Default [, $bRetDllHandle = False]] )


$sGDIPDLL [optional] the filename of the dll to be used. Default is the installed GDI Dll.
$bRetDllHandle [optional] True if the handle to opened GDI Dll is to be returned. Default is False.

Return Value

Success: True or a handle to the opened GDI Dll if $bRetDllHandle = True.
Failure: False and sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GPIP_ERR* see GPIPlusConstants.au3).


Call _GDIPlus_Startup() before you create any GDI+ objects.

If GDI+ V1.1 functions are available @extended will be set to value greater than 5.
For Vista or Server 2008 the $sGDIPDLL must be defined. The gdiplus.dll can be found in @WindowsDir & "\winsxs\*.gdiplus*\gdiplus.dll"



See Also

Search GdiplusStartup in MSDN Library.


#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <ScreenCapture.au3>
#include <WinAPIHObj.au3>


Func Example()
        Local $hGUI, $hBMP, $hBitmap, $hGraphic

        ; Capture upper left corner of screen
        $hBMP = _ScreenCapture_Capture("", 0, 0, 400, 300)

        ; Create GUI
        $hGUI = GUICreate("GDI+", 400, 300)

        ; Initialize GDI+ library

        ; Draw bitmap to GUI
        $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBMP)
        $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
        _GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, 0, 0)

        ; Clean up resources

        ; Shut down GDI+ library

        ; Loop until the user exits.
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example