Problem in using TDBImage with other graphics format!

Hi, thanks for reading this message!

So here is my problem!
Im making a program that uses a TDBImage component, but i need to add GIF's and JPEG's to the database rather then just BMP's! I added the JPEG unit to the uses clause, and GifImages unit (Copyright 1999 by Peter Ivan Dunne). Thus i have the *.jpeg, *.jpg and *.gif extensions in the OpenPicture dialog! And now i can open these types of pictures in the TDImage and view then at runtime!
Ok, so far so good! The problem is when i try to post the changes it tells me that it's not a valid bitmap!

I use this code to write the *.gif to the blob fields:
Stream := TBlobStream.Create(Table1PICTURE, bmReadWrite);
(DBImage1.Picture.Graphic as TGifImage).savetostream(stream);
Table1.Post; //The exception is raised here!

What should i do! How can i solve this?
I know the procedure to read from the blob field but where and when do i use it so that i can view the pictures has a scroll the table?
Can please someone help me?



  • free stream after post
  • : free stream after post
    Thank you for your reply!
    It was a stupid mistake of mine! If the stream was released how was the table suposed to post something that was not there! Duhhh.... :-)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!