如何在Android中创建自定义笔刷
我已经创建了一些画笔,但我需要更多,我在JS中找到了一些画笔,但我无法在android代码中完美地转换它们,这是一个链接,可以将这些画笔从JS转换为android代码,我尝试了不同的方法使这些画笔工作,但大多数都不正确, 我还想从这个应用程序的一些刷子 我从链接中转换了“切片”笔划,效果很好,但我无法对其他人这样做如何在Android中创建自定义笔刷,android,canvas,paint,brush,Android,Canvas,Paint,Brush,我已经创建了一些画笔,但我需要更多,我在JS中找到了一些画笔,但我无法在android代码中完美地转换它们,这是一个链接,可以将这些画笔从JS转换为android代码,我尝试了不同的方法使这些画笔工作,但大多数都不正确, 我还想从这个应用程序的一些刷子 我从链接中转换了“切片”笔划,效果很好,但我无法对其他人这样做 private void multistrokePen(float x, float y, Path path) { path.moveTo(this.startX
private void multistrokePen(float x, float y, Path path) {
path.moveTo(this.startX, this.startY);
path.lineTo(x, y);
path.moveTo(this.startX- (this.paintStrokeWidth/2), this.startY - (this.paintStrokeWidth/2));
path.lineTo(x - (this.paintStrokeWidth/2), y - (this.paintStrokeWidth/2));
path.moveTo(this.startX- (this.paintStrokeWidth/4), this.startY - (this.paintStrokeWidth/4));
path.lineTo(x- (this.paintStrokeWidth/4), y - (this.paintStrokeWidth/4));
path.moveTo(startX+ (this.paintStrokeWidth/4), startY + (this.paintStrokeWidth/4));
path.lineTo(x + (this.paintStrokeWidth/4), y + (this.paintStrokeWidth/4));
path.moveTo(this.startX + (this.paintStrokeWidth/2), this.startY +
(this.paintStrokeWidth/2));
path.lineTo(x + (this.paintStrokeWidth/2), y + (this.paintStrokeWidth/2));
startX =x;
startY =y;
}
我转换了其中的一些..参见“线条模式”“了解如何以结构化的方式使用它们。干得好!你知道怎么做一个像钢笔一样的小径帽吗?在andorid中,如果你能检查一下这个应用程序,它们只有几个盖子。它们很早就开始制作不同的刷子了,还有一些我如何解决了我的平滑路径问题,但仍然无法创建像它们一样的盖子,在一些画笔中,它们有一个像真笔一样的笔帽,从路径的起点和终点看,笔帽就像箭头。路径的笔帽意味着?检查我的路径,它们的起点和终点就像一个圆圈,在这个应用程序中检查路径,它们的起点和终点像箭头真笔抱歉,我不知道。