 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ray Mond Guest
|
Posted: Thu May 10, 2007 3:37 pm Post subject: Dynamic image loading |
|
|
I have a database table which contains an image (blob) column. Is there a
component that I can use, which I can load the blob (or data stream) into,
and the component can then figure out the type of image (bmp, jpg, gif,
png), and display the image accordingly? I do not want to have to 'tell'
the component the type of image that's stored, because I don't have that
information.
Thanks.
Ray Mond |
|
| Back to top |
|
 |
Torry Guest
|
Posted: Thu May 10, 2007 3:52 pm Post subject: Re: Dynamic image loading |
|
|
| Quote: | I have a database table which contains an image (blob) column. Is there a
component that I can use, which I can load the blob (or data stream) into,
and the component can then figure out the type of image (bmp, jpg, gif,
png), and display the image accordingly? I do not want to have to 'tell'
the component the type of image that's stored, because I don't have that
information.
|
At least two products of Microolap contains free component for JPEG images -
TDBImageEx.
Products are PostgresDAC (for PostreSQL -
http://www.microolap.com/products/connectivity/postgresdac/) and DAC for
MySQL (for MySQL - http://www.microolap.com/products/connectivity/mysqldac/)
I think that it can be partially rewritten to support the other formats as
well.
--
Best regards
Maxim Peresada
Torry's Delphi Pages http://www.torry.net |
|
| Back to top |
|
 |
Dean Hill Guest
|
Posted: Fri May 11, 2007 12:30 am Post subject: Re: Dynamic image loading |
|
|
Ray Mond wrote:
| Quote: | I have a database table which contains an image (blob) column. Is
there a component that I can use, which I can load the blob (or data
stream) into, and the component can then figure out the type of image
(bmp, jpg, gif, png), and display the image accordingly? I do not
want to have to 'tell' the component the type of image that's stored,
because I don't have that information.
|
ImageEn from Hi-Components will do this (http://www.hicomponents.com)
with their LoadFromStream method on the ImageEnIO component.
--
Dean |
|
| Back to top |
|
 |
Martijn Tonies Guest
|
Posted: Fri May 11, 2007 8:13 am Post subject: Re: Dynamic image loading |
|
|
| Quote: | I have a database table which contains an image (blob) column. Is there a
component that I can use, which I can load the blob (or data stream) into,
and the component can then figure out the type of image (bmp, jpg, gif,
png), and display the image accordingly? I do not want to have to 'tell'
the component the type of image that's stored, because I don't have that
information.
|
Ray,
You can show these types (and others) in a TImage. But if you do
not know the type of the image, you need to figure it out yourself.
I've done this for the BLOB Editor in Database Workbench and it's
fairly easy to do.
Search for "magic numbers file formats" in Google and you'll get a hint
of how to do it. Basically, you check the first few bytes and try to
detect the file type from that.
--
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com |
|
| Back to top |
|
 |
Ray Mond Guest
|
Posted: Tue May 15, 2007 8:13 am Post subject: Re: Dynamic image loading |
|
|
Thanks, everyone, for the suggestions.
Ray Mond |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|