SelectStockObject

SelectStockObject

SelectStockObject語句把終端字型選入設備環境,這樣,用TextOut或TextOutEx輸出文本時,將使用DOS命令視窗的字型。其實,每個設備環境都有一個預設字型,對於顯示器而言,預設字型就是SYSTEM_FONT系統字型,如果應用程式不需要執行很複雜的文本輸出,使用預設字型即可。

基本介紹

  • 外文名:SelectStockObject
  • 類型:概念
  • 類別:函式
  • 套用:計算機
用法定義,函式使用,

用法定義

SelectStockObject(OEM_FIXED_FONT);
MSDN中的定義
CDC::SelectStockObject
virtual CGdiObject* SelectStockObject(int nIndex);
Return Value
A pointer to theCGdiObjectobject that was replaced if the function is successful. The actual object pointed to is aCPen,CBrush, orCFontobject. If the call is unsuccessful, the return value isNULL.
Parameters
nIndex
Specifies the kind of stock object desired. It can be one of the following values:
  • BLACK_BRUSH Black brush.
  • DKGRAY_BRUSH Dark gray brush.
  • GRAY_BRUSH Gray brush.
  • HOLLOW_BRUSH Hollow brush.
  • LTGRAY_BRUSH Light gray brush.
  • NULL_BRUSH Null brush.
  • WHITE_BRUSH White brush.
  • BLACK_PEN Black pen.
  • NULL_PEN Null pen.
  • WHITE_PEN White pen.
  • ANSI_FIXED_FONT ANSI fixed system font.
  • ANSI_VAR_FONT ANSI variable system font.
  • DEVICE_DEFAULT_FONT Device-dependent font.
  • OEM_FIXED_FONT OEM-dependent fixed font.
  • SYSTEM_FONT The system font. By default, Windows uses the system font to draw menus, dialog-box controls, and other text. In Windows versions 3.0 and later, the system font is proportional width; earlier versions of Windows use a fixed-width system font.
  • SYSTEM_FIXED_FONT The fixed-width system font used in Windows prior to version 3.0. This object is available for compatibility with earlier versions of Windows.
  • DEFAULT_PALETTE Default color palette. This palette consists of the 20 static colors in the system palette.

函式使用

  • 許多 GDI 函式使用當前畫筆填充內部和當前筆來繪製直線。在某些情況下,應用程式可能不需要修改通常由鋼筆或畫筆受影響的區域。選擇到設備上下文的 NULL_PEN 或 NULL_BRUSH 通知 GDI 不能修改通常受影響的區域。簡單地說,"NULL_"的對象不顯示任何內容。

相關詞條

熱門詞條

聯絡我們