Making Gui Pic not visible leaves white rectange... Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
User avatar
kunkel321
Posts: 1156
Joined: 30 Nov 2015, 21:19

Making Gui Pic not visible leaves white rectange...

17 May 2024, 11:05

The finger image follows the cursor. Pressing Shift toggles between the left/right images. As seen in the screencast at the bottom, the code works well, except that when Visible := False, there is a white rectangle...

Any ideas how to fix?

Code: Select all

#SingleInstance force
#Requires Autohotkey v2.0-beta.1+
; Strongly based on Mikeyww's at,
; https://www.autohotkey.com/boards/viewtopic.php?f=76&t=116345&p=518706#p518582

fingerR := A_ScriptDir "\FingerR.png"
fingerL := A_ScriptDir "\FingerL.png"
ProcessSetPriority("B")
fing := Gui()
fing.Opt("-Caption +LastFound +ToolWindow +AlwaysOnTop +E0x20")
fing.MarginX := "0", fing.MarginY := "0"
fing.BackColor := "FFFFFF"
finR := fing.Add("Pic", "BackgroundTrans AltSubmit", fingerR)
finL := fing.Add("Pic", " x+20 BackgroundTrans AltSubmit", fingerL)
finL.Visible := False
WinSetTranscolor("FF0072")

LR := True
SwitchRL(*)
{	Global LR
	If LR := !LR {
		finL.Visible := True
		finR.Visible := False
	}
	Else {
		finL.Visible := False
		finR.Visible := True
	}
}

on := True
SetTimer(draw,10)
F1::
{ 	Global on
	If on := !on {
		SetTimer(draw,10)
	} Else {
		SetTimer(draw,0)
		fing.Hide()
	}
	Return
} 

#HotIf WinExist(fing)
Shift::SwitchRL()
#HotIf

draw() {
	CoordMode("Mouse")
	MouseGetPos(&x, &y)
	fing.Show("NA x" x-325 "y" y-50)
}

Esc::ExitApp()
Image

Image

Short screencast:
Image
ste(phen|ve) kunkel
User avatar
Noitalommi_2
Posts: 294
Joined: 16 Aug 2023, 10:58

Re: Making Gui Pic not visible leaves white rectange...  Topic is solved

17 May 2024, 11:28

Hi.

this fing.BackColor := "FFFFFF" must be fing.BackColor := "FF0072"
User avatar
kunkel321
Posts: 1156
Joined: 30 Nov 2015, 21:19

Re: Making Gui Pic not visible leaves white rectange...

17 May 2024, 12:29

Yep, that was it. Thanks.
ste(phen|ve) kunkel

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: Descolada and 35 guests