我如何理解每个坐标值所需的位数是多少? [英] How Do I Understand What Is The Amount Of Bit Needed For Each Coordinate Values?

查看:134
本文介绍了我如何理解每个坐标值所需的位数是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某一点(如端点)使用折线图开始逐点记录黑色像素的坐标,例如:(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 standard int type for each number and you will cover most bases. Windows API has the POINT structure[^] to hold these values, and .NET has the other Point structure[^].


这篇关于我如何理解每个坐标值所需的位数是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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