如何在Android的绘制,当你设置线的宽度是多少? [英] How do you set a line's width when drawing in Android?
问题描述
如何设置线宽?是用什么方法呢?
How to set Line width? What method is used for it?
推荐答案
查看 <一个href="http://developer.android.com/reference/android/graphics/Paint.html#setStrokeWidth%28float%29"><$c$c>Paint.setStrokeWidth()$c$c>.
您绘制通过各种 <一个href="http://developer.android.com/reference/android/graphics/drawable/package-summary.html"><$c$c>Drawable$c$c>对象。本身是从如何吸引他们的指示分离的对象;是的覆盖的 <一个href="http://developer.android.com/reference/android/graphics/Paint.html"><$c$c>Paint$c$c>类。 油漆
情况下,有一个方法,可以让你设置将用于绘制对象笔画的宽度, <一个href="http://developer.android.com/reference/android/graphics/Paint.html#setStrokeWidth%28float%29"><$c$c>setStrokeWidth()$c$c>,这是你想要的。
You draw by making various Drawable
objects. The objects themselves are separated from the instructions about how to draw them; that's covered by the Paint
class. Paint
instances have a method that allows you set the width of the stroke that will be used to draw the objects, setStrokeWidth()
, which is what you want.
这篇关于如何在Android的绘制,当你设置线的宽度是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!