本文整理匯總了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);
}