CImage::GetImporterFilterString

查看图像格式可用于加载图像。

static HRESULT GetImporterFilterString(
   CSimpleString& strImporters,
   CSimpleArray< GUID >& aguidFileTypes,
   LPCTSTR pszAllFilesDescription = NULL,
   DWORD dwExclude = excludeDefaultLoad,
   TCHAR chSeparator = _T( '|' )
);

参数

  • strImporters
    CSimpleString 对象的引用。 请参见 Remarks 有关更多信息。

  • aguidFileTypes
    数组GUID,与之一的每个元素字符串中的文件类型相对应。 在下面 pszAllFilesDescription 的示例中,aguidFileTypes[0]与其余的数组值的 GUID_NULL 是当前操作系统支持图像文件格式。

    备注

    有关完整的常数,请参见。Windows SDK的 图像文件格式常数

  • pszAllFilesDescription
    如果此参数不是 NULL,筛选器字符串在列表的开头将有一个额外的筛选器。 此筛选器将具有 pszAllFilesDescription 的当前值它的声明,并接受列表中的其他导出程序支持的所有扩展文件。

    例如:

    //First filter in the list will be titled "All Image Files", and
    //will accept files with any extension supported by any importer.
    CImage::GetImporterFilterString( strImporters, aguidFileTypes, 
       _T("All Image Files"));
    
  • dwExclude
    将此位设置标记指定排除的文件类型从列表。 允许的标志是:

    • excludeGIF = 0x01排除GIF文件。

    • excludeBMP = 0x02排除BMP (Windows位图)文件。

    • excludeEMF = 0x04排除EMF (增强型图元文件)。

    • excludeWMF = 0x08排除WMF (Windows图元文件)。

    • excludeJPEG = 0x10排除JPEG文件。

    • excludePNG = 0x20排除PNG文件。

    • excludeTIFF = 0x40排除TIFF文件。

    • excludeIcon = 0x80排除ICO (Windows图标)文件。

    • excludeOther = 0x80000000排除未列出的其他文件类型中。

    • 默认情况下excludeDefaultLoad = 0加载的,因此任何文件类型有

    • 默认情况下,因为它们通常有特殊要求,保存的excludeDefaultSave = excludeIcon | excludeEMF | excludeWMF,这些文件被排除。

  • chSeparator
    分隔符使用在图像格式之间。 请参见 Remarks 有关更多信息。

备注

可以将生成的格式字符串到MFC CFileDialog 对象显示可用的图像格式的文件扩展名。File Open 对话框中。

参数 strImporter 具有格式:

文件description0|*.ext0|filedescription1|*.ext1|…文件descriptionn|*.extn||

在“|”是 chSeparator指定的分隔符字符。 例如:

"Bitmap format|*.bmp|JPEG format|*.jpg|GIF format|*.gif|PNG format|*.png||"

使用默认分隔符“|”,则将该字符串传递到MFC CFileDialog 对象。 如果通过此字符串到公共 File Open 对话框中,使用空分隔符“\ 0 "。

要求

Header: atlimage.h

请参见

参考

CImage选件类

CImage::GetExporterFilterString

CFileDialog::m_ofn

CFileDialog::GetFileExt

OPENFILENAME

CFileDialog::SetDefExt