问题描述
如果我的画布反映了一些现实生活中的测量结果,比如8米乘6米,我画了一条线,我该如何计算画布上该线的测量值。即如果我从位置x1,y1到位置x2,y2绘制,我测量它并确定它大约是x长度。也可以在运行时在线下方显示测量值,就像我完成线后一样,它的长度自动显示在它的底部。我使用简单的画布,只有1个绘图线函数与javascript atm。
if my canvas is reflecting some real life measurements like 8 meter by 6 meter and i draw a line on it, how can i calculate the measurement of that line on canvas. i.e if i draw from position x1,y1 to position x2,y2 i measure it and say for sure that it is approximately x length long. Also will it be possible to show the measurement right below the line on runtime too like as soon as i finish the line,its length is automatically be shown at bottom of it. i am using simple canvas with just 1 draw line function with javascript atm.
推荐答案
这篇关于如何将像素转换为measurement-html5画布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!