Jump to content
Sign in to follow this  
nanothief

How to use the function AU3_PixelSearch

Recommended Posts

nanothief

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

Share this post


Link to post
Share on other sites
razer_anthom

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

Share this post


Link to post
Share on other sites
Squirrely1

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

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.