Is it possible to darken an image within a TImage in Delphi ??? Is there any component, something similar to do this? The program puts the image, and I need to darken it right after it is inserted ...
Is it possible to darken an image within a TImage in Delphi ??? Is there any component, something similar to do this? The program puts the image, and I need to darken it right after it is inserted ...
Face You Can Convert to Bitmap and Move the pixel array pixel to pixel by changing the value of in RGB Proportionally, There may be one component but I do not know and another that installing many components is not legal, projects can be discontinued and some methods you can migrate from version to version.
function TForm1.GrayScale (Imagem : TBitmap) : TBitmap;
var Gray : TBitmap;
i, j : Integer;
Pixel : TColor;
GrayScale : Integer;
Red, Green, Blue : Double;
begin
Gray := TBitmap.Create;
Gray.Height := Imagem.Height;
Gray.Width := Imagem.Width;
for i := 0 to Imagem.Height do
begin
for j := 0 to Imagem.Width do
begin
Pixel := Imagem.Canvas.Pixels[j,i];
Red := GetRValue(Pixel);
Green := GetGValue(Pixel);
Blue := GetBValue(Pixel);
GrayScale := Trunc((Red * 0.3) + (Green * 0.59) + (Blue * 0.0011));
Gray.Canvas.Pixels[j,i] := RGB(Byte(GrayScale), Byte(GrayScale), Byte(GrayScale));
end;
end;
Result := Gray;
end;
This Example code changes to grayscale to arrive at the hue you want you can change the values that multiply the RGB.