| Package | qnx.display |
| Class | public class Display |
| Inheritance | Display flash.events.EventDispatcher |
Display class provides the functionality that enables you to interact
with and configure displays. This includes the internal display as well as any external display that is connected
via the HDMI port.
See also
| Property | Defined By | ||
|---|---|---|---|
| display : Display [static] [read-only]
Returns the singleton Display object. | Display | ||
| Method | Defined By | ||
|---|---|---|---|
Display()
Do not use this constructor. | Display | ||
getDisplayCount():int
Returns the number of displays. | Display | ||
getDisplayHeight(displayIndex:int):int
Returns the native height of the display (in pixels). | Display | ||
getDisplayId(displayIndex:int):String
Returns the ID of the display. | Display | ||
getDisplayOffset(displayIndex:int):int
Returns the offset that must be applied to a window's x coordinate in order for it to
appear on the indicated display. | Display | ||
getDisplayType(displayIndex:int):String
Returns the type of display. | Display | ||
getDisplayWidth(displayIndex:int):int
Returns the native width of the display (in pixels). | Display | ||
getMirrorMode(displayIndex:int):String
Returns the current mirror mode type in use by a given display. | Display | ||
getMode(displayIndex:int):int
Gets the current display mode of a display. | Display | ||
getModes(displayIndex:int):Vector.<DisplayMode>
Returns a Vector of modes that are supported by the display, given the index of the display. | Display | ||
getRotation(displayIndex:int):int
Returns the rotation angle of a display. | Display | ||
isAttached(displayIndex:int):Boolean
Returns true if the display is currently attached, given the index of the display. | Display | ||
setMirrorMode(displayIndex:int, mode:String):void
Enables and disables mirror mode on the main display. | Display | ||
setMode(displayIndex:int, modeIndex:int):void
Sets the current display mode of a display. | Display | ||
setRotation(displayIndex:int, angle:int):void
Rotate a display. | Display | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when a new display is attached to the system. | Display | |||
| Dispatched when a new display is removed from the system. | Display | |||
| Dispatched when the display mode of a display changes. | Display | |||
| display | property |
display:Display [read-only]
Returns the singleton Display object.
The following example returns a Display instance and outputs information
about the Display to the console:
var myDisp:Display;
myDisp = Display.display;
trace(myDisp.getDisplayId(0));
trace(myDisp.getDisplayHeight(0));
trace(myDisp.getDisplayWidth(0));
trace(myDisp.getDisplayType(0));
public static function get display():Display| Display | () | Constructor |
public function Display()
Do not use this constructor. Instead, use the static display() function.
See also
| getDisplayCount | () | method |
public function getDisplayCount():intReturns the number of displays.
This number may be greater than the number of displays currently attached.
Returnsint — The number of displays.
|
| getDisplayHeight | () | method |
public function getDisplayHeight(displayIndex:int):intReturns the native height of the display (in pixels).
Parameters
displayIndex:int — The index of the display.
|
int — int
|
| getDisplayId | () | method |
public function getDisplayId(displayIndex:int):StringReturns the ID of the display.
This allows you to distinguish between the different displays that
are currently connected. In the following example, settings and a DisplayMode instance are applied to an external
display given a unique ID.
if (myDisp.getDisplayId(1) == "EXTERNAL1") {
myMonMode = new DisplayMode();
myMonMode.aspectRatio = "16:9";
myMonMode.interlaced = true;
myMonMode.refresh = 60;
myMonMode.isPreferred = false;
myMonMode.index = 6;
myDisp.setMode(1, 6);
myDisp.setRotation(1, 0);
myDisp.setMirrorMode(1, MirrorMode.STRETCH);
}
else{
myDisp.setRotation(0, 90);
myDisp.setMirrorMode(0, MirrorMode.NORMAL);
}
Parameters
displayIndex:int — The index of the display.
|
String — String
|
| getDisplayOffset | () | method |
public function getDisplayOffset(displayIndex:int):intReturns the offset that must be applied to a window's x coordinate in order for it to appear on the indicated display.
Parameters
displayIndex:int — The index of the display.
|
int |
| getDisplayType | () | method |
public function getDisplayType(displayIndex:int):StringReturns the type of display. Possible values are:
DisplayType.HDMIDisplayType.INTERNALParameters
displayIndex:int — The index of the display.
|
String |
See also
| getDisplayWidth | () | method |
public function getDisplayWidth(displayIndex:int):intReturns the native width of the display (in pixels).
Parameters
displayIndex:int — The index of the display.
|
int — int
|
| getMirrorMode | () | method |
public function getMirrorMode(displayIndex:int):StringReturns the current mirror mode type in use by a given display.
The mirror mode defines the resolution and appearance of the source on a secondary display.
Parameters
displayIndex:int — The index of the display for which to return the setting.
|
String — The current mirror mode setting. The constants for this
are given by the MirrorMode class.
|
See also
| getMode | () | method |
public function getMode(displayIndex:int):intGets the current display mode of a display.
Parameters
displayIndex:int — The index of the display for which to get the mode.
|
int — The index of the mode that the display is set to.
|
| getModes | () | method |
public function getModes(displayIndex:int):Vector.<DisplayMode>
Returns a Vector of modes that are supported by the display, given the index of the display.
Each element is of type qnx.display.DisplayMode.
Parameters
displayIndex:int — The index of the display.
|
Vector.<DisplayMode> — A Vector of DisplayModes instances.
|
See also
| getRotation | () | method |
public function getRotation(displayIndex:int):intReturns the rotation angle of a display.
Parameters
displayIndex:int — The index of the display for which to set the mode.
|
int — int
|
| isAttached | () | method |
public function isAttached(displayIndex:int):Boolean
Returns true if the display is currently attached, given the index of the display.
The following example checks to see if an external display is attached.
if (myDisp.isAttached(1)) {
myDisp.setRotation(1, 0);
myDisp.setMirrorMode(1, MirrorMode.STRETCH);
}
else{
myDisp.setRotation(0, 90);
myDisp.setMirrorMode(0, MirrorMode.NORMAL);
}
Parameters
displayIndex:int — The index of the display.
|
Boolean |
| setMirrorMode | () | method |
public function setMirrorMode(displayIndex:int, mode:String):voidEnables and disables mirror mode on the main display. Mirror mode allows you to mirror the main display on an secondary display.
Parameters
displayIndex:int — The index of the display on which to set mirror mode.
| |
mode:String — The mirror mode setting to use. The constants for this
are given by the MirrorMode class.
|
See also
| setMode | () | method |
public function setMode(displayIndex:int, modeIndex:int):voidSets the current display mode of a display.
The following example creates a DisplayMode instance and applies it to a display.
myMonMode = new DisplayMode();
myMonMode.aspectRatio = "16:9";
myMonMode.interlaced = true;
myMonMode.refresh = 60;
myMonMode.isPreferred = false;
myMonMode.index = 6;
myDisp.setMode(1, 6);
Parameters
displayIndex:int — The index of the display for which to set the mode.
| |
modeIndex:int — The index of the mode for which to set the display.
|
See also
| setRotation | () | method |
public function setRotation(displayIndex:int, angle:int):voidRotate a display.
Parameters
displayIndex:int — The index of the display on which to set the mode.
| |
angle:int — The rotation angle in degrees. Can be one of 0, 90, 180 or 270.
|
| displayAttached | Event |
qnx.events.DisplayEventqnx.events.DisplayEvent.DISPLAY_ATTACHEDDispatched when a new display is attached to the system.
| displayRemoved | Event |
qnx.events.DisplayEventqnx.events.DisplayEvent.DISPLAY_REMOVEDDispatched when a new display is removed from the system.
| modeChanged | Event |
qnx.events.DisplayEventqnx.events.DisplayEvent.MODE_CHANGEDDispatched when the display mode of a display changes.