unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, jpeg;
type
TForm1 = class(TForm)
image1: TImage;
image2: TImage;
btn1: TButton;
btn2: TButton;
lbl1: TLabel;
procedure btn1Click(Sender: TObject);
procedure btn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btn1Click(Sender: TObject);
var
x, y: Integer;
p: pbytearray;
begin
image2.Height := image1.Picture.Bitmap.Height;
image2.Width := image1.Picture.Bitmap.Width;
for y := 0 to image1.Picture.Bitmap.Height - 1 do
begin
p := image1.Picture.bitmap.ScanLine[y];
for x := 0 to image1.Picture.Bitmap.Width - 1 do
begin
image2.Canvas.pixels[x, y] := rgb(
255 - (p[x * 3] - 4),
255 - (p[x * 3] - 2),
255 - (p[x * 3] - 3));
end;
end;
end;
procedure TForm1.btn2Click(Sender: TObject);
begin
Application.Terminate;
end;
end.


