Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Draw Line GUI


  • Please log in to reply
8 replies to this topic
Albireo
  • Members
  • 558 posts
  • Last active: Dec 13 2019 02:02 PM
  • Joined: 01 Feb 2006
Hello!

I want to draw a line with an GUI command

Is it possible to:
- do it "directly"? (or maybe I must have lines as image)
- deciding on appearance / thickness?
- selecting color?

Jan

answer4u
  • Guests
  • Last active:
  • Joined: --
Here's a quick example:
Gui,  -Caption +ToolWindow

Gui, Color, Red

Gui, Show, NA h2 w100


da_boogie_man
  • Guests
  • Last active:
  • Joined: --
Here's a way to draw lines:
gui, add, text, x10 y10 w100 0x10  ;Horizontal Line > Etched Gray
gui, add, text, x10 y15 h70 0x11  ;Vertical Line > Etched Gray
gui, add, text, x10 y+10 w75 h1 0x7  ;Horizontal Line > Black
gui, add, text, x10 y+10 w1 h75 0x7  ;Vertical Line > Black

Gui, show, center w225 h175

The "0x10" & "0x11" are specifically lines and the "0x7" is actually a box enclosed and you would use the width/height as "1" to make it look like a line.

I haven't seen any other ways, aside from using pix of your own.


DBM

Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009
GDI+ standard library 1.30 by tic
<!-- m -->http://www.autohotke... ... highlight=<!-- m -->

Example 1: Gdip.Tutorial.1-Draw.Shapes.ahk - Create a simple gui and draw an ellipse and a rectangle

Albireo
  • Members
  • 558 posts
  • Last active: Dec 13 2019 02:02 PM
  • Joined: 01 Feb 2006

Here's a quick example:

Gui,  -Caption +ToolWindow
Gui, Color, Red
Gui, Show, NA h2 w100


Nice red line :D


Here's a way to draw lines:

gui, add, text, x10 y10 w100 0x10  ;Horizontal Line > Etched Gray
gui, add, text, x10 y15 h70 0x11  ;Vertical Line > Etched Gray
gui, add, text, x10 y+10 w75 h1 0x7  ;Horizontal Line > Black
gui, add, text, x10 y+10 w1 h75 0x7  ;Vertical Line > Black

Gui, show, center w225 h175

The "0x10" & "0x11" are specifically lines and the "0x7" is actually a box enclosed and you would use the width/height as "1" to make it look like a line.

I haven't seen any other ways, aside from using pix of your own.
DBM


Thank you - it works för me :D
(How do you control the color of the line?)



GDI+ standard library 1.30 by tic
<!-- m -->http://www.autohotke... ... highlight=<!-- m -->

Example 1: Gdip.Tutorial.1-Draw.Shapes.ahk - Create a simple gui and draw an ellipse and a rectangle


Here was a wide, seemingly, good example
But, must there be something special installed to make it work?
for examile I got error.
Call to nonexistent function in row 13 (" Gdip.Tutorial.1-Draw.Shapes.ahk") :( - How do you solve this?

_____________________________


Would be nice to draw a line in "3D", but perhaps not possible in AutoHotkey?

In any case, thank's for your time

//Jan

jpjazzy
  • Members
  • 800 posts
  • Last active: Dec 17 2014 07:22 AM
  • Joined: 16 Feb 2010
If you don't have gdi.ahk in your standard library then you need to uncomment the include gdi to make it work with the ahk file included and they must be in the same directory.

Look at this line in the sample:

; Uncomment if Gdip.ahk is not in your standard library
;#Include, Gdip.ahk

;change it to this

; Uncomment if Gdip.ahk is not in your standard library
#Include, Gdip.ahk


Albireo
  • Members
  • 558 posts
  • Last active: Dec 13 2019 02:02 PM
  • Joined: 01 Feb 2006

Look at this line in the sample:

; Uncomment if Gdip.ahk is not in your standard library
;#Include, Gdip.ahk

;change it to this

; Uncomment if Gdip.ahk is not in your standard library
#Include, Gdip.ahk


Thank you, but then I get the following error:

"GDIP.ahk" cannot be opened


Where can I find the file "GDIP.ahk"?

  • Guests
  • Last active:
  • Joined: --
The same thread as the sample should have been on. <!-- m -->http://www.autohotke...pic.php?t=32238<!-- m --> :lol:

-jpjazzy

Albireo
  • Members
  • 558 posts
  • Last active: Dec 13 2019 02:02 PM
  • Joined: 01 Feb 2006
Thank you!
Excuse, I missed the large text :-)

; Uncomment if Gdip.ahk is not in your standard library
;#Include, Gdip.ahk

;change it to this

; Uncomment if Gdip.ahk is not in your standard library
#Include, Gdip.ahk


What is the "standard library"
Is it c:\program\autohotkey ?
or some other catalog with path to?

//Jan