unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Bit: TImage;
Beenden: TButton;
Button1: TButton;
procedure MakeRed(Bit: TBitmap);
procedure BeendenClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.MakeRed(Bit: TBitmap);
type
PixArray = Array [1..3] of Byte;
var
p: ^PixArray;
h,w: Integer;
begin
For h:=0 to Bit.Height-1 do
begin
p:= Bit.ScanLine[h];
For w:=0 to Bit.Width-1 do
begin
p^[3]:=255;
Inc(p);
end;
end;
end;
procedure TForm1.BeendenClick(Sender: TObject);
begin
close;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
MakeRed(Bit: TBitmap);
end;
end.