BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to get GraphicClass from file extension?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
mustapha.wang
Guest





PostPosted: Mon Oct 09, 2006 8:11 am    Post subject: how to get GraphicClass from file extension? Reply with quote



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.
Back to top
C-H
Guest





PostPosted: Mon Oct 09, 2006 6:28 pm    Post subject: Re: how to get GraphicClass from file extension? Reply with quote



"mustapha.wang" <mustapha.wang (AT) 163 (DOT) com> wrote:

Quote:
But,How can I get a GraphicClass from a extension?

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

Search for thread with >GetIMGType<.

/C-H
Back to top
mustapha.wang
Guest





PostPosted: Tue Oct 10, 2006 5:50 am    Post subject: Re: how to get GraphicClass from file extension? Reply with quote



Thnak you,I googled it at:
http://groups.google.com/group/borland.public.delphi.graphics/browse_thread/thread/2c453649508bdc3d/b461ac88eeaadbcd?lnk=st&q=delphi+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".
Back to top
Mike Lischke
Guest





PostPosted: Tue Oct 10, 2006 8:11 am    Post subject: Re: how to get GraphicClass from file extension? Reply with quote

mustapha.wang wrote:

Quote:
For a plugin system,I don`t kownow how many other Graphics will be
registered beforehand.

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
Back to top
mustapha.wang
Guest





PostPosted: Thu Oct 12, 2006 6:33 am    Post subject: Re: how to get GraphicClass from file extension? Reply with quote

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?
Back to top
Mike Williams (TeamB)
Guest





PostPosted: Fri Oct 13, 2006 3:06 am    Post subject: Re: how to get GraphicClass from file extension? Reply with quote

mustapha.wang wrote:

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

Open what? You've lost me ...

--
-Mike (TeamB)
Back to top
mustapha.wang
Guest





PostPosted: Wed Oct 18, 2006 8:11 am    Post subject: Re: how to get GraphicClass from file extension? Reply with quote

Open class "TFileFormatsList" and variable "FileFormats" up
to interface block.
Back to top
Mike Williams (TeamB)
Guest





PostPosted: Wed Oct 18, 2006 6:29 pm    Post subject: Re: how to get GraphicClass from file extension? Reply with quote

mustapha.wang wrote:

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

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://qc.borland.com

TeamB does not work for Borland:

http://www.teamb.com

--
-Mike (TeamB)
Back to top
David Berneda
Guest





PostPosted: Sun Oct 22, 2006 5:43 am    Post subject: Re: how to get GraphicClass from file extension? Reply with quote

Sometime ago (april 2005) I submitted one QC report very similar, and it's "open"
http://qc.borland.com/wc/qcmain.aspx?d=11837

regards
david
www.teechart.com

"Mike Williams (TeamB)" <mlwi!!iams@gmail!.com> wrote in message news:xn0esm2t6416xqr001 (AT) newsgroups (DOT) borland.com...
Quote:
mustapha.wang wrote:
Open class "TFileFormatsList" and variable "FileFormats" up to interface block.
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://qc.borland.com
Back to top
mustapha.wang
Guest





PostPosted: Wed Nov 15, 2006 6:45 am    Post subject: Re: how to get GraphicClass from file extension? Reply with quote

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

"Mike Williams (TeamB)" <mlwi!!iams@gmail!.com> ?¤J®ø®§
news:xn0esm2t6416xqr001 (AT) newsgroups (DOT) borland.com...
Quote:
mustapha.wang wrote:

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

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://qc.borland.com

TeamB does not work for Borland:

http://www.teamb.com

--
-Mike (TeamB)
Back to top
mustapha.wang
Guest





PostPosted: Wed Nov 15, 2006 6:48 am    Post subject: Re: how to get GraphicClass from file extension? Reply with quote

It seems Borland not deal with that.

"David Berneda" <david (AT) steema (DOT) com> ?¤J®ø®§
news:453abe31 (AT) newsgroups (DOT) borland.com...
Quote:
Sometime ago (april 2005) I submitted one QC report very similar, and it's
"open"
http://qc.borland.com/wc/qcmain.aspx?d=11837

regards
david
www.teechart.com

"Mike Williams (TeamB)" <mlwi!!iams@gmail!.com> wrote in message
news:xn0esm2t6416xqr001 (AT) newsgroups (DOT) borland.com...
mustapha.wang wrote:
Open class "TFileFormatsList" and variable "FileFormats" up to interface
block.
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://qc.borland.com

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.