本文整理汇总了C#中Android.Graphics.Path.ComputeBounds方法的典型用法代码示例。如果您正苦于以下问题:C# Path.ComputeBounds方法的具体用法?C# Path.ComputeBounds怎么用?C# Path.ComputeBounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.Graphics.Path
的用法示例。
在下文中一共展示了Path.ComputeBounds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ensureComputedBoundsInclude
public void ensureComputedBoundsInclude(Path pPath) {
pPath.ComputeBounds(this.mRect, false);
this.ensureComputedBoundsInclude(this.mRect.Left, this.mRect.Top);
this.ensureComputedBoundsInclude(this.mRect.Right, this.mRect.Bottom);
}
示例2: CreateAnimationDrawer
public CreateAnimationDrawer(Context c, BrushItem brush, Canvas canvas, Bitmap myBmp, bool tooAdd = false, int cell = 1, string DrawerState = "brush_selection", Path pathToUse = null)
: base(c)
{
myBitmap = myBmp;
myCanvas = canvas;
DrawerStateInternal = DrawerState;
addOnly = tooAdd;
status = 0;
myPath = new Path();
myPaint = new Paint(PaintFlags.Dither);
myPaint.AntiAlias = true;
myPaint.Dither = true;
myPaint.SetStyle(Paint.Style.Stroke);
myPaint.StrokeJoin = Paint.Join.Round;
myPaint.StrokeWidth = brush.Thickness;
myPaint.StrokeCap = Paint.Cap.Round;
myPaint.SetARGB(colorUtil.a, colorUtil.r, colorUtil.g, colorUtil.b);
if (brush.BrushType == AnimationTypesBrushType.Spray)
myPaint.SetShadowLayer(brush.Thickness, 0, 0, ImageHelper.convWZColorToColor(brush.BrushColor));
if (DrawerState == "brush_selection")
{
if (pathToUse != null)
{
myBoundsPaint = new Paint();
myBoundsPaint = new Paint(PaintFlags.Dither);
myBoundsPaint.AntiAlias = true;
myBoundsPaint.Dither = true;
myBoundsPaint.SetStyle(Paint.Style.Stroke);
myBoundsPaint.StrokeJoin = Paint.Join.Round;
myBoundsPaint.StrokeWidth = 10f;
myBoundsPaint.StrokeCap = Paint.Cap.Round;
myBoundsPaint.SetARGB(255, 0, 0, 0);
myBoundsPaint.SetPathEffect(new DashPathEffect(new float[]
{
10f,
20f
}, 0));
myPath = pathToUse;
AnimationUtil.theCanvas.DrawPath(myPath, myPaint);
AnimationUtil.theCanvas.DrawPath(myPath, myPaint);
myBoundsRect = new RectF();
myPath.ComputeBounds(myBoundsRect, true);
AnimationUtil.theCanvas.DrawRect(myBoundsRect, myBoundsPaint);
}
}
}