how to get GraphicClass from file extension?

how to get GraphicClass from file extension?

Post by mustapha.w » Tue, 10 Oct 2006 15:17:50


In Graphics.pas,delphi provided function as below:

function GraphicFilter(GraphicClass: TGraphicClass): string;
function GraphicExtension(GraphicClass: TGraphicClass): string;
function GraphicFileMask(GraphicClass: TGraphicClass): string;

But,How can I get a GraphicClass from a extension?
Always,I need to save graphic into database,extension and stream.
When I read it from database,I need a function to get GraphicClass.

I suggest delphi move class "TFileFormatsList" and variable "FileFormats" up
to interface block.
 
 
 

how to get GraphicClass from file extension?

Post by C-H » Tue, 10 Oct 2006 22:28:50


Peter Below came up with a solution in this newsgroup not long ago.

Search for thread with >GetIMGType<.

/C-H

 
 
 

how to get GraphicClass from file extension?

Post by mustapha.w » Wed, 11 Oct 2006 09:50:23

Thnak you,I googled it at:
http://www.yqcomputer.com/ +GetIMGType&rnum=1&hl=zh-CN#b461ac88eeaadbcd

But,it is not graceful.It used a enumeration:
const
IMGTypes: array[0..3] of TImgDescriptor =
((ext:'.gif'; classtype: TGifImage),
(ext:'.jpg'; classtype: TJpegImage),
(ext:'.png'; classtype: TPngImage),
(ext:'.bmp'; classtype: TBitmap));
For a plugin system,I don`t kownow how many other Graphics will be
registered beforehand.

I strongly suggest delphi open class "TFileFormatsList" and variable
"FileFormats".
 
 
 

how to get GraphicClass from file extension?

Post by Mike Lisch » Wed, 11 Oct 2006 15:49:14


I think my GraphicEx library is something you would appreciate. It not
only supports many graphics formats (sig, png, tiff, gif etc.) but also
has the ability to determine the image type from a stream. No file
extension is needed! Use the link in the sig to get to the library.

Mike
--
www.soft-gems.net
 
 
 

how to get GraphicClass from file extension?

Post by mustapha.w » Fri, 13 Oct 2006 10:33:49

Oh,Thanks.
I see you code.Really,you also meet the same problem.You writed your own
"TFileFormatList".Then,another user`s new graphic must use your
"TFileFormatList" to register.They accept this as a standard?

Why not ask "Team B" to open it for us?
 
 
 

how to get GraphicClass from file extension?

Post by Team » Sat, 14 Oct 2006 07:06:03


Open what? You've lost me ...

--
-Mike (TeamB)
 
 
 

how to get GraphicClass from file extension?

Post by mustapha.w » Thu, 19 Oct 2006 14:31:18

Open class "TFileFormatsList" and variable "FileFormats" up
to interface block.
 
 
 

how to get GraphicClass from file extension?

Post by Team » Thu, 19 Oct 2006 22:29:53


Oh, I see. I think you meant to say that *Borland* should include
those in the interface. This would be a good suggestion for Quality
Central:

http://www.yqcomputer.com/

TeamB does not work for Borland:

http://www.yqcomputer.com/

--
-Mike (TeamB)
 
 
 

how to get GraphicClass from file extension?

Post by David Bern » Mon, 23 Oct 2006 09:43:24

Sometime ago (april 2005) I submitted one QC report very similar, and it's "open"
http://www.yqcomputer.com/

regards
david
www.teechart.com
 
 
 

how to get GraphicClass from file extension?

Post by mustapha.w » Thu, 16 Nov 2006 09:45:26

Oh,sorry,I opined that "Team B" is a department of Borland maintaining
Delphi.

"Mike Williams (TeamB)" <mlwi!!iams@gmail!.com> ?
 
 
 

how to get GraphicClass from file extension?

Post by mustapha.w » Thu, 16 Nov 2006 09:48:49

It seems Borland not deal with that.

"David Berneda" < XXXX@XXXXX.COM > ?