procedure SetAlpha(const Image: TImageData; const Alpha: Word);
var
Data: PByte;
I: Integer;
begin
with Image do
Data := @PColor32Rec(Bits)^.A;
for I := 0 to Image.Size div 4 - 1 do
begin
Data^ := Alpha;
Inc(Data, 4);
end;
end;
Form1.Color := clGreen;
FImage1 := TMultiImage.Create;
FBitmap1 := TImagingBitmap.Create;
Image1.Picture.Graphic := FBitmap1;
FImage1.LoadFromFile('Tigers.jpg');
FImage1.Format := ifA8R8G8B8;
SetAlpha(FImage1.ImageDataPointer^, 0);
Image1.Picture.Graphic.Assign(FImage1);
Image1.Picture.Bitmap.Canvas.Pen.Color := clWhite;
Image1.Picture.Bitmap.Canvas.Line(1, 1, 200, 200);
procedure TForm1.FormCreate(Sender: TObject);
begin
Form1.Color := clBlack;
FImage1 := TSingleImage.Create;
FBitmap1 := TImagingBitmap.Create;
Image1.Picture.Graphic := FBitmap1;
FImage1.LoadFromFile('Tigers.jpg');
Image1.Picture.Graphic.Assign(FImage1);
Image1.Picture.Bitmap.Canvas.Pen.Color := clWhite;
Image1.Picture.Bitmap.Canvas.Line(0, 0, 200, 200);
end;
Page created in 0.010 seconds with 19 queries.