相同Processing代码在Eclipse与Processing IDE中效果差异原因咨询
Processing IDE与Eclipse运行效果差异问题
问题现象
我编写了完全相同的Processing代码,分别在Processing 4.3 IDE和使用core.jar包的Eclipse中运行。两者均生成白色背景上带圆角的矩形,但存在两个明显差异:
- Eclipse中矩形的画质远差于Processing IDE
- 尽管设置了相同的窗口尺寸,Eclipse中的窗口也更大
环境信息
- Windows版本:10.0.19045 Build 19045
- Eclipse版本:2023-03 (4.27.0)
Processing 4.3 IDE中的代码
final static int screen_width = 1400; final static int screen_height = 600; final static int button_width = 500; final static int button_height = 200; final static int border_width = 8; PVector button_startingpoint; public void settings() { size(screen_width, screen_height); } public void setup() { frameRate(60); button_startingpoint = new PVector((screen_width / 2) - (button_width / 2), (screen_height / 2) - (button_height / 2)); } public void draw() { background(255); fill(255, 255, 255); strokeWeight(border_width); rect(button_startingpoint.x, button_startingpoint.y, button_width, button_height, 24); }
Eclipse中的代码
package main; import processing.core.PApplet; import processing.core.PVector; public class Startup extends PApplet { final static int screen_width = 1400; final static int screen_height = 600; final static int button_width = 500; final static int button_height = 200; final static int border_width = 8; PVector button_startingpoint; public static void main(String[] args) { PApplet.main("main.Startup"); } public void settings() { size(screen_width, screen_height); } public void setup() { frameRate(60); button_startingpoint = new PVector((screen_width / 2) - (button_width / 2), (screen_height / 2) - (button_height / 2)); } public void draw() { background(255); fill(255, 255, 255); strokeWeight(border_width); rect(button_startingpoint.x, button_startingpoint.y, button_width, button_height, 24); } }
运行结果
Processing 4.3 IDE运行结果

Eclipse运行结果

内容的提问来源于stack exchange,提问作者Lars De Bock
相关产品推荐
相关产品推荐

