freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

gdiplus開發(fā)文檔-資料下載頁

2025-08-05 00:42本頁面
  

【正文】 :Clone傳遞nativeMatrix(作為輸入參數)和GpMatrix指針變量的地址(作為輸出參數)給平面API的GdipCloneMatrix函數:GpStatus WINGDIPAPI GdipCloneMatrix(GpMatrix *matrix, GpMatrix **cloneMatrix)。例如:Matrix *Clone() const { GpMatrix *cloneMatrix = NULL。 …… GdipCloneMatrix(nativeMatrix, amp。cloneMatrix))。 …… return new Matrix(cloneMatrix)。 }該平面API函數返回一個GpStatus類型的值。,枚舉類型GpStatus被定義為與枚舉類型Status等價:typedef Status GpStatus。在封裝類中,大多數方法都返回一個狀態(tài)值,指出方法是否成功。但是也有一些方法用布爾變量來返回狀態(tài)。例如,Matrix類的IsInvertible方法:BOOL IsInvertible() const { BOOL result = FALSE。 …… GdipIsMatrixInvertible(nativeMatrix, amp。result)。 return result。}其中,平面API函數GdipIsMatrixInvertible的函數原型為:GpStatus WINGDIPAPI GdipIsMatrixInvertible(GDIPCONST GpMatrix *matrix, BOOL *result)。另一個封裝類是Color,它只有一個(被定義為DWORD的)ARGB類型的字段。當你傳遞一個Color對象到某個封裝方法時,該方法也會將ARGB字段傳到底層的GDI+平面API函數。例如Pen::SetColor:Status SetColor(const Coloramp。 color) { …… GdipSetPenColor(nativePen, ())。}Color::GetValue方法返回ARGB字段的值。其中,平面API函數GdipSetPenColor的函數原型為:GpStatus WINGDIPAPI GdipSetPenColor(GpPen *pen, ARGB argb)。 GDI+的MFC編程1.基礎封裝在GDI+ API中的各種C++類、函數、常量、枚舉和結構。所以,采用MFC進行GDI+編程。由上節(jié)最后一小小節(jié)“5.6)GDI+平面API”中的討論可知,封裝在GDI+類中方法,最后都需要調用GDI+平面API中的相關底層函數,才能完成實際的操作。所以,為了運行GDI+應用程序,在操作系統(tǒng)平臺中。,而且它不是C++和MFC的缺省鏈接庫。所以,必須在項目設置,添加該庫作為鏈接器輸入的附加依賴項。,將所有的GDI+的類、函數、常量、枚舉和結構等都定義在了命名空間Gdiplus中。所以,一般在GDI+程序中,都必須使用如下的命名空間聲明:using namespace Gdiplus。例如:include using namespace Gdiplus?!?)/*********************************************************************\* Copyright (c) 19982001, Microsoft Corp. All Rights Reserved.* Module Name:* * Abstract:* GDI+ public header file\*********************************************************************/ifndef _GDIPLUS_Hdefine _GDIPLUS_Hstruct IDirectDrawSurface7。typedef signed short INT16。typedef unsigned short UINT16。include // set structure packing to 8namespace Gdiplus{ namespace DllExports { include }。 include include include include include include include include include include include namespace DllExports { include }。 include include include include include include include include include include include include include include include include }。 // namespace Gdiplusinclude // pop structure packing back to previous stateendif // !_GDIPLUS_HPP2)GDI+的初始化與清除為了在MFC應用程序中使用采用C++封裝的GDI+ API,必須在MFC項目的應用程序類中,調用GDI+命名空間中的GDI+啟動函數GdiplusStartup和GDI+關閉函數GdiplusShutdown,來對GDI+進行初始化(,或鎖定標志+1)和清除(,或鎖定標志1)工作。它們一般分別在應用程序類的InitInstance和ExitInstance重載成員函數中調用。函數GdiplusStartup和GdiplusShutdown,:Status WINAPI GdiplusStartup( OUT ULONG_PTR *token, const GdiplusStartupInput *input, OUT GdiplusStartupOutput *output)。void GdiplusShutdown(ULONG_PTR token)。其中:l 類型ULONG_PTR,是用無符號長整數表示的指針,:typedef _W64 unsigned long ULONG_PTR。輸出參數token(權標),供關閉GDI+的函數使用,所以必須設置為應用程序類的成員變量(或全局變量,不提倡)。l 結構GdiplusStartupInput和GdiplusStartupOutput,:struct GdiplusStartupInput { UINT32 GdiplusVersion。 // Must be 1 DebugEventProc DebugEventCallback。 // Ignored on free builds BOOL SuppressBackgroundThread。 // FALSE unless you39。re prepared to call // the hook/unhook functions properly BOOL SuppressExternalCodecs。 // FALSE unless you want GDI+ only to use // its internal image codecs. GdiplusStartupInput( DebugEventProc debugEventCallback = NULL, BOOL suppressBackgroundThread = FALSE, BOOL suppressExternalCodecs = FALSE) { GdiplusVersion = 1。 DebugEventCallback = debugEventCallback。 SuppressBackgroundThread = suppressBackgroundThread。 SuppressExternalCodecs = suppressExternalCodecs。 }}。struct GdiplusStartupOutput { NotificationHookProc NotificationHook。 NotificationUnhookProc NotificationUnhook。}。n GDI+啟動輸入結構指針參數input,一般取缺省構造值即可,即(設:無調試事件回調過程、不抑制背景線程、不抑制外部編解碼):input = GdiplusStartupInput(NULL, FALSE, FALSE)。n GDI+啟動輸出結構指針參數output,一般不需要,取為NULL即可。注意,采用MFC進行GDI+ API編程時,在使用任何GDI+的功能調用之前,必須先調用GDI+啟動函數GdiplusStartup來進行初始化GDI+的工作;在完成所有的GDI+功能調用之后,必須調用GDI+關閉函數GdiplusShutdown來進行清除GDI+的工作。例如:(創(chuàng)建一個名為GdipDraw的MFC單文檔應用程序項目,)// ……class CGdipDrawApp : public CWinApp{public: CGdipDrawApp()。 ULONG_PTR m_gdiplusToken。 ……}。// ……include using namespace Gdiplus?!瑽OOL CGdipDrawApp::InitInstance(){ // 如果一個運行在 Windows XP 上的應用程序清單指定要 // 使用 版本 6 或更高版本來啟用可視化方式, //則需要 InitCommonControlsEx()。否則,將無法創(chuàng)建窗口。 INITCOMMONCONTROLSEX InitCtrls。 = sizeof(InitCtrls)。 // 將它設置為包括所有要在應用程序中使用的 // 公共控件類。 = ICC_WIN95_CLASSES。 InitCommonControlsEx(amp。InitCtrls)。 /*注意:下面這兩個語句必須加在CWinApp:: InitInstance ()。語句之前,不然以后會造成視圖窗口不能自動重畫、程序中不能使用字體等等一系列問題。*/ GdiplusStartupInput gdiplusStartupInput。 GdiplusStartup(amp。m_gdiplusToken, amp。gdiplusStartupInput, NULL)。 CWinApp::InitInstance()。 ……}……int CGdipDrawApp::ExitInstance() // 該函數是自己利用屬性窗口,添加的重寫函數{ // TODO: 在此添加專用代碼和/或調用基類 GdiplusShutdown(m_gdiplusToken)。 return CWinApp::ExitInstance()。}3)幾何輔助類在GDI+ API中,定義了許多繪圖的輔助類,常用的有點、大小和矩形等幾何類。它們都是沒有基類的獨立類。下面逐個進行介紹:(1)Point[F](點)GDI+中,有兩種類型的點:整數點(對應于Point類)和浮點數點(對應于PointF類)。下面分別加以介紹:l 整數點類Point:class Point {public: Point() {X = Y = 0。} Point(const Point amp。point) {X = 。 Y = 。} Point(const Size amp。size) {X = 。 Y = 。} Point(INT x, INT y) {X = x。 Y = y。} Point operator+(const Pointamp。 point) const {return Point(X + , Y + )。} Point operator(const Pointamp。 point) const {return Point(X , Y )。} BOOL Equals(const Pointamp。 point) {return (X == ) amp。amp。 (Y == )。}public: INT X。 // 大寫X、Y INT Y。}。其中:typedef int INT。 // 4字節(jié)有符號整數()注意,這里的點與GDI的區(qū)別:POINT和CPoint:{x。 y。} // 小寫x、
點擊復制文檔內容
黨政相關相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1