Hey Guys,
I'm having a bit of a hard time finding this function...It's mentioned in the bitmap tutorial. But almost nowhere else..
Is there something I am missing to access it?
Hey Guys,
I'm having a bit of a hard time finding this function...It's mentioned in the bitmap tutorial. But almost nowhere else..
Is there something I am missing to access it?
I believe you have to use something along the lines of:
Simba Code:var
Bmp, x, y: Integer;
i: Extended;
//...
for i := 1 to 360 do
begin
if FindBitmap(Bmp, x, y) then
begin
//...
end else
RotateBitmap(Bmp, i);
end;
or
Simba Code:var
Bmp, x, y: Integer;
i: Extended;
//...
i := 0;
repeat
if FindBitmap(Bmp, x, y) then
begin
//...
end else
begin
IncEx(i, 2);
RotateBitmap(Bmp, i);
end;
end;
to do what you're looking for.
Last edited by Runaway; 05-30-2012 at 12:32 AM.
FindBitmapRotated was a scar function that is not in simba, the tutorial you were following was probably for scar
Simba Code:Function FindBitmapRotated(var X, var Y: Integer; Bitmap, Tolerance: Integer; Area: TBox): Boolean;
var
I: Integer;
begin
For I:= 0 To 359 Do
begin
Result:= FindBitmapToleranceIn(Bitmap, X, Y, Area.X1, Area.Y1, Area.X2, Area.Y2, Tolerance);
If Result then
Break;
Bitmap:= RotateBitmap(Bitmap, 1);
end;
end;
I'm not on a proper computer to test that but theoretically it should be identical.. I hope :S
I am Ggzz..
Hackintosher
in this case in radians
I don't know if this works with angles != PI/2 * k , because then bitmap looks like:
,so black background becomes part of bitmap. It may work ,if bitmap finding function ignores clBlack.
And every new rotated bitmap is rectangle ,so if you rotate same bitmap multiple times at non 90 degree ,size of canvas will increase geometrically. Run this to understand ,what I'm talking about ,because it's hard to explain in english:
Simba Code:program new;
{$i srl/srl.simba}
{$I srl/srl/misc/debug.simba}
var
bmp ,a : integer;
begin
bmp := CreateBitmap(50,50);
FastReplaceColor(bmp,0,clred);
for a:= 0 to 9 do
begin
FastReplaceColor(bmp,0,a*2560);
debugbitmap(bmp);
wait(1000);
bmp := RotateBitmap(bmp,Radians(30));
end;
end.
Last edited by bg5; 05-31-2012 at 10:23 PM.
Tuts: Run script from another script || [Lape] Exceeding limits of VariantInvoke()
Plugins: Fast multi-layer objects finding || Multithreading in tabs|| Optimised motion detection || ETL - paint on any window||Magic Keyboard (Simba's DirectX input + input in background to any normal window)
Snippets: [RS] Ultimate Loot Grabber || ShowPalette() || APPA JS Interface
btw.
If you ever gonna try to iterate same bitmap throught 360 degree
you will be eaten by
salad monster:Simba Code:program new;
{$i srl/srl.simba}
{$I srl/srl/misc/debug.simba}
var
bmp ,bmp2 ,a : integer;
begin
bmp := CreateBitmap(50,50);
FastReplaceColor(bmp,0,clred);
for a:= 0 to 170 do
begin
FastReplaceColor(bmp,0,a*2560);
debugbitmap(bmp);
bmp2 := RotateBitmap(bmp,Radians(1));
Freebitmap(bmp);
bmp := bmp2;
end;
end.
Tuts: Run script from another script || [Lape] Exceeding limits of VariantInvoke()
Plugins: Fast multi-layer objects finding || Multithreading in tabs|| Optimised motion detection || ETL - paint on any window||Magic Keyboard (Simba's DirectX input + input in background to any normal window)
Snippets: [RS] Ultimate Loot Grabber || ShowPalette() || APPA JS Interface
There are currently 1 users browsing this thread. (0 members and 1 guests)