如题,能从Timge的属性获得吗?

解决方案 »

  1.   

    楼上2位讲的不错,小弟我无能从TImage中知道文件格式,不过我认为只要你不做象PHOTOSHOP那样专业的图象软件,用GetFileType就可以,GetFileType返回文件类型后面跟的具体参数我不太记得了,(不好意思我现在在网吧),基本就可以知道文件类型了
       
    -----------------------------
    上面的话好象是我说的哦
    我今年才17,很多不懂,瞎说的
      

  2.   

    The GetFileType function returns the type of the specified file. DWORD GetFileType(    HANDLE hFile  // file handle 
       );
     ParametershFileIdentifies an open file handle.  Return ValuesThe return value is one of the following values: Value Meaning
    FILE_TYPE_UNKNOWN The type of the specified file is unknown.
    FILE_TYPE_DISK The specified file is a disk file.
    FILE_TYPE_CHAR The specified file is a character file, typically an LPT device or a console.
    FILE_TYPE_PIPE The specified file is either a named or anonymous pipe.
    --------
    不是大家想要的
    ----------
    你想获得文件格式,必须要有一个文件格式字典,它记录不同文件格式;
    一般的文件,其格式信息都放在固定的地方,比如*.mp3,有一种格式的mp3是这样的,其最后128个字节包含一些基本信息,歌名,作者等,它有一个标志tag,如果你打开一个文件,发现最后的128个字节中一个固定的地方包含tag,就可以基本确定是mp3文件
    --------