What does a GraphicsConfiguration represent in Java?

时间:2015-05-04 19:54:49

标签: java

The Java 8 documentation describes GraphicsConfiguration in the following manner.

The GraphicsConfiguration class describes the characteristics of a graphics destination such as a printer or monitor

The description is a bit non-technical and vague, though, it has been enough to allow me to use it in a screenshot application, but I still do not understand why a GraphicsDevice has multiple GraphicsConfigurations. In the documentation for GraphicsDevice it states:

Each graphics device has one or more GraphicsConfiguration objects associated with it. These objects specify the different configurations in which the GraphicsDevice can be used.

What are these "different configurations" and when would they occur?

1 个答案:

答案 0 :(得分:1)

正如本课程的Javadoc所述:

  

可以有许多与a关联的GraphicsConfiguration对象   单个图形设备,代表不同的绘图模式或   能力。相应的原生结构将有所不同   平台到平台。例如,在X11窗口系统上,每个   visual是一种不同的GraphicsConfiguration。在Microsoft Windows上   GraphicsConfigurations表示当前可用的PixelFormats   分辨率和颜色深度。

http://docs.oracle.com/javase/7/docs/api/java/awt/GraphicsConfiguration.html

对于X11和术语“visual”,这个链接澄清了一点:http://tronche.com/gui/x/xlib/utilities/visual.html - 当然,对于“普通”应用程序,这可能会令人恼火但是由于Java AWT使用底层操作系统图形,它必须代表它特点。