本文整理汇总了C#中System.Drawing.Graphics.IsVisible方法的典型用法代码示例。如果您正苦于以下问题:C# Graphics.IsVisible方法的具体用法?C# Graphics.IsVisible怎么用?C# Graphics.IsVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Graphics
的用法示例。
在下文中一共展示了Graphics.IsVisible方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsVisiblePoint
private void IsVisiblePoint(PaintEventArgs e)
{
// Set clip region.
Region clipRegion = new Region(new Rectangle(50, 50, 100, 100));
e.Graphics.SetClip(clipRegion, CombineMode.Replace);
// Set up coordinates of points.
int x1 = 100;
int y1 = 100;
int x2 = 200;
int y2 = 200;
Point point1 = new Point(x1, y1);
Point point2 = new Point(x2, y2);
// If point is visible, fill ellipse that represents it.
if (e.Graphics.IsVisible(point1))
{
e.Graphics.FillEllipse(new SolidBrush(Color.Red), x1, y1, 10, 10);
}
if (e.Graphics.IsVisible(point2))
{
e.Graphics.FillEllipse(new SolidBrush(Color.Blue), x2, y2, 10, 10);
}
}
示例2: IsVisiblePointF
private void IsVisiblePointF(PaintEventArgs e)
{
// Set clip region.
Region clipRegion = new Region(new Rectangle(50, 50, 100, 100));
e.Graphics.SetClip(clipRegion, CombineMode.Replace);
// Set up coordinates of points.
float x1 = 100.0F;
float y1 = 100.0F;
float x2 = 200.0F;
float y2 = 200.0F;
PointF point1 = new PointF(x1, y1);
PointF point2 = new PointF(x2, y2);
// If point is visible, fill ellipse that represents it.
if (e.Graphics.IsVisible(point1))
{
e.Graphics.FillEllipse(new SolidBrush(Color.Red), x1, y1, 10.0F, 10.0F);
}
if (e.Graphics.IsVisible(point2))
{
e.Graphics.FillEllipse(new SolidBrush(Color.Blue), x2, y2, 10.0F, 10.0F);
}
}
示例3: IsVisibleRectangle
private void IsVisibleRectangle(PaintEventArgs e)
{
// Set clip region.
Region clipRegion = new Region(new Rectangle(50, 50, 100, 100));
e.Graphics.SetClip(clipRegion, CombineMode.Replace);
// Set up coordinates of rectangles.
Rectangle rect1 = new Rectangle(100, 100, 20, 20);
Rectangle rect2 = new Rectangle(200, 200, 20, 20);
// If rectangle is visible, fill it.
if (e.Graphics.IsVisible(rect1))
{
e.Graphics.FillRectangle(new SolidBrush(Color.Red), rect1);
}
if (e.Graphics.IsVisible(rect2))
{
e.Graphics.FillRectangle(new SolidBrush(Color.Blue), rect2);
}
}
示例4: IsVisibleRectangleF
private void IsVisibleRectangleF(PaintEventArgs e)
{
// Set clip region.
Region clipRegion = new Region(new Rectangle(50, 50, 100, 100));
e.Graphics.SetClip(clipRegion, CombineMode.Replace);
// Set up coordinates of rectangles.
RectangleF rect1 = new RectangleF(100.0F, 100.0F, 20.0F, 20.0F);
RectangleF rect2 = new RectangleF(200.0F, 200.0F, 20.0F, 20.0F);
// If rectangle is visible, fill it.
if (e.Graphics.IsVisible(rect1))
{
e.Graphics.FillRectangle(new SolidBrush(Color.Red), rect1);
}
if (e.Graphics.IsVisible(rect2))
{
e.Graphics.FillRectangle(new SolidBrush(Color.Blue), rect2);
}
}
示例5: IsVisibleInt
private void IsVisibleInt(PaintEventArgs e)
{
// Set clip region.
Region clipRegion = new Region(new Rectangle(50, 50, 100, 100));
e.Graphics.SetClip(clipRegion, CombineMode.Replace);
// Set up coordinates of points.
int x1 = 100;
int y1 = 100;
int x2 = 200;
int y2 = 200;
// If point is visible, fill ellipse that represents it.
if (e.Graphics.IsVisible(x1, y1))
{
e.Graphics.FillEllipse(new SolidBrush(Color.Red), x1, y1, 10, 10);
}
if (e.Graphics.IsVisible(x2, y2))
{
e.Graphics.FillEllipse(new SolidBrush(Color.Blue), x2, y2, 10, 10);
}
}
示例6: IsVisibleFloat
private void IsVisibleFloat(PaintEventArgs e)
{
// Set clip region.
Region clipRegion = new Region(new Rectangle(50, 50, 100, 100));
e.Graphics.SetClip(clipRegion, CombineMode.Replace);
// Set up coordinates of points.
float x1 = 100.0F;
float y1 = 100.0F;
float x2 = 200.0F;
float y2 = 200.0F;
// If point is visible, fill ellipse that represents it.
if (e.Graphics.IsVisible(x1, y1))
{
e.Graphics.FillEllipse(new SolidBrush(Color.Red), x1, y1, 10.0F, 10.0F);
}
if (e.Graphics.IsVisible(x2, y2))
{
e.Graphics.FillEllipse(new SolidBrush(Color.Blue), x2, y2, 10.0F, 10.0F);
}
}
示例7: IsVisible4Int
private void IsVisible4Int(PaintEventArgs e)
{
// Set clip region.
Region clipRegion = new Region(new Rectangle(50, 50, 100, 100));
e.Graphics.SetClip(clipRegion, CombineMode.Replace);
// Set up coordinates of rectangles.
int x1 = 100;
int y1 = 100;
int width1 = 20;
int height1 = 20;
int x2 = 200;
int y2 = 200;
int width2 = 20;
int height2 = 20;
// If rectangle is visible, fill it.
if (e.Graphics.IsVisible(x1, y1, width1, height1))
{
e.Graphics.FillRectangle(new SolidBrush(Color.Red), x1, y1, width1, height1);
}
if (e.Graphics.IsVisible(x2, y2, width2, height2))
{
e.Graphics.FillRectangle(new SolidBrush(Color.Blue), x2, y2, width2, height2);
}
}
示例8: IsVisible4Float
private void IsVisible4Float(PaintEventArgs e)
{
// Set clip region.
Region clipRegion = new Region(new Rectangle(50, 50, 100, 100));
e.Graphics.SetClip(clipRegion, CombineMode.Replace);
// Set up coordinates of rectangles.
float x1 = 100.0F;
float y1 = 100.0F;
float width1 = 20.0F;
float height1 = 20.0F;
float x2 = 200.0F;
float y2 = 200.0F;
float width2 = 20.0F;
float height2 = 20.0F;
// If rectangle is visible, fill it.
if (e.Graphics.IsVisible(x1, y1, width1, height1))
{
e.Graphics.FillRectangle(new SolidBrush(Color.Red), x1, y1, width1, height1);
}
if (e.Graphics.IsVisible(x2, y2, width2, height2))
{
e.Graphics.FillRectangle(new SolidBrush(Color.Blue), x2, y2, width2, height2);
}
}