Jump to content



Photo

GUICtrlCreateGraphic is a container for GDI Api?


  • Please log in to reply
4 replies to this topic

#1 rossati

rossati

    Seeker

  • Active Members
  • 26 posts

Posted 20 February 2012 - 04:15 PM

Hello

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.

thank

John Rossati





#2 martin

martin

    ~~\o/~~~/0\=¬''~~~

  • MVPs
  • 7,199 posts

Posted 20 February 2012 - 04:51 PM

A graphic control created with GuiCtrlCreateGraphic is not intended to be usd with the _GDIPlus_* functions.. To draw on the graphic control you need to look up GuiCtrlSetGraphic.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

#3 rossati

rossati

    Seeker

  • Active Members
  • 26 posts

Posted 20 February 2012 - 06:55 PM

Hello Martin

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?

John Rossati

#4 UEZ

UEZ

    Never say never

  • MVPs
  • 3,606 posts

Posted 20 February 2012 - 08:03 PM

You can also draw with GDI+ into a picture control.

Example:
AutoIt         
#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.

Br,
UEZ

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!
¯\_(ツ)_/¯


#5 rossati

rossati

    Seeker

  • Active Members
  • 26 posts

Posted 20 February 2012 - 08:22 PM

thank

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

Jonh Rossati




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users