SRL Archive - Help and Support

Bitmap Help Please?


Avaphi

2006-06-19 16:06:49

Hey there srl peeps… I am currently making a script, yet I am having a little trouble. It seems to me that I can never use DTM's consitently on the MM. As in It will work in one world, but not the next. So I was thinking I could Use a Bitmap, But what function would be the best to find it, on EVERY World change situation? Thanks Alot… db :confused:

realrune

2006-06-19 16:15:21


function FindDeformedBitmapToleranceIn(bitmap: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; tolerance: Integer; Range: Integer; AllowPartialAccuracy: Boolean; var accuracy: Extended): Boolean; - Works similar to FindBitmapToleranceIn but allows searching for partially covered or transformed bitmaps. If range is 0, it checks pixels at positions that match bitmap we are looking for; if Range ir 1, it checks neighbor pixels as well, if range is bigger, it checks further. AllowPartialAccuracy allows accuracy that is not 100% match. accuracy returns accuracy of found bitmap to bitmap we are looking for. accuracy = 1.0 means it was 100% perfect match.

function FindDeformedBitmapToleranceRotationIn(bitmap: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; tolerance: Integer; Range: Integer; var accuracy: Extended; AngleIntervals: Extended; StartAngle, MaxAngle: Extended; var angle: Extended): Boolean; - Works similar to FindDeformedBitmapToleranceIn but allows searching for rotated bitmaps as well. Basically it rotates bitmap, searches in target image, then rotates again, searches again. AngleIntervals specifies by how much it rotates every time, StartAndge specifies initial rotation angle, MaxAngle specifies how far it rotates and angle returns angle of found image. All angles are specified in radians (Pi = 180˚)
Example: FindDeformedBitmapToleranceRotationIn(minimaptree, x, y, 582, 37, 700, 117, 170, 0, acc, PI/10, 0, 2*PI, angle);

One of those two would be the best option. If unsure on how to use, check symbol.scar and getsymbolcolor. (it uses the first option I think…)