I am trying to create a script in which if you press the capslock key a gif image appears on the screen, but the gif image appears with a solid black background, it is not transparent, what am I doing wrong?
; Variable to track the state of Caps Lock
global capslock_toggle := false
; Path to the GIF file with transparency
ImagePath := "C:PathToYourFolderanimation.gif"
; Path to ffplay (adjust this line with the path to ffplay.exe)
ffplayPath := "C:FFmpegbinffplay.exe"
; Variable to store the ID of the ffplay process
global ffplayPID
; Function to show the GIF using ffplay
ShowImage() {
global
Run, %ffplayPath% -autoexit -loop 0 -vf "format=rgba" -x 200 -y 200 -noborder -window_title "GifWindow" %ImagePath%,, Hide, ffplayPID
}
; Function to hide the GIF by closing ffplay
HideImage() {
global
if (ffplayPID) {
Process, Close, %ffplayPID%
ffplayPID := ""
}
}
; Detect Caps Lock key press and toggle actions
CapsLock::
capslock_toggle := !capslock_toggle
if capslock_toggle
{
ShowImage() ; Show the GIF
}
else
{
HideImage() ; Hide the GIF
}
Return
enter image description here
I try to convert gif to webm but it doesn’t work either
New contributor
Juan dalton is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.