本文整理匯總了Java中java.awt.DisplayMode.BIT_DEPTH_MULTI屬性的典型用法代碼示例。如果您正苦於以下問題:Java DisplayMode.BIT_DEPTH_MULTI屬性的具體用法?Java DisplayMode.BIT_DEPTH_MULTI怎麽用?Java DisplayMode.BIT_DEPTH_MULTI使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.awt.DisplayMode
的用法示例。
在下文中一共展示了DisplayMode.BIT_DEPTH_MULTI屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getDisplayMode
/**
* Returns the current display mode of this device, or null if unknown.
*
* @return the current display mode
* @see #setDisplayMode(DisplayMode)
* @see #getDisplayModes()
* @since 1.4
*/
public DisplayMode getDisplayMode()
{
if (fixedDisplayMode != null)
return fixedDisplayMode;
synchronized (this)
{
if (displayModes == null)
displayModes = nativeGetDisplayModes(env);
}
int index = nativeGetDisplayModeIndex(env);
int rate = nativeGetDisplayModeRate(env);
return new DisplayMode(displayModes[index].width,
displayModes[index].height,
DisplayMode.BIT_DEPTH_MULTI,
rate);
}
示例2: getDefaultDisplayMode
private DisplayMode getDefaultDisplayMode() {
GraphicsConfiguration gc = getDefaultConfiguration();
Rectangle r = gc.getBounds();
return new DisplayMode(r.width, r.height,
DisplayMode.BIT_DEPTH_MULTI,
DisplayMode.REFRESH_RATE_UNKNOWN);
}
示例3: findDisplayMode
private DisplayMode findDisplayMode() {
GraphicsDevice gd = getGraphicsConfiguration().getDevice();
DisplayMode dms[] = gd.getDisplayModes();
DisplayMode currentDM = gd.getDisplayMode();
for (DisplayMode dm : dms) {
if (dm.getBitDepth() > 8 &&
dm.getBitDepth() != DisplayMode.BIT_DEPTH_MULTI &&
dm.getBitDepth() != currentDM.getBitDepth() &&
dm.getWidth() == currentDM.getWidth() &&
dm.getHeight() == currentDM.getHeight())
{
// found a mode which has the same dimensions but different
// depth
return dm;
}
if (dm.getBitDepth() == DisplayMode.BIT_DEPTH_MULTI &&
(dm.getWidth() != currentDM.getWidth() ||
dm.getHeight() != currentDM.getHeight()))
{
// found a mode which has the same depth but different
// dimensions
return dm;
}
}
return null;
}
示例4: deriveDepth
private static DisplayMode deriveDepth(DisplayMode dm) {
int depth;
if (dm.getBitDepth() == DisplayMode.BIT_DEPTH_MULTI) {
depth = 77;
} else {
depth = DisplayMode.BIT_DEPTH_MULTI;
}
return new DisplayMode(dm.getWidth(), dm.getHeight(),
depth, dm.getRefreshRate());
}