unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Image1: TImage;
    Image2: TImage;
    Button1: TButton;
    RB1: TRadioButton;
    RB2: TRadioButton;
    Button2: TButton;
    OpenDialog1: TOpenDialog;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
b,a:integer;
begin

if RB2.checked then begin
image2.width :=1;
image2.height:=100;
for b :=image1.width downto 1 do
for a:=1 to 100 do begin
image2.canvas.pen.color := image1.canvas.pixels[b,a];
image2.canvas.moveto(1,a-1);
image2.canvas.lineto(-1,a-1);
image2.picture.savetofile('Tex'+inttostr(image1.width+1-b)+'.bmp');
end;
end;

if RB1.checked then begin
image2.width :=100;
image2.height:=1;
for b :=image1.height downto 1 do
for a:=1 to 100 do begin
image2.canvas.pen.color := image1.canvas.pixels[a,b];
image2.canvas.moveto(a-1,1);
image2.canvas.lineto(a-1,-1);
image2.picture.savetofile('Tex'+inttostr(image1.height+1-b)+'.bmp');
end;
end;


end;


procedure TForm1.Button2Click(Sender: TObject);
begin
if OpenDialog1.Execute then
image1.picture.loadfromfile(OpenDialog1.FileName);
end;

end.
