Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread blobfield.LoadFromStream error
Tue, Feb 9 2010 5:15 PMPermanent Link

"Eric Schwarz"
This is driving me crazy because I know I've done this in the past.

I'm trying to load a blob field with a jpg image via a memory stream.

Image.LoadFromFile
Image.SaveToMemoryStream(Stream)
Blob.LoadFromStream(Stream)

An EInvalidGraphic "Bitmap image is not valid" exception is thrown on the
LoadFromStream.  What's going on here?  I thought you can load anything into
a blob field?

4.29 under Delphi2010

Tue, Feb 9 2010 5:58 PMPermanent Link

"Walter Matte"
Off the top of my head...don't you have to Position the Stream ... or isn't
there a Blob.LoadFromFile ....  I didn't research...

Walter



Image.LoadFromFile
Image.SaveToMemoryStream(Stream)

Stream.Position := 0;

Blob.LoadFromStream(Stream)

-------------------------------- OR --------------------------

Blob.LoadFromFile


"Eric Schwarz" <eric@HATE-THAT-SPAMcomputer-strategies.com> wrote in message
news:51FD48C5-F798-4F24-A46E-1EBED6C9BD71@news.elevatesoft.com...
> This is driving me crazy because I know I've done this in the past.
>
> I'm trying to load a blob field with a jpg image via a memory stream.
>
> Image.LoadFromFile
> Image.SaveToMemoryStream(Stream)
> Blob.LoadFromStream(Stream)
>
> An EInvalidGraphic "Bitmap image is not valid" exception is thrown on the
> LoadFromStream.  What's going on here?  I thought you can load anything
> into a blob field?
>
> 4.29 under Delphi2010
>
>

Tue, Feb 9 2010 6:00 PMPermanent Link

"Walter Matte"
DO you have the field attached to a data aware control???

It that what is causing the exception.... it wouldn't be the DB.

Walter



"Eric Schwarz" <eric@HATE-THAT-SPAMcomputer-strategies.com> wrote in message
news:51FD48C5-F798-4F24-A46E-1EBED6C9BD71@news.elevatesoft.com...
> This is driving me crazy because I know I've done this in the past.
>
> I'm trying to load a blob field with a jpg image via a memory stream.
>
> Image.LoadFromFile
> Image.SaveToMemoryStream(Stream)
> Blob.LoadFromStream(Stream)
>
> An EInvalidGraphic "Bitmap image is not valid" exception is thrown on the
> LoadFromStream.  What's going on here?  I thought you can load anything
> into a blob field?
>
> 4.29 under Delphi2010
>
>

Tue, Feb 9 2010 7:56 PMPermanent Link

"Eric Schwarz"
THAT's the ticket!!!  I had 2 controls attached to it and I didn't
disconnect one of them for testing.  I KNEW it was something stupid, thanks
for the second set of eyeballs


"Walter Matte" <mattew_@_interlog.com> wrote in message
news:87F0F53C-EC54-41FF-BE76-F8C9F3EAC23F@news.elevatesoft.com...
> DO you have the field attached to a data aware control???
>
> It that what is causing the exception.... it wouldn't be the DB.
>
> Walter
>
>
>
> "Eric Schwarz" <eric@HATE-THAT-SPAMcomputer-strategies.com> wrote in
> message news:51FD48C5-F798-4F24-A46E-1EBED6C9BD71@news.elevatesoft.com...
>> This is driving me crazy because I know I've done this in the past.
>>
>> I'm trying to load a blob field with a jpg image via a memory stream.
>>
>> Image.LoadFromFile
>> Image.SaveToMemoryStream(Stream)
>> Blob.LoadFromStream(Stream)
>>
>> An EInvalidGraphic "Bitmap image is not valid" exception is thrown on the
>> LoadFromStream.  What's going on here?  I thought you can load anything
>> into a blob field?
>>
>> 4.29 under Delphi2010
>>
>>
>
>

Image