Janilabo Posted May 22, 2012 Share Posted May 22, 2012 Counts unmatched colors in area (XS, YS, XE, YE). Example included. CountUnmatchedColors [scar]function CountUnmatchedColors(color, XS, YS, XE, YE: Integer): Integer; begin if (XS > XE) or (YS > YE) then Exit; Result := ((((XE - XS) + 1) * ((YE - YS) + 1)) - CountColor(color, XS, YS, XE, YE)); end; var W, H: Integer; begin SetDesktopAsClient; GetClientDimensions(W, H); WriteLn('Count of white colors in screen: ' + IntToStr(CountColor(16777215, 0, 0, (W - 1), (H - 1)))); WriteLn('Count of other colors in screen: ' + IntToStr(CountUnmatchedColors(16777215, 0, 0, (W - 1), (H - 1)))); end.[/scar] Quote Link to comment Share on other sites More sharing options...