Ask: How will. Jpg picture into parabox database? Thank you!

Category: Delphi -> Database Author: weimeng509 Date: 2001-07-09 13:59:32
 
weimeng509
2001-07-09 13:59:32
Bmp format can only save, jpg format not.
ycjhlxp123
2001-07-09 14:11:55
I am sure it can.
table1.edit;
DBImage1.Picture.LoadFromFile ('c: \ blank.jpg' );
DBImage1.CutToClipboard;
DBImage1.PasteFromClipboard;
table1.post
to sub it.

firstct
2001-07-09 14:19:25
procedure saveimage;
Var
BlobStream: TBlobStream;
JpegImage: TJpegImage;
begin
try
with yourtable do
try
JpegImage: = TJpegImage.Create;
BlobStream: = TBlobStream.Create (TBlobField (FieldByName, 'fieldname')), bmWrite);
; BlobStream.Position: = 0;
/ / BlobStream.Truncate;
JpegImage: = TJpegImage (yourform.image1 . Picture.Graphic);
JpegImage.SaveToStream (BlobStream);
finally
if Not Assigned ( BlobStream) then BlobStream.Free;
if Not Assigned (JpegImage) then JpegImage.Free;
end;
except
end;
end;
Note: Do not forget referenced jpeg unit
jacklong77
2001-07-09 14:25:53
YourTable1.Edit ;
TBlobField (YourTable1.FieldByName ('Image'). LoadFromFile ('Hello.jpg');
YourTable1.Post;
sfefn
2001-07-09 14:44:31
var
stream ;: TMemoryStream;
begin
try
stream: = TMemorystrema.Create;
stream.loadFilename ('c : \ hello.jpg ')
table1.append;
(table1.Fieldbyname (' image ') as tblobField). LoadStream (stream);
table1.post
finally
stream.Free;
end;
end;
hbhdljx
2001-07-09 14:49:34
The above two are
Another way is
picture: Tpicture;
picture: = loadpicture ("c: \ ma.jpg");
YourTable1 . FieldByName ('Image'). value = Assign (picture);
about this
chalai
2001-07-09 15:03:13
Ask you, or not, bmp format.
wsx851203
2001-07-09 15:19:51
whether To jpg to bmp?
wu825385605
2001-07-09 15:26:28
Do you want to format conversion?
yunshangting
2001-07-09 15:46:09
under uses in the interface by adding jpeg unit, I think we did not talk about bad, is not you forget to refer to this unit of?
a346870238
2001-07-09 15:57:34
Thank you, brother upstairs, thank you!