unit Main;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, db, sqlite3conn, sqldb, FileUtil, Forms, Controls,
  Graphics, Dialogs, DbCtrls;

type

  { TForm1 }

  TForm1 = class(TForm)
    DataSource1: TDataSource;
    DBImage1: TDBImage;
    DBNavigator1: TDBNavigator;
    SQLite3Connection1: TSQLite3Connection;
    SQLQImageTable: TSQLQuery;
    SQLTransaction1: TSQLTransaction;
    procedure DBImage1DblClick(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.DBImage1DblClick(Sender: TObject);
Var
  FileName: String;
begin
  FileName := IntToStr(SQLQImageTable.RecNo) + '.jpg';
  DBImage1.Picture.SaveToFile(FileName,'jpg');
end;

end.

