SHOW Signed SHOW Colour
 

net.rim.device.api.system
Class Display

java.lang.Object
  |
  +--net.rim.device.api.system.Display

public final class Display
extends Object

Provides access to the handheld's display.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

Since:
JDE 4.0.0

Field Summary
 Category: Signed static int DISPLAY_PROPERTY_NO_SUBPIXELS
          The display does not contain subpixels.
 Category: Signed static int DISPLAY_PROPERTY_REQUIRES_BACKLIGHT
          The display requires the backlight to be on.
 
Method Summary
 Category: Signed static int getContrast()
          Deprecated.  
 Category: Signed static int getContrastIncrement()
          Deprecated.  
 Category: Signed static int getHeight()
          Retrieves total drawing height of the display.
 Category: Signed static int getHorizontalResolution()
          Retrieve display's horizontal resolution in pixels per meter (PPM).
 Category: Colour Category: Signed static int getNumColors()
          Retrieve the number of colors that the device's screen can display.
 Category: Signed static int getProperties()
          Retrieve the display properties.
 Category: Signed static int getVerticalResolution()
          Retrieve display's vertical resolution in pixels per meter (PPM).
 Category: Signed static int getWidth()
          Retrieves total drawing width of the display.
 Category: Colour Category: Signed static boolean isColor()
          Determines if the device has a color display.
 Category: Signed static boolean isContrastConfigurable()
          Deprecated.  
 Category: Signed static boolean isRowwise()
          Determines if the device's display has rowwise orientation.
 Category: Signed static void screenshot(Bitmap bitmap)
          Takes a screenshot of the entire screen and saves it into a Bitmap.
 Category: Signed static void screenshot(Bitmap bitmap, int x, int y, int width, int height)
          Takes a screenshot of a portion of the screen and saves it into a Bitmap.
 Category: Signed static void setContrast(int contrast)
          Deprecated.  
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail


DISPLAY_PROPERTY_NO_SUBPIXELS

public static final int DISPLAY_PROPERTY_NO_SUBPIXELS
The display does not contain subpixels.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

DISPLAY_PROPERTY_REQUIRES_BACKLIGHT

public static final int DISPLAY_PROPERTY_REQUIRES_BACKLIGHT
The display requires the backlight to be on.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Method Detail

getContrast

public static int getContrast()
Deprecated.  

Retrieves the screen's current contrast setting.

Use this method to retrieve the screen's contrast setting. The returned value ranges from 0 (lightest / least) to 100 (darkest / most).

Returns:
Current contrast setting of the screen.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getContrastIncrement

public static int getContrastIncrement()
Deprecated.  

Retrieves the recommended percentage increment for display contrast.

Externally, we show display contrast as a percentage, but internally the range will vary between device types. The increment is rounded down to the nearest integer. For example, if the device range is 7, the increment would be 14.

Returns:
an increment between 1 and 100
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getHeight

public static int getHeight()
Retrieves total drawing height of the display.
Returns:
Height in pixels of the display's drawable area.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getHorizontalResolution

public static int getHorizontalResolution()
Retrieve display's horizontal resolution in pixels per meter (PPM).
Returns:
Horizontal resolution (PPM) of the display.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getNumColors

public static int getNumColors()
Retrieve the number of colors that the device's screen can display.
Returns:
Number of colors the screen can display.
Since:
JDE 4.0.0
Category:
Colour: Pertains to devices' ability to display colour. May only be applicable on colour devices.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getProperties

public static int getProperties()
Retrieve the display properties.
Returns:
A combination of the DISPLAY_PROPERTY_* values.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getVerticalResolution

public static int getVerticalResolution()
Retrieve display's vertical resolution in pixels per meter (PPM).
Returns:
Vertical resolution (PPM) of screen.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getWidth

public static int getWidth()
Retrieves total drawing width of the display.
Returns:
Width in pixels of the display's drawable area.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

isColor

public static boolean isColor()
Determines if the device has a color display.
Returns:
True if the device has a color display; otherwise, false.
Since:
JDE 4.0.0
Category:
Colour: Pertains to devices' ability to display colour. May only be applicable on colour devices.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

isContrastConfigurable

public static boolean isContrastConfigurable()
Deprecated.  

Retrieves whether or not the screen's contrast is configurable.
Returns:
whether or not the screen's contrast can be set
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

isRowwise

public static boolean isRowwise()
Determines if the device's display has rowwise orientation.
Returns:
True if the device has a rowwise display; otherwise, false.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

screenshot

public static void screenshot(Bitmap bitmap)
Takes a screenshot of the entire screen and saves it into a Bitmap.

The specified Bitmap must be the same dimensions as the screen. The width and height of the screen can be obtained from getWidth() and getHeight(), respectively, and the width and height of the Bitmap must be equal to these.

The type of the specified Bitmap must match the type of the screen. The following methods can be used to determine the screen's properties:

Parameters:
bitmap - The Bitmap into which the screenshot will be saved.
Throws:
ControlledAccessException - if the calling application is forbidden from taking screenshots by IT policy and/or application control.
IllegalArgumentException - if any of the following conditions are true:
  • bitmap is null
  • The dimensions of bitmap are not equal to the dimensions of the screen
  • The type of bitmap does not match the type of the screen
Since:
JDE 4.3.0
See Also:
screenshot(Bitmap, int, int, int, int)
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

screenshot

public static void screenshot(Bitmap bitmap,
                              int x,
                              int y,
                              int width,
                              int height)
Takes a screenshot of a portion of the screen and saves it into a Bitmap.

The dimensions of the specified Bitmap must be large enough to hold the specified region; that is, the width and height of bitmap must be at least the specified width and height, respectively.

The specified region (the box represented by x, y, width, and height) must be fully contained in the screen. This region will be copied into the specified Bitmap starting at (0, 0).

The type of the specified Bitmap must match the type of the screen. The following methods can be used to determine the screen's properties:

Parameters:
bitmap - The Bitmap into which the screenshot will be saved.
x - the x-coordinate of the screen that marks the top-left corner of the region to be copied.
y - the y-coordinate of the screen that marks the top-left corner of the region to be copied.
width - the width of the region of the screen to be copied.
height - the height of the region of the screen to be copied.
Throws:
ControlledAccessException - if the calling application is forbidden from taking screenshots by IT policy and/or application control.
IllegalArgumentException - if any of the following conditions are true:
  • bitmap is null
  • The dimensions of bitmap are not large enough to hold the specified region
  • The type of bitmap does not match the type of the screen
  • The value of any of the integer arguments are less than zero
  • The specified region is not fully contained on the screen
Since:
JDE 4.3.0
See Also:
screenshot(Bitmap)
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setContrast

public static void setContrast(int contrast)
Deprecated.  

Sets the display's current contrast setting.
Parameters:
contrast - New contrast value for screen.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.



Copyright 1999-2008 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.