Sun Microsystems Computer Accessories manual Screen Pixel Ratio, Screen Background Color

Page 41

Referring to the right image in FIGURE 5, the full screen display area is defined as the upper left coordinate of the display area, (screenPaintableRegion.x, screenPaintableRegion.y), and the bottom right coordinate of the screen area (screen.x+screen.width, screen.y+screen.height).

Customization of the display area will be available in future versions of the Wireless Toolkit.

Screen Pixel Ratio

The following commands enable you to compensate for the difference in aspect ratio between the actual device screen and the device image on the PC screen.

The pixel size ratio property defines the number of pixels in the device’s PC image that correspond to a single pixel on the real device in both the horizontal and vertical direction.

Note – MIDP requires that pixels be square. Therefore, you should only use pixel ratios that preserve the square, for example, x:y = 2:2 or 3:3 (that is, magnifying the image), and you should not use pixel ratios that distort the square, for example, x:y = 1:2 or 2:1.

The ratios are defined as follows:

screenPixelRatio.x = horizontal_image_pixels/ horizontal_device_pixels

screenPixelRatio.y = vertical_image_pixels/vertical_device_pixels

For most devices, use the following values:

screenPixelRatio.x = 1 screenPixelRatio.y = 1

The values of screenPixelRatio.x and screenPixelRatio.y must be whole numbers.

Screen Background Color

For a device with a grayscale screen, the background color of the screen can be set. The color is defined as a hexadecimal integer according to the standard Java color map. That is, the integer has the form RRGGBB, where RR, GG, and BB are the red, green and blue components of the color, respectively. For example, white would be 0xffffff and red would be 0xff0000.

The background color is defined with the property screenBGColor.

For example:

screenBGColor = 0x64b890

Chapter 3 Examining Device Property Files 27

Image 41
Contents Basic Customization Guide Please Contents Examining Device Property Files Default Emulator Device Property Files Vi Wireless Toolkit Basic Customization Guide December Figures Viii Wireless Toolkit Basic Customization Guide December Tables Wireless Toolkit Basic Customization Guide December How This Book Is Organized Who Should Use This BookUsing Operating System Commands Related Documentation Typographic ConventionsShell Prompts Sun Welcomes Your Comments Accessing Sun Documentation OnlineHow to Customize the Wireless Toolkit Customizing the Wireless ToolkitCustomization Steps Device Property Files and the Default EmulatorCustomizing the Wireless Toolkit Wireless Toolkit Basic Customization Guide December Make a Copy of an Existing Main Device Property File Creating Device Property FilesObtain and Enter Image Files Screen Location Obtain and Enter the Screen PropertiesDisplay Area Total Screen SizeSpecifying Screen Properties Display Area in Full Screen ModeBy measuring the image file, obtain the button properties Obtain and Enter the Button PropertiesHeight Width Obtain and Enter Soft Button Label Areas Soft button label display is defined by a line of the form Defining the Icon Location and States Obtain and Enter Icon PropertiesEnter the following measured values for the icons properties Screen Background RGB Color Enter Color PropertiesRun the Emulator for the New Device Examining Device Property Files Device Property Files Fonts Used by the Midp APIs Main Device Property FileFonts Bitmap Fonts Default FontSystem Fonts Ascii character Distance to character Device Image Font UnderliningImage with Buttons Pressed Image without Buttons PressedImage with Buttons Highlighted and Backlight On ScalingScreen Properties Screen Location Display Area Display Area in Full Screen ModeTotal Screen Size Screen Background Color Screen Pixel RatioScreen Buffering Screen Border ColorTouch Screen Defining a Device Button Device ButtonsKeyboard Handler Button.LEFT = 13, 197, 20 Assigning a PC Keyboard Key to a Button Specifying the Characters Generated by a Button Press Assigning a Game Action to a ButtonAbstract Command Types in Order of Precedence Assigning Abstract Commands to ButtonsEmulating Abstract Command Button Assignments Precedence of Assigning Commands to a Button Secondary Button Assignments Abstract Command Menu Defining the Icon Location and States Displayed IconsSoft Button Labels on the Emulated Device Display Soft Button Label DisplaySound Alerts ColorAlert Type Values Device Software CapabilitiesCharacter Encodings LocalesTransparent Images EnableAlphaChannel falseWireless Toolkit Basic Customization Guide December Property Files Default Emulator Device Property FilesDefaultGrayPhone.properties Appendix a Default Emulator Device Property Files Wireless Toolkit Basic Customization Guide December Appendix a Default Emulator Device Property Files Wireless Toolkit Basic Customization Guide December # alert.alerttype.sound soundfile Wireless Toolkit Basic Customization Guide December Icon Image Files Device Image FilesIcon Image Files Adding a ByteCode Obfuscator Support for ByteCode ObfuscatorsExample Appendix B Support for ByteCode Obfuscators Wireless Toolkit Basic Customization Guide December P E N D I X C Wireless Toolkit Basic Customization Guide December Index Keyboard.handler property Device property files, 1 WMA messages, customizing Wireless Toolkit Basic Customization Guide December