【问题标题】:How to Create Custom brushes in Android如何在 Android 中创建自定义画笔
【发布时间】:2020-09-08 08:20:33
【问题描述】:

我已经创建了一些画笔,但我需要更多,我在 JS 中找到了一些画笔,但我无法在 android 代码中完美地转换它们,这是链接 http://perfectionkills.com/exploring-canvas-drawing-techniques/ 可以将这些画笔从 JS 转换为 Andorid 代码,我尝试了不同的方法来制作这些画笔,但大多数仍然不合适, 我也想要这个应用程序的一些画笔,https://play.google.com/store/apps/details?id=com.adsk.sketchbook&hl=en

我从链接中转换了 Sliced" 笔画,它工作正常,但我无法与其他人一起这样做

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;


    }

【问题讨论】:

    标签: android canvas paint brush


    【解决方案1】:

    我转换了其中的一些。 See here。请参阅“lines_pattern”以了解如何以结构化方式使用它们。

    【讨论】:

    • 干得好!你知道如何像笔一样制作路径的盖子吗?在andorid中,如果您可以查看此应用程序@ 987654322@,它们只有很少的帽子,他们正在非常精确地制作不同的画笔,以及一些我如何解决平滑路径的问题但仍然无法创建像他们这样的帽子,在某些画笔中他们有像真正的笔一样的帽子,就像从路径的开始和结束一样,帽子就像箭头。
    • 路径上限是什么意思?
    • 检查我的路径他们开始和结束就像一个圆圈,drive.google.com/file/d/1J58HXMKjBVxMKCAtvRkiK9sxl4Iqw4aT/… 并检查这个应用程序中的路径,他们的开始和结束就像一支真正的笔的箭头drive.google.com/file/d/1zpMvWx_bWSiLTPPCdHHxUAo46HfTEYru/…
    • 对不起,我不知道。
    猜你喜欢
    • 2016-12-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-04
    相关资源
    最近更新 更多