How can I read a BLOB into a TPicture with a stream ? - 07/22/08 09:41 PM
Hello,
I try to read a blob field into a TPicture component but at a certain point my ideas are a its end...
Can you please give my a hint ?
Thanks
Thomas
I try to read a blob field into a TPicture component but at a certain point my ideas are a its end...
Code
With myquery DO Begin Close; DeleteVariables; SQL.Clear; SQL.Add ('Select mypic from mytable '); SQL.Add ('Where ID = :ID '); DeclareVariable('ID', otInteger); SetVariable('ID',myID); try Execute; If RowCount = 0 THEN Exit; LOB := LOBField('mypic'); if not LOB.IsNull then begin ??? Stream := TMemoryStream.Create; Stream.Position := 0; Pic.Graphic.LoadFromStream(Stream); end; Close; except on e: exception do begin showMessage(e.Message); Close; end; end; end;
Thanks
Thomas