共用方式為


CImage::GetExporterFilterString

尋找可用的影像格式儲存影像。

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

參數

  • strExporters
    CSimpleString 對物件的參考。 請參閱 備註 以取得詳細資訊。

  • aguidFileTypes
    陣列的 GUID,其中的每一個項目中的檔案類型對應。 在下列範例中, pszAllFilesDescription 的 aguidFileTypes 為 0 GUID_NULL 和剩餘的陣列值是目前作業系統支援的影像檔案格式。

    注意事項注意事項

    如需常數的完整清單,請參閱 Windows SDK的 Image File Format 常數

  • pszAllFilesDescription
    如果這個參數不是 NULL,篩選條件字串在清單的開頭會有其他篩選條件。 這個篩選條件會有 pszAllFilesDescription 的目前值 (由其描述的,並接受清單中的其他型別支援的任何擴充檔。

    例如:

    //First filter in the list will be titled "All Image Files", and
    //will accept files with any extension supported by any exporter.
    CImage::GetExporterFilterString( strExporters, aguidFileTypes, 
       _T("All Image Files"));
    
  • dwExclude
    一組位元旗標指定排除哪些檔案類型從清單。 允許的旗標為:

    • excludeGIF = 0x01 排除 GIF 檔。

    • excludeBMP = 0x02 排除 BMP (視窗、點陣圖) 檔案。

    • 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
    分隔符號使用的影像格式。 請參閱 備註 以取得詳細資訊。

傳回值

標準 HRESULT

備註

您可以將產生的格式字串套用至您的 MFC CFileDialog 物件公開可用的影像格式的副檔名為檔案儲存為 對話方塊。

參數 strExporter 格式為:

檔案 description0|*.ext0|filedescription1|*.ext1|檔案 descriptionn…|*.extn||

其中是「|」是 chSeparator指定的分隔符號字元。 例如:

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

使用預設的分隔符號「|」,如果您將這個字串為 MFC CFileDialog 物件。 使用空白分隔符號「\0' if you pass this string to a common File Save 對話方塊。

需求

Header: atlimage.h

請參閱

參考

CImage 類別

CImage::GetImporterFilterString

CFileDialog::m_ofn

CFileDialog::GetFileExt

OPENFILENAME

CFileDialog::SetDefExt