Share via


Graphics::Graphics (Image*) 方法 (gdiplusgraphics.h)

建立與Image物件相關聯的Graphics::Graphics物件。

語法

void Graphics(
  [in] Image *image
);

參數

[in] image

類型: 影像*

與新Graphics::Graphics物件相關聯的Image物件的指標。

傳回值

備註

如果 Image 物件是以開啟以供讀取的中繼檔為基礎,則此建構函式會失敗。 Image::Image (檔案) Metafile::Metafile (檔案) 建構函式會開啟中繼檔以供讀取。 若要開啟用於錄製的中繼檔,請使用接收裝置內容控制碼的 中繼檔 建構函式。

如果影像使用下列其中一個像素格式,此建構函式也會失敗:

  • PixelFormatUndefined
  • PixelFormatDontCare
  • PixelFormat1bppIndexed
  • PixelFormat4bppIndexed
  • PixelFormat8bppIndexed
  • PixelFormat16bppGrayScale
  • PixelFormat16bppARGB1555

需求

   
最低支援的用戶端 Windows XP、Windows 2000 Professional [僅限桌面應用程式]
最低支援的伺服器 Windows 2000 Server [僅限桌面應用程式]
目標平台 Windows
標頭 gdiplusgraphics.h (包含 Gdiplus.h)
程式庫 Gdiplus.lib
Dll Gdiplus.dll

另請參閱

程式設計模型中的變更

快速入門

圖形

圖形建構函式

映像