GUICtrlCreateGraphic is a container for GDI Api?
Posted 20 February 2012 - 04:15 PM
My be I lack of information, but If I create a Graphic control via GUICtrlCreateGraphic the subsequent instructions gdi e.g _GDIPlus_GraphicsDrawRect are related to control and not on the windows indicated in _GDIPlus_GraphicsCreateFromHWND
Incidentally if this is correct is better for me.
Posted 20 February 2012 - 04:51 PM
Posted 20 February 2012 - 06:55 PM
yes this is true, but I checked the instructions _GDIPlus_GraphicsDrawRect draw a rectangle in the graphic control, instead of in the window.
Can be an Autoit error?
Posted 20 February 2012 - 08:03 PM
#include <gdiplus.au3> #include <staticconstants.au3> _GDIPlus_Startup() $hGUI = GUICreate("Test", 320, 256) GUISetBkColor(0x000000) $iW = 120 $iH = 224 $idPic = GUICtrlCreatePic("", 80, 16, $iW, $iH, $SS_SUNKEN) GUICtrlSetBkColor($idPic, 0xF0F0F0) $hPic = GUICtrlGetHandle($idPic) GUISetState() $hGfx = _GDIPlus_GraphicsCreateFromHWND($hPic) _GDIPlus_GraphicsClear($hGfx, 0xFFF0F0F0) _GDIPlus_GraphicsSetSmoothingMode($hGfx, 2) $hPen = _GDIPlus_PenCreate(0xFFFF0000) _GDIPlus_GraphicsDrawLine($hGfx, 0, 0, $iW, $iH, $hPen) Do Until GUIGetMsg() = -3 _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_Shutdown() Exit
GDI+ can only draw to a graphics handle or directly to a bitmap but not into a window handle.
Edited by UEZ, 20 February 2012 - 08:12 PM.
The own fart smells best! ✌
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
Posted 20 February 2012 - 08:22 PM
This is a respons that I need, my errors was of thinking that the handle of _GDIPlus_GraphicsCreateFromHWND was the handle of a window (as saith in the help and in the example).
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users