Phantom Documentation

[Help Home] [Phantom Home]
Find

bool bitmap.Find(int,int,bitmap)

Return Type: bool
Parameters:
int X - X pixel location to start search (modified)
int Y - Y pixel location to start search (modified)
bitmap B
- The bitmap to search for

Description:

This function looks for an occurence of the parameter bitmap B in the bitmap contained by this variable. The function will do a pixel by pixel comparison, and if bitmap B is found, the function will return true. The function will return false otherwise.

The X and Y are zero-based pixel indices indicating where in the bitmap searching should begin. If the bitmap B is found, these values are updated with the location of the lower-left corner of B's location. Therefore, the value of X and Y are modified by this function. As such, the parameters to this function must be variables, and not constants.
If the bitmap is not found, the X and Y parameters are not modified.

X and Y are zero based pixel locations, with 0,0 representing the lower left corner of the bitmap.
Example Code

bitmap a;
bitmap b;

a.Load("my_bitmap_a.bmp");
b.Load("my_bitmap_b.bmp");

a.Find(0,0,b); # --> Not OK
int i = 0;
int j = 0;
a.Find(i, j, b); # --> OK

disp(i); # New value
disp(j); # New value


For an example, see the bitmap variable page.




Copyright 2000-2011 Phantom Automated Solutions