Re:JPG-Pictures save into PDOX7-Table
Hi Art,
Thanks for your help.
I have searched http://www.mers.com for old entries from this newsgroup
(Theme: JPG and JPEG).
From 60 Answers I have no more found as your last tip.
Art Begun <beg...@mindspring.com> schrieb in im Newsbeitrag:
833tnp$c...@forums.borland.com...
Quote
> If you search the last couple weeks under my
> name, or JPEG or jpg, you should
> find everything you need if this doesn't solve
> your problem. don't us dbImage
> Use a binary field.
yes, I use Table1.fieldbyName('B') - and Form1.TImage1
Quote
> To save a file to a blob see the TblobField.loadfromFile method
1. I read a 24Bit-JPG-File into Blobfield:
procedure TProdukteForm.Button2Click(Sender: TObject);
begin
if opendialog1.execute then begin
with Table1 do begin
insert;
(fieldbyName('B') as TblobField).loadFromFile(OpenDialog1.filename);
post;
end;
end;
end;
2. Now I will place the Picture on Form1.Image1 :
procedure TProdukteForm.Button3Click(Sender: TObject);
var
MS: TMemoryStream;
J1: TJPEGImage;
begin
if Table1.Fieldbyname('B').isnull then exit;
J1 := TJPEGImage.Create;
MS := TMemoryStream.Create;
try
TBlobField(Table1.Fieldbyname('B')).SaveToStream(MS);
MS.Seek(soFromBeginning, 0);
with J1 do begin
PixelFormat := jf24Bit;
Scale := jsFullSize;
Grayscale := False;
Performance := jpBestQuality;
ProgressiveDisplay := True;
ProgressiveEncoding := True;
LoadFromStream(MS);
end;
{ Problempoint
the following command brings every time
'....Error: read from Address FFFFFFFF': }
Image1.Picture.Graphic.Assign(J1);
finally
J1.Free;
MS.Free;
end;
end;
How can I solve this problem?
Best Regards
Kurt.