我觉得Point2D.Float(1.1f, 1)不完全和Point(1,1)重复,如果显示器可以分辨的话 我没有找到直接绘制点的类,只找到Graphics2D的draw方法 /** * Strokes the outline of a <code>Shape</code> using the settings of the * current <code>Graphics2D</code> context. The rendering attributes * applied include the <code>Clip</code>, <code>Transform</code>, * <code>Paint</code>, <code>Composite</code> and * <code>Stroke</code> attributes. * @param s the <code>Shape</code> to be rendered */ public abstract void draw(Shape s); 而根据图形学的知识,在transform的时候,转换成屏幕显示可以使用灰度值来表示比如一条线要从下图(每个方框代表一个点)的左上角画到右下角,如果在取整的模式下,画出来的图是很难看的;但是如果在每个经过的格子里计算灰度值,显示出来的就是一条平滑的直线 ┌┬┬┬┬┬┬┐ ├┼┼┼┼┼┼┤ ├┼┼┼┼┼┼┤ ├┼┼┼┼┼┼┤ └┴┴┴┴┴┴┘ 所以我理解,Point2D.Float(1.1f, 1)和Point(1, 1)将会不完全相同,如果显示器足够清晰,画出来的点是不重叠的
我没有找到直接绘制点的类,只找到Graphics2D的draw方法
/**
* Strokes the outline of a <code>Shape</code> using the settings of the
* current <code>Graphics2D</code> context. The rendering attributes
* applied include the <code>Clip</code>, <code>Transform</code>,
* <code>Paint</code>, <code>Composite</code> and
* <code>Stroke</code> attributes.
* @param s the <code>Shape</code> to be rendered
*/
public abstract void draw(Shape s);
而根据图形学的知识,在transform的时候,转换成屏幕显示可以使用灰度值来表示比如一条线要从下图(每个方框代表一个点)的左上角画到右下角,如果在取整的模式下,画出来的图是很难看的;但是如果在每个经过的格子里计算灰度值,显示出来的就是一条平滑的直线
┌┬┬┬┬┬┬┐
├┼┼┼┼┼┼┤
├┼┼┼┼┼┼┤
├┼┼┼┼┼┼┤
└┴┴┴┴┴┴┘
所以我理解,Point2D.Float(1.1f, 1)和Point(1, 1)将会不完全相同,如果显示器足够清晰,画出来的点是不重叠的