R0b0t1
2007-12-01 00:19:17
I want to find a bitmap (This is for another language). I need to know how to do it.
My Idea: Check if the first pixel matches on on the screen, if it does, check the other pixels by it… But I still don't exactly know how to do this.
n3ss3s
2007-12-01 02:44:59
=/
Like,
GetBitmapSize(bmp, W, H);
X := Round(W / 2);
Y := Round(H / 2);
Then get the color of mid with something like FastGetPixel(bmp, X, Y)
Then, you need just couple for loops :)
The Claw
2007-12-01 03:22:59
Well a bitmap is a bunch of points in relation to a whole heap of other points, right? So I guess you would have to do a find colors tolerance of the colour thats at the starting point of your bitmap (center, top left, your choice) on the whole screen. Then for every one of those points, check if the pixel to the left of it or right or whatever matches what your bitmap does. If it does, save it to a TPA, if it doesnt, forget about it. Then for every point in that TPA, check if another point in relation to the center point matches. Save all positive to another TPA. Continue, until you either have no points in the TPA, or until you have found the bitmap :)
n3ss3s
2007-12-01 03:51:55
Remember he said other language :)
FindColorsSpiralTolerance does not exist there :)
Wizzup?
2007-12-01 04:05:14
From: R0b0t1
I want to find a bitmap (This is for another language). I need to know how to do it.
My Idea: Check if the first pixel matches on on the screen, if it does, check the other pixels by it… But I still don't exactly know how to do this.
Yes… thats the way to do it.
You could make your own type. A bitmap is just an array of array of color.
Markus
2007-12-01 07:05:47
Some pseudocode:
[php]
function findbitmap(bmp Bitmap, int X, Y) bool {
int XMod, YMod, Cx, Cy;
bool Found;
begin loop
if (bmp.pixels[xmod, ymod] = screen.pixels[cx+xmod, cy+ymod]) then
if (xmod > bmp.width) then do
xmod = 0
ymod++
else
xmod++
found = true
else
xmod = 0
ymod = 0
found = false
if not found then
if cx > screen.width then
cx= 0
cy++
else
cx++
until(cx>screen.width) and (cy > screen.width)[/php]
R0b0t1
2007-12-01 13:02:10
Actually, its in C++, and I have made color-finding functions for it :)
Thanks for the ideas!
EDIT: I'm trying to make something like cruel lib