我如何理解每个坐标值所需的位数是多少? [英] How Do I Understand What Is The Amount Of Bit Needed For Each Coordinate Values?
问题描述
在某一点(如端点)使用折线图开始逐点记录黑色像素的坐标,例如:(3,6),(4,7),(5,7),( 6,6),(7,5),(8,5),(9,5),(10,4),(10,3),(9,2)。
随着这种方式存储线图,每个黑色像素存储两个坐标(x,y),他需要存储坐标值和图像大小的数量。
例如,如果图像尺寸为512 * 512像素,则每个坐标值用九个二进制表示。
为什么回答是9 ???
With line graph line at some point (such as an endpoint) began to record the coordinates of black pixels point by point, such as:(3,6),(4,7),(5,7),(6,6),(7,5),(8,5),(9,5),(10,4),(10,3),(9,2)。
With this way to store line diagram,each black pixel to be stored two coordinates(x,y),he number required to store a coordinate values and the size of the image.
For example, if an image size is 512 * 512 pixels, each coordinate values are represented with nine binary.
Why answer is 9???
推荐答案
只需使用标准int
每个数字的类型,您将涵盖大多数基数。 Windows API具有POINT
结构 [ ^ ]保存这些值,.NET有另一个Point
结构 [ ^ ]。
Just use a standardint
type for each number and you will cover most bases. Windows API has thePOINT
structure[^] to hold these values, and .NET has the otherPoint
structure[^].
这篇关于我如何理解每个坐标值所需的位数是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!