简体   繁体   English

GraphicsConfiguration在Java中代表什么?

[英]What does a GraphicsConfiguration represent in Java?

The Java 8 documentation describes GraphicsConfiguration in the following manner. Java 8文档以以下方式描述GraphicsConfiguration。

The GraphicsConfiguration class describes the characteristics of a graphics destination such as a printer or monitor GraphicsConfiguration类描述图形目标(例如打印机或监视器)的特征

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. 该描述虽然有点技术性和含糊性,但足以让我在屏幕截图应用程序中使用它,但是我仍然不明白为什么GraphicsDevice具有多个GraphicsConfiguration。 In the documentation for GraphicsDevice it states: 在GraphicsDevice文档中指出:

Each graphics device has one or more GraphicsConfiguration objects associated with it. 每个图形设备都有一个或多个与之关联的GraphicsConfiguration对象。 These objects specify the different configurations in which the GraphicsDevice can be used. 这些对象指定可以使用GraphicsDevice的不同配置。

What are these "different configurations" and when would they occur? 这些“不同的配置”是什么?何时出现?

As stated in the Javadoc for this class: 如该类的Javadoc中所述:

There can be many GraphicsConfiguration objects associated with a single graphics device, representing different drawing modes or capabilities. 与单个图形设备关联的许多GraphicsConfiguration对象可以表示不同的绘制模式或功能。 The corresponding native structure will vary from platform to platform. 相应的本机结构将因平台而异。 For example, on X11 windowing systems, each visual is a different GraphicsConfiguration. 例如,在X11窗口系统上,每个视觉对象都是不同的GraphicsConfiguration。 On Microsoft Windows, GraphicsConfigurations represent PixelFormats available in the current resolution and color depth. 在Microsoft Windows上,GraphicsConfigurations表示当前分辨率和颜色深度中可用的PixelFormats。

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

For X11 and the term "visual" this link clarifies a bit: http://tronche.com/gui/x/xlib/utilities/visual.html - Of course, for "normal" applications this might be irritating but since Java AWT uses the underlying OS graphics, it has to represent its characteristics. 对于X11和“视觉”一词,此链接做了一些澄清: http : //tronche.com/gui/x/xlib/utilities/visual.html-当然,对于“正常”应用程序,这可能很烦人,但是由于Java AWT使用底层OS图形,它必须代表其特征。

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

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