#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
$hGUI = GUICreate("GDI+", 400, 300)
GUISetState()
_GDIPlus_Startup ()
$hBitmap = _GDIPlus_BitmapCreateFromFile ('test.tif')
$hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hGUI)
$h = _GDIPlus_ImageGetHeight ($hBitmap)
$w = _GDIPlus_ImageGetWidth ($hBitmap)
if $h > $w Then
$w = $w/($h/100)
$h = $h-($h-100)
elseif $h<$w Then
$h = $h/($w/100)
$w = $w-($w-100)
endif
_GDIPlus_GraphicsDrawImageRect ($hGraphic, $hBitmap, 10, 10, $w, $h)
_GDIPlus_GraphicsDrawRect ($hGraphic, 10, 10, $w, $h)
_GDIPlus_ShutDown ()
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE