www.pudn.com > Desktop-Manager.rar > Unit6.pas, change:2004-06-01,size:1259b


unit Unit6; 
 
interface 
 
uses 
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 
  Dialogs, StdCtrls,JPEG; 
 
type 
  TForm6 = class(TForm) 
    Label1: TLabel; 
    Edit1: TEdit; 
    Button1: TButton; 
    Button2: TButton; 
    procedure Button1Click(Sender: TObject); 
    procedure Button2Click(Sender: TObject); 
  private 
    { Private declarations } 
  public 
    { Public declarations } 
  end; 
 
var 
  Form6: TForm6; 
 
implementation 
uses unit1; 
{$R *.dfm} 
 
procedure TForm6.Button1Click(Sender: TObject); 
var 
  JPEG:TJPEGImage; 
begin 
  Form1.ADOQuery1.Active:=True; 
  Form1.ADOQuery1.SQL.Clear; 
  Form1.ADOQuery1.SQL.Text:='select * from pictures where filename like '+'''%'+Edit1.Text+'%'''; 
  Form1.ADOQuery1.Open; 
/////////////////////////////// 
//ˢimage1еͼƬ 
  JPEG:=TJPEGImage.Create; 
  try 
    if Form1.DataSource1.DataSet.FieldByName('picture').IsNull=false then 
    begin 
      JPEG.Assign(Form1.DataSource1.DataSet.FieldByName('picture')); 
      Form1.Image1.Picture.Assign(JPEG); 
    end 
    else 
      Form1.Image1.Picture.Assign(nil); 
  finally 
    JPEG.Free; 
    close; 
  end; 
end; 
 
procedure TForm6.Button2Click(Sender: TObject); 
begin 
  close; 
end; 
 
end.