Jump to content

How to use the function AU3_PixelSearch


nanothief
 Share

Recommended Posts

The definition of AU3_PixelSearch is:

AU3_API void WINAPI AU3_PixelSearch(long nLeft, long nTop, long nRight, long nBottom, long nCol, /*default 0*/long nVar, /*default 1*/long nStep, LPPOINT pPointResult);

I tried using it like this:

CODE

#include <windows.h>

#include <AutoIt3.h>

#include <stdio.h>

int main() {

LPPOINT point;

AU3_PixelSearch(10,10,1000,1000, 0xFF0000, 0, 1, point);

printf("%d", point->x);

return 0;

}

I then compiled it with:

gcc test.c -lAutoItX3

However this causes a segmentation fault. Removing the printf line results in the same error. Also, whether the color is inside the region or not makes no difference.

What is the correct way of using AU3_PixelSearch? (an example would be nice :D)

I'm using version 3.2.10

Link to comment
Share on other sites

It is a C question, dont declare e POINTER to POINT (LPPOINT), but a POINT then pass the

reference as parameter... Try:

#include <windows.h>
#include <AutoIt3.h>
#include <stdio.h>
int main() {
POINT point;   // <===== HERE
AU3_PixelSearch(10,10,1000,1000, 0xFF0000, 0, 1, &point);  // <===== AND HERE
printf("%d", point->x);

return 0;
}
Edited by razer_anthom
Link to comment
Share on other sites

  • 2 weeks later...

Yeah, now you guys are talkin': the man is not the message, and the message is not the man - don't declare the pointer as the point.

Instead the point is always the Point.

Edited by Squirrely1

Das Häschen benutzt Radar

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...