Jump to content
Fórum Script Brasil
  • 0

JPEG no banco de dados


Arlon
 Share

Question

O botoinfo abriu um tópico com isso e achei legal se fosse postado aqui também.

JPEG no banco de dados

uses

Windows,Clipbrd , jpeg,Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, Db, DBTables, DBCtrls, Grids, DBGrids, ExtDlgs, StdCtrls, Buttons,

ExtCtrls, OleServer, Word97;

type

TForm1 = class(TForm)

OpenPictureDialog1: TOpenPictureDialog;

DBGrid1: TDBGrid;

Table1: TTable;

DataSource1: TDataSource;

Table1Imagem: TBlobField;

Button2: TButton;

Button3: TButton;

DBImage1: TDBImage;

Button4: TButton;

procedure Button3Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

procedure DBImage1Click(Sender: TObject);

procedure Button4Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button3Click(Sender: TObject);

begin

table1.delete;

end;

procedure TForm1.Button2Click(Sender: TObject);

begin

table1.Edit;

table1.post;

table1.Append;

end;

procedure TForm1.DBImage1Click(Sender: TObject);

var jpg : TJPegImage;

begin

if OpenPictureDialog1.Execute then

begin

jpg := TJpegImage.Create;

jpg.LoadFromFile(OpenPictureDialog1.FileName);

clipboard.Assign(jpg);

DBImage1.PasteFromClipboard;

jpg.Free;

end;

end;

procedure TForm1.Button4Click(Sender: TObject);

begin

close;

end;

end.

// colocar JPEG e Clipbrd na USES.

Qualquer coisa, se não der certo briguem com ele e não comigo, tá!!?? tongue.gif

He, he, brincadeirinha!!

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Forum Statistics

    • Total Topics
      151k
    • Total Posts
      649.1k
×
×
  • Create New...