I want to use AutoIt to display a frameless, chrome-less, ~200px square image (jpg, bmp, png - doesn't matter to me) at a specific location on the screen. When the user clicks on it the image is replaced by another of the same size, position, etc. It's like a two-state button. Once I get this part working I'll add an action that results from clicking on the button.
I've adapted some example code to this task but I wonder if there's a better approach. I'm also seeing single-pixel black artifacts in the button images. Note that the bmp images I'm using are 200px by 195px, and the code is supposed to show them at that size. The original bmp's are perfect -- no artifacts, so the black pixels are being introduced by my AutoIt script. Maybe I'm using the wrong bmp format but I've used bmp's from Photoshop before, without probs.
Here's a screen shot example of the tiny black pixels that are introduced in white areas of the image. Any idea why this is happening?
And here's the code.
#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Misc.au3> #include <SendMessage.au3> ;Create a form 10px larger than the button I'm going to display ;Use a blank gray image that's the same size as the above form ;The initial "button" I want to show $MuteState = "mic_off" ;Wait for user to click on my "button" image. While 1 Switch $nMsg Case $GUI_EVENT_CLOSE Case $PicMute ;When the user clicks on the "button this routine toggles between button states and will eventually execute some additional code if $playState="mic_on" $MuteState="mic_on" ;unmute code $MuteState="mic_off" ;mute code Exit 0
Thank you.