本文整理汇总了C++中GraphicsPath::IsVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsPath::IsVisible方法的具体用法?C++ GraphicsPath::IsVisible怎么用?C++ GraphicsPath::IsVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsPath
的用法示例。
在下文中一共展示了GraphicsPath::IsVisible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IndexFromPoint
// Finds the index of the tab, which contains the given point.
int IndexFromPoint(int x, int y, bool *inXbutton=nullptr) {
Point point(x, y);
Graphics graphics(hwnd);
GraphicsPath shapes(data->Points, data->Types, data->Count);
GraphicsPath shape;
GraphicsPathIterator iterator(&shapes);
iterator.NextMarker(&shape);
ClientRect rClient(hwnd);
REAL yPosTab = inTitlebar ? 0.0f : REAL(rClient.dy - height - 1);
graphics.TranslateTransform(1.0f, yPosTab);
for (int i = 0; i < Count(); i++) {
Point pt(point);
graphics.TransformPoints( CoordinateSpaceWorld, CoordinateSpaceDevice, &pt, 1);
if (shape.IsVisible(pt, &graphics)) {
iterator.NextMarker(&shape);
if (inXbutton)
*inXbutton = shape.IsVisible(pt, &graphics) ? true : false;
return i;
}
graphics.TranslateTransform(REAL(width + 1), 0.0f);
}
if (inXbutton)
*inXbutton = false;
return -1;
}
示例2: HitTest
/** \brief Test to see if we hit this object with a mouse click
* \param pos Click position
* \returns true it hit
*/
bool CPolyDrawable::HitTest(Gdiplus::Point pos)
{
// Transform the points
vector<Point> points;
for (auto point : mPoints)
{
points.push_back(RotatePoint(point, mPlacedR) + mPlacedPosition);
}
GraphicsPath path;
path.AddPolygon(&points[0], (int)points.size());
return path.IsVisible(pos) ? true : false;
}