SRL Archive - Discussions and Debates

Biggest Issue With Scar


Metagen

2009-06-02 18:38:14

Hey guys. I hope freddy takes a peek at this. I suggest that a function is made in scar that returns a block of color. Allow me to explain.

The findcolor method is much much faster per pixel than the getcolor method. Im not sure exactly how freddy does things, But it's probably because you need to bitblock transfer 1 pixel and get hwnd and dc and bmp for dc and yada yada. all for one measly pixel

So what if someone wants to do complex calculations? like find every disconnected block of color on the screen? Or anything that you need the array of pixels for?

Using getColor is ineffective for this purpose.

So freddy may i suggest you consider the idea?

Edit: oh and the biggest issue thing… thats just for me, i like to do complicated color functions.

nielsie95

2009-06-02 19:17:29

Something like GetBitmapAreaColors or GetColors?

Naum

2009-06-02 19:22:53

GetColorsBox and not ClearSameIntegers?

Metagen

2009-06-02 19:27:18

Wooo wait what?

Sir R. M8gic1an

2009-06-02 19:55:58


{*******************************************************************************
function GetColorsBox(x1, y1, x2, y2: Integer; ClearSameColors: Boolean): TIntegerArray;
By: Rasta Magician
Description: Returns an array of all colors within box ((x1, y1), (x2, y2)).
If ClearSameColors is set to True, all duplicate colors will be deleted.
*******************************************************************************}
function GetColorsBox(x1, y1, x2, y2: Integer; ClearSameColors: Boolean): TIntegerArray;
begin
Result := GetColors(TPAFromBox(IntToBox(x1, y1, x2, y2)));
if ClearSameColors then
ClearSameIntegers(Result);
end;

rev #33 ;)

~RM

Metagen

2009-06-02 20:31:26

Not useful. As i said previously, getcolor is too slow. I've never seen ClearSameColors before however… what be this?

I'm going to check into all these mentioned functions

senrath

2009-06-02 20:35:27

From: Metagen
Not useful. As i said previously, getcolor is too slow. I've never seen ClearSameColors before however… what be this?

I'm going to check into all these mentioned functions


ClearSameColors just tells the function to call ClearSameIntegers on the array of colors. I don't think it's a separate function at all.

Wizzup?

2009-06-03 00:44:39

From: Metagen
Not useful. As i said previously, getcolor is too slow. I've never seen ClearSameColors before however… what be this?

I'm going to check into all these mentioned functions


GetColor is slow because for every call you have to copy the client. GetColors only does one client copy, and then returns the array of colours. A lot faster.