java.awt.Toolkit.getColorModel()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中java.awt.Toolkit.getColorModel()方法的一些代码示例,展示了Toolkit.getColorModel()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Toolkit.getColorModel()方法的具体详情如下:
包路径:java.awt.Toolkit
类名称:Toolkit
方法名:getColorModel

Toolkit.getColorModel介绍

[英]Determines the color model of this toolkit's screen.

ColorModel is an abstract class that encapsulates the ability to translate between the pixel values of an image and its red, green, blue, and alpha components.

This toolkit method is called by the getColorModel method of the Component class.
[中]确定此工具包屏幕的颜色模型。
ColorModel是一个抽象类,它封装了在图像的像素值及其红、绿、蓝和阿尔法分量之间进行转换的能力。
这个工具箱方法由Component类的getColorModel方法调用。

代码示例

代码示例来源:origin: UISpec4J/UISpec4J

public ColorModel getColorModel() throws HeadlessException {
 return getUnderlyingToolkit().getColorModel();
}

代码示例来源:origin: com.fifesoft.rtext/fife.common

/**
 * Checks and answers whether we have a true color system.
 *
 * @param c   the component used to determine the toolkit
 * @return true if the component's toolkit has a pixel size >= 24
 */
public static boolean isTrueColor(Component c) {
  return c.getToolkit().getColorModel().getPixelSize() >= 24;
}

代码示例来源:origin: net.java.dev.laf-widget/laf-widget

/**
 * Checks and answers whether we have a true color system.
 * 
 * @param c
 *            the component used to determine the toolkit
 * @return true if the component's toolkit has a pixel size >= 24
 */
public static boolean isTrueColor(Component c) {
  return c.getToolkit().getColorModel().getPixelSize() >= 24;
}

代码示例来源:origin: com.incors/kunstoff-laf

/**
  * Returns true if the display uses 24- or 32-bit color depth (= true color)
  */
 public static boolean isToolkitTrueColor(Component c) {
  int pixelsize = c.getToolkit().getColorModel().getPixelSize();
  return pixelsize >= 24;
 }
}

相关文章