Jump to content

Point Plotter


Recommended Posts

K so I want to make a program that will allow me to click on certain points and it places a little marker picture where I clicked. Then when I hit m it removes the markers from view but then when I hit m again it brings them back. Finally to remove a marker from memory you right click it.

Im not sure exactly where to start or if autoit can even achieve this. Any help would be greatly appreciated.

Link to comment
Share on other sites

I think I could figure alot of it out myself If I knew how to display a picture in a select location. If anyone could post an example of that, it would be awesome!

Create a 10x10 bitmap with MS Paint, grab Auto3Lib from my signature and run this:

#include <A3LLibrary.au3>
#include <GUIConstants.au3>

$hGUI = GUICreate("Marker Demo", 400, 300)
GUISetState()

while 1
  Switch GUIGetMsg()
    case $GUI_EVENT_PRIMARYDOWN
      $tPoint = _Lib_GetMousePos(True, $hGUI)
      GUICtrlCreatePic(@ScriptDir & "\Marker.bmp", _tagGetData($tPoint, "X"), _tagGetData($tPoint, "Y"), 10, 10)
    case $GUI_EVENT_CLOSE
      ExitLoop
  EndSwitch
wend
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

I've never done any #includes in my script before. I pasted all the stuff from the include folder I dled into the include folder in program files. After doing this it gives me an error whenever I try to run your script.

"Line 290 (File "C:\Program Files\Autoit3\Include\A3lWinAPI.au3"):

case 0

Error: "Case" statement with no matching "Select" statement."

Did I paste it in the wrong place? Or install it wrong?

Link to comment
Share on other sites

I've never done any #includes in my script before. I pasted all the stuff from the include folder I dled into the include folder in program files. After doing this it gives me an error whenever I try to run your script.

"Line 290 (File "C:\Program Files\Autoit3\Include\A3lWinAPI.au3"):

case 0

Error: "Case" statement with no matching "Select" statement."

Did I paste it in the wrong place? Or install it wrong?

Create a 10x10 bitmap with MS Paint, grab Auto3Lib from my signature and run this:

Edited by PaulIA
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

I DID grab the auto3lib from your signature. And this is the error im recieving now.

Notice Line 290 (File "C:\Program Files\Autoit3\Include\A3lWinAPI.au3") is a autoit script inside the library....

Do you have the latest release of AutoIt, because the error you're reporting doesn't make sense. That line is in the middle of a Switch statement, not a Select statement. Edited by PaulIA
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

I installed the current version and now it works correctly but how would I make it so that the whole thing is an overlay of another window.. I guess I could start by trying to make the grey part transparent. But how.

Edited by rejectpenguin
Link to comment
Share on other sites

I installed the current version and now it works correctly but how would I make it so that the whole thing is an overlay of another window.. I guess I could start by trying to make the grey part transparent. But how.

There are a lot of different ways to do this, so you'll have to experiment. You can create a background by having a GUICtrlCreatePic that covers your whole window and then use the code that I wrote to place the markers on top of this picture. You could get fancy and paint the background picture by trapping the GUI paint notification messages.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...