3 Replies Latest reply on Oct 10, 2011 10:39 AM by JoeFlexDev

    Camera displays pink hue/color distortion when accessed in Flex Mobile Application on Android

    JoeFlexDev

      Hi All,

      I'm using Flash Builder 4.5.1 and testing out camera capabilites using super simple code just to see that it works, but I've enctountered a bug I can't fix.

       

      Bug Description

      When I debug on the desktop using the webcam everything works fine, but when I test my application on a Samsung Galaxy S2 (Android) the displayed image colors are distorted - all bright colors have a pinkish hue.

      • The problem occurs in when debugging and when running a final release build.
      • I've set the camera permissions for the project.
      • The device camera works just fine when tested in the device's native Camera application.

       

      Application Code

      This is the entire code of my application:

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                                       xmlns:s="library://ns.adobe.com/flex/spark"
                                       xmlns:local="*"
                                       xmlns:assets="assets.*"
                                       applicationDPI="240" xmlns:mx="library://ns.adobe.com/flex/mx"
                                       creationComplete="init()">
                <fx:Script>
                          <![CDATA[
                                    import mx.core.UIComponent;
                                    import mx.events.FlexEvent;
        
                                    protected function init():void
                                    {
                                              var camera:Camera = Camera.getCamera();
                                              if(camera)
                                              {
                                                        var ui:UIComponent = new UIComponent();
                                                        var video:Video = new Video(320,320);
                                                        camera.setMode(320,320,24);
                                                        video.attachCamera(camera);
                                                        ui.addChild(video);
                                                        cameraGroup.addElement(ui);
                                              }
                                    }
        
                          ]]>
                </fx:Script>
                <s:Group id="cameraGroup" width="320" height="320" />
      </s:Application>
      
      

       

      Bug Example (Screenshot taken from Android device)

      screenshot.JPG

       

      Does anyone know how to fix this problem? Help !

       

      Thanks!