问题描述
我已经创建了一些画笔,但我需要更多,我在 JS 中找到了一些画笔,但我无法在 android 代码中完美地转换它们,这是链接 http://perfectkills.com/exploring-canvas-drawing-techniques/ 可以将这些画笔从 JS 转换为 Andorid 代码,我尝试了不同的方法使这些画笔有效,但大多数仍然不合适,我也想要一些来自这个应用的画笔,https://play.google.com/store/apps/details?id=com.adsk.sketchbook&hl=en
I have created some brushes but i need more and i found some brushes in JS but i couldn't convert them perfectly in android code, This is the Link http://perfectionkills.com/exploring-canvas-drawing-techniques/ can some covert these brushes from JS to Andorid code, I have tried different approaches to make these brush works but most of them are still improper ,i also want some of brushes from this app , https://play.google.com/store/apps/details?id=com.adsk.sketchbook&hl=en
我转换了切片"从链接中点击这个,它工作正常,但我无法与其他人这样做
i converted Sliced" strokes this one from the link and it works fine but im unable to do so with others
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;
}
推荐答案
我转换了其中的一些.见此处.参见lines_pattern"了解您应该如何以结构化的方式使用它们.
I converted some of those. See here. See "lines_pattern" to understand how you should use those in structured way.
这篇关于如何在 Android 中创建自定义画笔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!