Board index » delphi » Storing various graphic types to a file

Storing various graphic types to a file


We allow users to store graphic to a database table.  At the moment we only
allow bmp files.  There are a plethora of graphic types.  Is there a logical
way to allow the user to choose one of many graphic types and then maybe
convert it or store it as is to be saved in a database for viewing later
within a graphic control.

Either some advice or web locations to find out more would be greatly




Re:Storing various graphic types to a file


Store the graphics file in a blob field and the file extension in a
character field. Validate the file type to ensure that only registered
graphics types are stored.

Recover the graphic from the blob field in an OnDataChange event,
identify the graphic type from the extension field and generate the
appropriate TGraghic type. Assign to a TImage to view.

As supplied Delphi can handle bitmaps and jpegs this way. To handle
other graphic formats you will need a third party library. I use
Envision from but there are a number of others

Sent using Virtual Access 5.01 - download your freeware copy now

Other Threads