unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtDlgs, ExtCtrls, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Image1: TImage; OpenPictureDialog1: TOpenPictureDialog; Button2: TButton; SaveDialog1: TSaveDialog; OpenDialog1: TOpenDialog; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; type TRGBArray= ARRAY[0..0] OF TRGBTriple; pixel = ^TRGBArray; var Form1: TForm1; txt : TextFile; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var i,j,larg,haut:integer; C:Tcolor; image:string; begin if openpicturedialog1.execute then begin Image1.Picture.LoadFromFile(openpicturedialog1.Filename); end; Larg:=Image1.Picture.Bitmap.Width; haut:=Image1.Picture.Bitmap.Height; if SaveDialog1.Execute then begin AssignFile(txt,saveDialog1.FileName); Rewrite(txt); for i:=1 to larg do begin for j:=1 to haut do begin C:=Image1.Picture.Bitmap.Canvas.Pixels[i,j]; WriteLn(txt,C); end; end; CloseFile(txt); end; end; procedure TForm1.Button2Click(Sender: TObject); begin close; end; end.