Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4104] Android: Expose Window Pixel Format

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-08-29T10:32:50.000+0000
Affected Version/sRelease 1.7.0
Fix Version/sSprint 2011-32, Release 1.8.0
ComponentsAndroid
Labelsmodule_window, qe-testadded
ReporterDawson Toth
AssigneeDon Thorp
Created2011-05-16T09:41:02.000+0000
Updated2013-12-02T09:14:53.000+0000

Description

The Problem

If your window uses images with gradients, the gradients can appear very blocky.

The Solution

Expose the "setFormat" method of a native Android window, and allow it to be set to PixelFormat.RGBA_8888 or PixelFormat.OPAQUE [default].

For More Information

You can read more about the problem and solution here: http://stuffthathappens.com/blog/2010/06/04/android-color-banding/

Associated Helpdesk Ticket

http://appc.me/c/QZP-88323-317

Attachments

FileDateSize
gradient.png2011-08-14T13:09:01.000+000028523

Comments

  1. Don Thorp 2011-08-14

    You'll need the gradient.png to test it.
       var w = Ti.UI.createWindow({
       	navBarHidden: false,
       	exitOnClose: true,
       	backgroundImage: 'gradient.png',
       	windowPixelFormat: Ti.UI.Android.PIXEL_FORMAT_RGB_565
       });
       
       var v = Ti.UI.createImageView({
       	image: "KS_nav_ui.png"
       });
       
       var b1 = Ti.UI.createButton({
       	title: "RGB_565",
       	bottom: 10,
       	left: 10,
       	width: 100,
       	height: 'auto'
       });
       b1.addEventListener('click', function() {
       	w.windowPixelFormat = Ti.UI.Android.PIXEL_FORMAT_RGB_565;
       });
       
       var b2 = Ti.UI.createButton({
       	title: "RGBA_8888",
       	bottom: 10,
       	right: 10,
       	width: 100,
       	height: 'auto'
       });
       b2.addEventListener('click', function() {
       	w.setWindowPixelFormat(Ti.UI.Android.PIXEL_FORMAT_RGBA_8888);
       });
       
       w.add(v);
       w.add(b1);
       w.add(b2);
       w.open();
       
  2. Michael Pettiford 2012-02-08

    Closing issue Tested with Ti Studio build 1.0.8.201201262211 Ti Mob SDK 1.9.0.v20120207171634 OSX Lion 10.7.3 Nexus S OS 2.3.6 Verified expected behavior is shown

JSON Source