Howdy, Stranger!

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

Categories

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:
[code]
Stream := TBlobStream.Create(Table1PICTURE, bmReadWrite);
try
(DBImage1.Picture.Graphic as TGifImage).savetostream(stream);
finally
stream.free;
end;
Table1.Post; //The exception is raised here!
[/code]

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?

Thnx!

Comments

Sign In or Register to comment.