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 |
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應