本文整理汇总了C#中PaintDotNet.PdnRegion.Intersect方法的典型用法代码示例。如果您正苦于以下问题:C# PdnRegion.Intersect方法的具体用法?C# PdnRegion.Intersect怎么用?C# PdnRegion.Intersect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PaintDotNet.PdnRegion
的用法示例。
在下文中一共展示了PdnRegion.Intersect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MaskedSurface
public MaskedSurface(Surface source, PdnGraphicsPath path)
{
RectangleF boundsF = path.GetBounds();
Rectangle bounds = Utility.RoundRectangle(boundsF);
Rectangle boundsClipped = Rectangle.Intersect(bounds, source.Bounds);
Rectangle boundsRead;
if (bounds != boundsClipped)
{
PdnRegion region = new PdnRegion(path);
region.Intersect(source.Bounds);
SetPathField(PdnGraphicsPath.FromRegion(region));
this.region = region;
boundsRead = region.GetBoundsInt();
}
else
{
SetPathField(path.Clone());
this.region = new PdnRegion(this.path);
boundsRead = boundsClipped;
}
if (boundsRead.Width > 0 && boundsRead.Height > 0)
{
this.surface = new Surface(boundsRead.Size);
this.surface.CopySurface(source, boundsRead);
}
else
{
this.surface = null;
}
}
示例2: OnPaint
protected override void OnPaint(PaintEventArgs e)
{
if (this.surface != null)
{
PdnRegion clipRegion = null;
Rectangle[] rects = this.realUpdateRects;
if (rects == null)
{
clipRegion = new PdnRegion(e.Graphics.Clip, true);
clipRegion.Intersect(e.ClipRectangle);
rects = clipRegion.GetRegionScansReadOnlyInt();
}
if (this.justPaintWhite > 0)
{
PdnGraphics.FillRectangles(e.Graphics, Color.White, rects);
}
else
{
foreach (Rectangle rect in rects)
{
if (e.Graphics.IsVisible(rect))
{
PaintEventArgs2 e2 = new PaintEventArgs2(e.Graphics, rect);
OnPaintImpl(e2);
}
}
}
if (clipRegion != null)
{
clipRegion.Dispose();
clipRegion = null;
}
}
if (this.justPaintWhite > 0)
{
--this.justPaintWhite;
}
base.OnPaint(e);
}