简体   繁体   English

Java Draw Rectangle方法

[英]Java Draw Rectangle method

So when we are drawing a rectangle in java 所以当我们在Java中绘制矩形时

g.drawRect(X, Y, 100, 10);

Is the rectangle formed from the top left corner and goes 100 units to the right and 10 down, or is there a center (X,Y) which extends 50 units to the left and right and 5 units to the top and bottom? 矩形是从左上角开始形成,向右移动100个单位,然后向下移动10个,还是有一个中心(X,Y)向左和向右延伸50个单位,并且向上和向下延伸了5个单位?

矩形是从左上角形成的,向右移动100个单位,向下移动10个单位

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM