unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtDlgs, StdCtrls, Buttons, ExtCtrls,jpeg;

type
  //tbmp=array of TBitmap;
  TForm1 = class(TForm)
    Image1: TImage;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    OpenPictureDialog1: TOpenPictureDialog;
    Image3: TImage;
    procedure FormCreate(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
  private
  index:integer;
//  tab:tbmp;
     { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  tab: array[0..100]of TBitmap;
  //index: integer;
implementation

{$R *.dfm}

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
 OpenPictureDialog1.InitialDir:=GetCurrentDir;
 if Openpicturedialog1.Execute then
 begin
   Image1.Picture.LoadFromFile(Openpicturedialog1.FileName);
   tab[index]:=TBitmap.Create;
   tab[index].Assign(Image1.Picture.Bitmap);
   inc(index);
 end;
end;

procedure TForm1.BitBtn2Click(Sender: TObject);
const i:integer=0;
begin
   Image3.Picture:=nil;
   Image3.Picture.Bitmap.Assign(tab[i]);
   i:=(i+1)MOD index;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
//index:=0;
//Setlength(tab,10);
end;

end.
