android - 在xamarin android中给出长值时未绘制canvas.DrawPath
问题描述
我在 Xamarin android 中工作。
示例代码:
Path.MoveTo(22020100.00,22020100.00)
我试图从这个位置画线,但在提供 long 值时没有画线。
解决方案
画线有两种方法:
第一种方法:
canvas.DrawLine(startX, startY, stopX, stopY, paint);
第二种方法:
Paint paint = new Paint();
paint.SetStyle(Paint.Style.Stroke); // When drawing a line using a path, specify that the Paint Style is STROKE. Otherwise Paint will use the default style-fill. This Style does not create a line using a path
paint.Color = Color.Red;
Path path = new Path();
path.MoveTo(22020100.00f, 22020100.00f);
path.LineTo(120, 250);
canvas.DrawPath(path, paint);
推荐阅读
- php - Authorize.net 对 ARB 订阅申请一次现金折扣
- amazon-web-services - AWS Spark 作业监控工具
- javascript - 如何使用 Node、Express 将图像、CSS 和 JS 等浏览器内容发送到浏览器上的 html?
- python-3.x - 使用 Python 的 DetailView
- ios - Swift 数组与另一个数组引用来获取值
- c# - SharePoint 2013 - 文档库上传 c#
- java - 将 BlockingQueue 传递给 Spring KafkaListener
- oracle - 我在使用 oracle 查询时有一个问题
- mysql - MySQL - 从 SET 字段中的 ID 中选择所有引用
- symfony - 如何在 symfony 3.4 中阻止表单生成器的字段