From: KingKong
because we need the number of black pixels in the lower half of the item, ^ gives all of them, and yeah the B.Y1 should be what you said.
I ment replacing this with the ColorCount.
FindColorsTolerance(TPA, srl_outline_black, B.X1, B.Y1, B.X2, B.Y2, 0);
Result := Length(TPA);
like
function HalfBlackCountAt(Slot: integer): integer;
var
B: TBox;
begin
B := InvBox(Slot);
IncEx(B.Y1, (B.Y2 - B.Y1) div 2);
Result := CountColor(srl_outline_black, B.X1, B.Y1, B.X2, B.Y2);
end;
Does the item count really take up half of the item? Wouldn't getting the bottom 2/3 or 3/4 black of the item be better?