I’m brand new to Gdip. How can a line animation be drawn using Gdip? See the gif below.
An example script with comments would be very helpful.
All help and guidance is appreciated. Thank you.
Example Gif of line drawing animation.
Gdip - Draw a line animation Topic is solved
Re: Gdip - Draw a line animation Topic is solved
most basic example
Canvas.ahk https://github.com/Uberi/Canvas-AHK is also really good. I would suggest taking a look at that to if you are in the beginning stages.
Code: Select all
SetUpGDIP()
pen := Gdip_CreatePen(0xffff0000,5)
setTimer, showLine, -1
showLine:
mouseGetPos,x,y
StartDrawGDIP()
;ClearDrawGDIP()
Gdip_DrawLine(G, pen, 0, 0, x,y)
EndDrawGDIP()
setTimer, showLine, -1
tooltip %x%`,%y%
return
#Include Gdip.ahk
#Include GdipHelper.ahk
Re: Gdip - Draw a line animation
That is very helpful! Thank you very much @colt
I'll check out Canvas aswell.
I'll check out Canvas aswell.
Re: Gdip - Draw a line animation
Another method.
Code: Select all
;****************************************************************************************************************************************************************************
#Include <My Altered GDIP lib> ;GDI+ Lib
#Include <PopUpWindow Class> ;https://www.autohotkey.com/boards/viewtopic.php?f=6&t=94961
;****************************************************************************************************************************************************************************
Gdip_Startup()
Gui1 := New PopUpWindow( { WindowName: "1" , WindowOptions: " -DPIScale +AlwaysOnTop " , WindowSmoothing: 2 , X: 0 , Y: 0 , W: A_ScreenWidth , H: A_ScreenHeight } )
Pen := Gdip_CreatePen( "0x99FF0000", 5 ) , Gdip_DrawLine( Gui1.G , Pen, 100 , 100 , 500 , 500 ) , Gdip_DeletePen( Pen )
Gui1.UpdateWindow()
Gui1.ShowWindow()
return
*ESC::ExitApp
Code: Select all
;****************************************************************************************************************************************************************************
#Include <My Altered GDIP lib> ;GDI+ Lib
#Include <PopUpWindow Class> ;https://www.autohotkey.com/boards/viewtopic.php?f=6&t=94961
;****************************************************************************************************************************************************************************
#SingleInstance, Force
SetBatchLines, -1
CoordMode, Mouse, Screen
Gdip_Startup()
Pen := Gdip_CreatePen( "0x99FF0000", 5 )
Gui1 := New PopUpWindow( { WindowName: "1" , WindowOptions: " -DPIScale +AlwaysOnTop " , WindowSmoothing: 2 , X: 0 , Y: 0 , W: A_ScreenWidth , H: A_ScreenHeight } )
Gui1.ShowWindow()
SetTimer, Draw, 30
return
*ESC::ExitApp
Draw:
MouseGetPos, x, y
Gui1.ClearWindow()
Gdip_DrawLine( Gui1.G , Pen, A_ScreenWidth / 2 , A_ScreenHeight / 2 , x , y )
Gui1.UpdateWindow()
return
Re: Gdip - Draw a line animation
@Hellbent That's some nice clean code! I will defiantly experiment with your example. Thanks alot for your help.
By the way, Custom Gui Image Button is super awesome!
By the way, Custom Gui Image Button is super awesome!
Re: Gdip - Draw a line animation
NP.SirSocks wrote: ↑20 Oct 2021, 18:46@Hellbent That's some nice clean code! I will defiantly experiment with your example. Thanks alot for your help.
By the way, Custom Gui Image Button is super awesome!
If you ever make any button designs I would love to get a copy of the button theme object.
Who is online
Users browsing this forum: dunnerca and 146 guests