欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
VC++中的CDC類(lèi)(VC++學(xué)習筆記)

VC++中的CDC類(lèi)(VC++學(xué)習筆記)

(2009-04-03 17:32:56)
標簽:

vc學(xué)習筆記

msdn

文化

分類(lèi): 學(xué)習

    在學(xué)習VC++中,CDC類(lèi)是在顯示數據,或者使用圖形,或者使用文本中必不可少的。Windows使用與設備無(wú)關(guān)的圖形設備環(huán)境(DC :Device Context) 進(jìn)行顯示 。MFC基礎類(lèi)庫定義了設備環(huán)境對象類(lèi)----CDC類(lèi)。

    CDC與CGdiObject的關(guān)系

  說(shuō)道CDC類(lèi)就不能不提一下GdiObject---圖形對象類(lèi)。在Windows應用程序中,設備環(huán)境與圖形對象共同工作,協(xié)同完成繪圖顯示工作。就像畫(huà)家繪畫(huà)一樣,設備環(huán)境好比是畫(huà)家的畫(huà)布,圖形對象好比是畫(huà)家的畫(huà)筆。用畫(huà)筆在畫(huà)布上繪畫(huà),不同的畫(huà)筆將畫(huà)出不同的畫(huà)來(lái)。選擇合適的圖形對象和繪圖對象,才能按照要求完成繪圖任務(wù)。

  有關(guān)CDC類(lèi)的繼承

  父類(lèi):從 CObject 直接繼承而來(lái)。繼承了CObject類(lèi)的各種特性,如動(dòng)態(tài)創(chuàng )建等等。

  子類(lèi):CClientDC-------代表操作窗口的DC ,是比較常用的一個(gè)子類(lèi)

  CMetaFileDC ------響應Meta File的DC ,Meta File是一些GDI消息。

  CPaintDC-------響應WM_PAINT消息的DC。

  CWindowDC ------代表整個(gè)屏幕的DC

  CDC類(lèi)的數據成員

  數據成員只有兩個(gè):

  HDC m_hDC : CDC對象使用的輸出設備上下文

  HDC m_hAttribDC : CDC對象使用的屬性設備上下文

  二者在CDC對象創(chuàng )建時(shí)指向相同的設備上下文。

 

   MSDN Library中給出的構造函數及其成員函數如下(供學(xué)習之用):

 

  

Construction

 

CDC Constructs a CDC object.

 

Initialization

 

CreateDC Creates a device context for a specific device.
CreateIC Creates an information context for a specific device. This provides a fast way to get information about the device without creating a device context.
CreateCompatibleDC Creates a memory-device context that is compatible with another device context. You can use it to prepare images in memory.
DeleteDC Deletes the Windows device context associated with this CDC object.
FromHandle Returns a pointer to a CDC object when given a handle to a device context. If a CDC object is not attached to the handle, a temporary CDC object is created and attached.
DeleteTempMap Called by the CWinApp idle-time handler to delete any temporary CDC object created by FromHandle. Also detaches the device context.
Attach Attaches a Windows device context to this CDC object.
Detach Detaches the Windows device context from this CDC object.
SetAttribDC Sets m_hAttribDC, the attribute device context.
SetOutputDC Sets m_hDC, the output device context.
ReleaseAttribDC Releases m_hAttribDC, the attribute device context.
ReleaseOutputDC Releases m_hDC, the output device context.
GetCurrentBitmap Returns a pointer to the currently selected CBitmap object.
GetCurrentBrush Returns a pointer to the currently selected CBrush object.
GetCurrentFont Returns a pointer to the currently selected CFont object.
GetCurrentPalette Returns a pointer to the currently selected CPalette object.
GetCurrentPen Returns a pointer to the currently selected CPen object.
GetWindow Returns the window associated with the display device context.

 

Device-Context Functions

 

GetSafeHdc Returns m_hDC, the output device context.
SaveDC Saves the current state of the device context.
RestoreDC Restores the device context to a previous state saved with SaveDC.
ResetDC Updates the m_hAttribDC device context.
GetDeviceCaps Retrieves a specified kind of device-specific information about a given display device’s capabilities.
IsPrinting Determines whether the device context is being used for printing.

 

Drawing-Tool Functions

 

GetBrushOrg Retrieves the origin of the current brush.
SetBrushOrg Specifies the origin for the next brush selected into a device context.
EnumObjects Enumerates the pens and brushes available in a device context.

 

Type-Safe Selection Helpers

 

SelectObject Selects a GDI drawing object such as a pen.
SelectStockObject Selects one of the predefined stock pens, brushes, or fonts provided by Windows.

 

Color and Color Palette Functions

 

GetNearestColor Retrieves the closest logical color to a specified logical color that the given device can represent.
SelectPalette Selects the logical palette.
RealizePalette Maps palette entries in the current logical palette to the system palette.
UpdateColors Updates the client area of the device context by matching the current colors in the client area to the system palette on a pixel-by-pixel basis.
GetHalftoneBrush Retrieves a halftone brush.

 

Drawing-Attribute Functions

 

GetBkColor Retrieves the current background color.
SetBkColor Sets the current background color.
GetBkMode Retrieves the background mode.
SetBkMode Sets the background mode.
GetPolyFillMode Retrieves the current polygon-filling mode.
SetPolyFillMode Sets the polygon-filling mode.
GetROP2 Retrieves the current drawing mode.
SetROP2 Sets the current drawing mode.
GetStretchBltMode Retrieves the current bitmap-stretching mode.
SetStretchBltMode Sets the bitmap-stretching mode.
GetTextColor Retrieves the current text color.
SetTextColor Sets the text color.
GetColorAdjustment Retrieves the color adjustment values for the device context.
SetColorAdjustment Sets the color adjustment values for the device context using the specified values.

 

Mapping Functions

 

GetMapMode Retrieves the current mapping mode.
SetMapMode Sets the current mapping mode.
GetViewportOrg Retrieves the x- and y-coordinates of the viewport origin.
SetViewportOrg Sets the viewport origin.
OffsetViewportOrg Modifies the viewport origin relative to the coordinates of the current viewport origin.
GetViewportExt Retrieves the x- and y-extents of the viewport.
SetViewportExt Sets the x- and y-extents of the viewport.
ScaleViewportExt Modifies the viewport extent relative to the current values.
GetWindowOrg Retrieves the x- and y-coordinates of the origin of the associated window.
SetWindowOrg Sets the window origin of the device context.
OffsetWindowOrg Modifies the window origin relative to the coordinates of the current window origin.
GetWindowExt Retrieves the x- and y-extents of the associated window.
SetWindowExt Sets the x- and y-extents of the associated window.
ScaleWindowExt Modifies the window extents relative to the current values.

  等。。。
本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
CDC::FromHandle
CDC對象的成員函數進(jìn)行所有的繪圖
afxwin1.inl
第二章 MFC和Win32
關(guān)于memory device context內存設備上下文和位圖
對Windows程序中設備上下文DC(device context)的理解
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久