Share via


Graphics::IsVisible (INT,INT) 方法 (gdiplusgraphics.h)

Graphics::IsVisible方法會判斷指定的點是否在這個Graphics物件的可見裁剪區域內。 可見裁剪區域是這個 Graphics 物件的裁剪區域與視窗裁剪區域的交集。

語法

BOOL IsVisible(
  INT x,
  INT y
);

參數

x

整數,指定要測試之點的 X 座標。

y

整數,指定要測試之點的 Y 座標。

傳回值

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

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

備註

範例

下列範例會測試顯示裝置上是否顯示指定的點。 如果是,它會填滿代表該點的省略號。

VOID Example_IsVisible5(HDC hdc)

{
   Graphics graphics(hdc);

   // Set up the coordinates of the point.
   int x = 100;
   int y = 100;

   // If the point (x, y) is visible, fill an ellipse that represents it.
   if (graphics.IsVisible(x, y))
   {
   graphics.FillEllipse(&SolidBrush(Color(255, 0, 0, 0)), x, y, 5, 5);
   }
}

需求

   
標頭 gdiplusgraphics.h

另請參閱

圖形

Graphics::IsVisibleClipEmpty