Kandor Posted August 13, 2013 Share Posted August 13, 2013 Hey all, Is it possible to have FindBitmap only return true if the bitmap is at (or between) a set of coordinates? Or is there an alternative to find a bitmap on the screen where there are more than one present. Many thanks, Quote Link to comment Share on other sites More sharing options...
Janilabo Posted August 14, 2013 Share Posted August 14, 2013 Hey Kandor, you could use FindBitmapEx() which stores ALL found bitmap results (from area) to a TPointArray. Quote Link to comment Share on other sites More sharing options...
Kandor Posted August 14, 2013 Author Share Posted August 14, 2013 Hey Kandor, you could use FindBitmapEx() which stores ALL found bitmap results (from area) to a TPointArray. Any pointers on how to use FindBitmapEx()? This is how I assume you use it: FindBitmapEx(tpa,bmp,X1,Y1,X2,Y2) tpa = TPointArray bmp = Bitmap X1,Y1 - X2,Y2 = coorindates between Quote Link to comment Share on other sites More sharing options...
slacky Posted August 15, 2013 Share Posted August 15, 2013 (edited) That is correct. But you have got to covered area ("coorindates between") reversed. Should be: X2-X1, and Y2-Y1. Anyways.. a working example could look like this: var xs,ys,xe,ye,AreaX,AreaY,i: Integer; bmp: TSCARBitmap; TPA:TPointArray; found: Boolean; begin bmp := TSCARBitmap.create('deNoB6wAU/wsABwB0qvl3q/l7rvl5rfl3q/mCs' + 'fmKtviRuvi20Pi50vf+/v6awfmixvmszPmqy/msy/muzPmqyfiryvjR4fjU4vf' + '7/v6PtLGryNLG2/nI2/nT4vnJ3fnG2fnN3vjT4vjb5vj4/Pxql4J0oY6vyc/X5' + 'PbU4vfV4/jX5PnX5Pnc5/nj7Pn1/PxYg3leiX9pk4p0npeJrKyZub2lw8mtytK' + '91eDS4vDy+vppjLFtkLZ0l75+oMaJrNKVuN2hxeisz/C12fa63/rw+flukLdzl' + 'bx5nMOAo8qIq9KQs9yZveShxO2ozPSt0vnu+PhDGLJk'); XS := 20; YS := 20; XE := 900; YE := 200; AreaX := XE-XS; //If you need (just to demonstrate as you had it reversed) AreaY := YE-YS; //... Found := FindBitmapEx(TPA, bmp, XS,YS, XE,YE); // You can put this INSIDE the if-statement. if Found then for i := 0 to high(TPA) do begin XE := TPA[i].X + bmp.width; YE := TPA[i].Y + bmp.height; WriteLn('Found Image at: ' + PointToStr(TPA[i]) +', ' +PointToStr(Point(XE, YE))); end; end. Edited August 15, 2013 by slacky Quote Link to comment Share on other sites More sharing options...