在Android的刷哈奇风格 [英] Hatch brush style in android

查看:98
本文介绍了在Android的刷哈奇风格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助绘制斜线上粗帆布(斜线)的矩形。
现在我不能找到比手动使其没有其他办法。
任何想法?

I need help with drawing hatched rectangle on canvas (diagonal stroke). Now I cant find out no other way than make it manually. Any ideas?

推荐答案

您可以创建一个小的位图阴影图案,并使用了的 BitmapShader 。有一个在 ApiDemos /图形示例,名为 Pattern.java 将告诉您如何做到这一点。尽管如此,如果你只需要画一个矩形的阴影,这可能是更容易只是手动孵化那里。

You can create a hatching pattern on a small bitmap, and use that with a BitmapShader. There's a sample in ApiDemos/graphics, called Pattern.java that shows you how to do it. Although, if you only need to draw a hatched rectangle, it might be easier to just do the hatching there manually.

这篇关于在Android的刷哈奇风格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆