次の方法で共有


CDC::Draw3dRect

3 次元四角形を描画します。

void Draw3dRect(
   LPCRECT lpRect,
   COLORREF clrTopLeft,
   COLORREF clrBottomRight 
);
void Draw3dRect(
   int x,
   int y,
   int cx,
   int cy,
   COLORREF clrTopLeft,
   COLORREF clrBottomRight 
);

パラメーター

  • lpRect
    外接する四角形 (論理単位)。 このパラメーターには、RECT 構造体ヘのポインターまたは CRect オブジェクトへのポインターのいずれかを渡せます。

  • clrTopLeft
    3 次元四角形の上辺と左辺の色。

  • clrBottomRight
    3 次元四角形の下辺と右辺の色。

  • x
    3 次元四角形の左上隅の論理 x 座標。

  • y
    3 次元四角形の左上隅の論理 y 座標。

  • cx
    3 次元四角形の幅。

  • cy
    3 次元四角形の高さ。

解説

四角形は、clrTopLeft で指定された色で上辺と左辺を clrBottomRight で指定された色で下辺と右辺を描画されます。

使用例

void CDCView::Draw3dRect(CDC* pDC)
{
   // get the client area
   CRect rect;
   GetClientRect(rect);

   // shrink our rect 20 pixels on all sides
   rect.DeflateRect(20, 20);

   // draw a rectangle with red top and left sides, and
   // green right and bottom sides.
   pDC->Draw3dRect(rect, RGB(255, 0, 0), RGB(0, 255, 0));

   // This call to the four-integer override would draw
   // the same rectangle with a little less convenience:

   // pDC->Draw3dRect(rect.left, rect.top, rect.Width(), rect.Height(),
   //    RGB(255, 0, 0), RGB(0, 255, 0));
}

必要条件

**ヘッダー:**afxwin.h

参照

参照

CDC クラス

階層図

RECT 構造体

CRect クラス

その他の技術情報

CDC のメンバー