Jump to content

Search the Community

Showing results for tags '$gui_gr_pensize'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum FAQ
  • AutoIt

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. I believe I've found a bug in the GUICtrlSetGraphic() function. In the help documentation it says that $GUI_GR_PENSIZE has to be defined before $GUI_GR_COLOR to be taken into account. However, when I do this, the "dots" drawn using $GUI_GR_DOT end up looking very thick and clunky. Maybe this is how it's supposed to work but I noticed that when I don't define $GUI_GR_PENSIZE before $GUI_GR_COLOR, the dot is still drawn with the pensize I wanted but with a nice fine line instead of the thick clunky line. Unfortunately when I go to draw the next dot, it's thick and clunky again. The only way I can get around this is to change pensize, draw something else, then switch the pensize back and draw another dot. Edit: here's my experimental code (derived from GUICtrlSetGraphic.au3 example from the help documentation) #include <GUIConstantsEx.au3> #include <StaticConstants.au3> Global Const $g_MAXGr = 2 Global $g_aidGraphics[$g_MAXGr + 1] ; 0 and $g_MAXGr entries not used to allow GUICtrlDelete result Global $g_idDel, $g_hChild Example() Func Example() Local $idMsg, $iInc, $i GUICreate("My Main", -1, -1, 100, 100) Local $idReCreate = GUICtrlCreateButton("ReCreate", 50, 200, 50) GUISetState(@SW_SHOW) CreateChild() $i = 1 $iInc = 1 Do $idMsg = GUIGetMsg() If $idMsg = $idReCreate Then $i = Create($iInc) If $idMsg = $g_idDel Then GUICtrlDelete($g_aidGraphics[$i]) $i = $i + $iInc If $i < 0 Or $i > $g_MAXGr Then Exit EndIf Until $idMsg = $GUI_EVENT_CLOSE EndFunc ;==>Example Func Create($iInc) GUIDelete($g_hChild) CreateChild() Return 1 EndFunc ;==>Create Func CreateChild() $g_hChild = GUICreate("My Draw") $g_idDel = GUICtrlCreateButton("Delete", 50, 165, 50) $g_aidGraphics[1] = GUICtrlCreateGraphic(150, 10, 60, 50) GUICtrlSetBkColor(-1, 0xa0ffa0) GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 20, 20) ; start point ; ugly blue dot GUICtrlSetGraphic(-1, $GUI_GR_PENSIZE, 2) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x0000ff) GUICtrlSetGraphic(-1, $GUI_GR_DOT, 25, 25) ; line 1 (vertical) GUICtrlSetGraphic(-1, $GUI_GR_PENSIZE, 1) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0) GUICtrlSetGraphic(-1, $GUI_GR_LINE, 20, 40) ; nice red dot GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff0000) GUICtrlSetGraphic(-1, $GUI_GR_PENSIZE, 2) GUICtrlSetGraphic(-1, $GUI_GR_DOT, 35, 25) ; next dot (green) is ugly GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x009900) ;GUICtrlSetGraphic(-1, $GUI_GR_PENSIZE, 2) ; still ugly with or without this line GUICtrlSetGraphic(-1, $GUI_GR_DOT, 25, 35) ; line 2 (horizontal) GUICtrlSetGraphic(-1, $GUI_GR_PENSIZE, 1) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0) GUICtrlSetGraphic(-1, $GUI_GR_LINE, 40, 40) ; dot (black) is nice again GUICtrlSetGraphic(-1, $GUI_GR_PENSIZE, 2) GUICtrlSetGraphic(-1, $GUI_GR_DOT, 35, 35) ; but if I don't change the color, the dots remain nice GUICtrlSetGraphic(-1, $GUI_GR_DOT, 45, 35) GUICtrlSetGraphic(-1, $GUI_GR_DOT, 55, 35) $g_aidGraphics[2] = GUICtrlCreateGraphic(150, 80, 50, 50) ;Default code from GUICtrlSetGraphic.au3 example GUICtrlSetBkColor(-1, 0xa0ffa0) GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 20, 20) ; start point ; it is better to draw line and after point ; to avoid to switch color at each drawing GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x0000ff) GUICtrlSetGraphic(-1, $GUI_GR_DOT, 30, 30) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0) GUICtrlSetGraphic(-1, $GUI_GR_LINE, 20, 40) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff0000) GUICtrlSetGraphic(-1, $GUI_GR_DOT, 25, 25) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0) GUICtrlSetGraphic(-1, $GUI_GR_LINE, 40, 40) GUICtrlSetGraphic(-1, $GUI_GR_DOT, 30, 40) GUISetState(@SW_SHOW) EndFunc ;==>CreateChild
×
×
  • Create New...