0

(If you want to reproduce this example, please download Paint.NET from here, it's free and it's got more functions than Microsoft Paint).

When you open Paint.NET, load a simple image and take rectangular selection as instrument.

I've written this simple script:

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

^d::
MouseClickDrag, Left, 365, 434, 906, 460
;You can change mouse coordinates as you wish
Send, ^c
Return

Run it with Ctrl + d.

I'm not able to select the area described by those coordinates, while using the rectangular color filling instrument works fine.

It seems AutoHotkey does not highlight the area if I use the rectangular selector.

Have you got the same issue?

Lisa Ann
  • 3,345
  • 6
  • 31
  • 42
  • 1
    Remove the `SendMode Input` or change it to `SendMode Event`. P.S. If you want to crop images with AHK, I suggest looking into [GDI+](http://www.autohotkey.com/board/topic/29449-gdi-standard-library-145-by-tic/). – MCL Aug 06 '13 at 12:21
  • @MCL, great. You should have made this an answer, not a simple comment :) – Lisa Ann Aug 06 '13 at 12:26
  • I'm glad. There you go. – MCL Aug 06 '13 at 12:34

1 Answers1

1

If SendMode Input doesn't work, Event usually does. Unfortunately, it's not as fast as Input, so playing around with SetKeyDelay may help going against that effect.
However, if you're looking for a way to manipulate images automatically, I recommend using GDI+.

MCL
  • 3,985
  • 3
  • 27
  • 39