There is no problem 'you just mixed up things
procedure TForm1.Button1Click(Sender: TObject);
var A :mas;
img:Tbitmap;
x,y :integer;
begin
img:=tbitmap.Create;
img.LoadFromFile('2.bmp');
ShowMessage(inttostr(img.RawImage.Description.BitsPerPixel));
// test 1: (Verify the existence of the Blue);
for x := 0 to Img.Width-1 do
for y := 0 to Img.Height-1 do
begin
if ((Img.Canvas.Pixels[x,y] shr 16 )shl 16 ) = clBlue then
ShowMessage('There are blue in the pixel .. but mixed with other colors RG :in '
+inttostr(x)+'|'+inttostr(y)) ;
end ;
// test 2: (hue);
{
for x := 0 to Img.Width-1 do
for y := 0 to Img.Height-1 do
begin
if ((Img.Canvas.Pixels[x,y] shr 16 ) > 0) and ((Img.Canvas.Pixels[x,y] shr 16 ) < 255) then
ShowMessage('There are blue hue But not the maximum value ' +inttostr(x)+'|'+inttostr(y)) ;
end ;
}
{
///test 3: Check this condition , Only when ff0000 ,White is FFFFFF And not FF0000
///
for x := 0 to Img.Width-1 do
for y := 0 to Img.Height-1 do
begin
if Img.Canvas.Pixels[x,y] = clBlue then
ShowMessage('There is the color blue , Without other colors' +inttostr(x)+'|'+inttostr(y)) ;
end ;
}
end;
clBlack is FF0000 ≠ FFFFFF