Share via


Graphics::GetVisibleClipBounds (RectF*) 方法 (gdiplusgraphics.h)

Graphics::GetVisibleClipBounds方法會取得矩形,此矩形會封入這個Graphics物件的可見裁剪區域。 可見裁剪區域是這個 Graphics 物件的裁剪區域與視窗裁剪區域的交集。

語法

Status GetVisibleClipBounds(
  RectF *rect
);

參數

rect

RectF物件的指標,該物件會接收括住可見裁剪區域的矩形。

傳回值

如果方法成功,它會傳回 Ok,這是 Status 列舉的元素。

如果方法失敗,它會傳回 Status 列舉的其他其中一個專案。

備註

範例

下列範例會設定 Graphics 物件的裁剪區域。 然後,它會取得一個矩形,該矩形會括住可見裁剪區域並填滿該矩形。

VOID Example_GetVisibleClipBounds2(HDC hdc)
{
   Graphics graphics(hdc);

   // Set the clipping region.
   graphics.SetClip(RectF(100.0f, 100.0f, 200.0f, 100.0f));

   // Get a bounding rectangle for the clipping region.
   RectF boundRect;
   graphics.GetVisibleClipBounds(&boundRect);

   // Fill the bounding rectangle.
   graphics.FillRectangle(&SolidBrush(Color(255, 0, 0, 0)), boundRect);
}

需求

   
標頭 gdiplusgraphics.h

另請參閱

GetClipBounds 方法

圖形

Graphics::IsVisibleClipEmpty

IsVisible 方法

RectF