Subject | Re: [IBO] Blob-jpeg issues |
---|---|
Author | Maik Wojcieszak |
Post date | 2003-01-06T10:44:08Z |
Ryan,
I think I can help you with you problem, but I think it's
more an imaging problem then an IBObjects problem.
As I understand you can write a raw jpeg file into a blob
field.
How do you convert the jpeg into a bitmap for TImage.
As I remember TImage cannot display jpegs directly.
To get the raw data from the database use
TIB_Query.CreateBlobStream(TIB_Query.FieldByName('PIC'), bmRead);
and then load the Data with the LoadFromStream method of the displaying
component. Make sure that the displaying component can identify
and decode a raw jpeg stream. Otherwise convert the data with
apropriate tools into a suitable format.
hope that'll help
maik
I think I can help you with you problem, but I think it's
more an imaging problem then an IBObjects problem.
As I understand you can write a raw jpeg file into a blob
field.
How do you convert the jpeg into a bitmap for TImage.
As I remember TImage cannot display jpegs directly.
To get the raw data from the database use
TIB_Query.CreateBlobStream(TIB_Query.FieldByName('PIC'), bmRead);
and then load the Data with the LoadFromStream method of the displaying
component. Make sure that the displaying component can identify
and decode a raw jpeg stream. Otherwise convert the data with
apropriate tools into a suitable format.
hope that'll help
maik
On Mon, 06 Jan 2003 10:22:52 -0000, "Ryan Nilsson-Harding" <nilsson@...> wrote:
>Hi there,
>
>I'm trying to have a jpg graphic field (blob) stored in my db. I've
>read through this and a couple of other newsgroups and I'm on my
>way, but have a coule of questions.
>
>I can save the jpg into my db using:
> tib_query.Params[0].LoadFromFile(filename);
>
>but I cannot display the image in a TImage component successfully.
>(I'm trying to display it in the AfterScroll event of the dataset)
>
>I understand I need to stream the blob data into the TImage, but
>their doesn't seem to be a
>TIB_Query.FieldByName('PIC').SaveToStream method,
>as I have seen suggested elsewhere.
>
>I know I can use
>TImage.Picture.SaveToFile, and then load this temp file into the
>TImage, but this seems excessive to me.
>
>I have a feeling I'm missing something small here, but I'm not too
>familiar with streams yet, and I'm kinda stuck without one!
>
>Is there a tib_query.FieldByName('PIC').SaveToStream method, or
>something similar?
>
>Rgds,
>-Ryan
>
>
>
>___________________________________________________________________________
>IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
>___________________________________________________________________________
>http://www.ibobjects.com - your IBO community resource for Tech Info papers,
>keyword-searchable FAQ, community code contributions and more !
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
-------------------------------------------------
Maik Wojcieszak
wobe-team (http://www.wobe-team.com)