Paint.setStrokeWidth()使用什么度量单位? [英] What unit of measure does Paint.setStrokeWidth() use?
问题描述
Paint.setStrokeWidth()使用什么度量单位,我是否需要根据当前屏幕密度缩放此值?
What unit of measure does Paint.setStrokeWidth() use and do I need to scale this value based on the current screen density?
这是一个浮点值,所以我知道它不是像素数.它一定是相对于某物的.
It's a float value so I know it's not a number of pixels. It must be relative to something.
这是撰写本文时所有文档所说的:
This is all the documentation says as of this writing:
设置笔划的宽度.在发际线模式下将0传递给笔划.细线总是绘制一个独立于canva矩阵的像素.
Set the width for stroking. Pass 0 to stroke in hairline mode. Hairlines always draws a single pixel independent of the canva's matrix.
推荐答案
描边宽度以像素为单位定义(是浮点数,使用像素分数也没有问题:)
The stroke width is defined in pixels (yes it's a float, and there's no problem with using fractions of pixels :)
这篇关于Paint.setStrokeWidth()使用什么度量单位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!