0 Replies Latest reply on Oct 29, 2010 11:22 AM by zantera

    Manipulating large images in Air 2

    zantera

      Hi everybody,

      I have a Flex app that I am converting to Air that performs a ColorTransform on
      a canvas and its contents. The canvas is 4400x3400.

      In the Flex app running in Firefox (with Flash Player 10.1), the ColorTransform
      works perfectly. In the Air app, however, it stops at the old size limit of
      2880.

      I can output the current Flash version and Air runtime and they both check out
      (WIN 10,1,53,64 ; 2.0.2.12610 respectively), meaning I should be able to work
      with a display object larger than 2880. Is there an issue with Air in this
      regard? Or, is there a setting in FlexBuilder that I am missing?

      Following is my test code.

      Thanks in advance.

      --D.

       

       

      ========== TesterAir.mxml ==========

      <?xml version="1.0" encoding="utf-8"?>
      <mx:WindowedApplication
          xmlns:mx="http://www.adobe.com/2006/mxml"
          layout="absolute"
          width="1024" height="768">

       


          <mx:Script>
              <![CDATA[
                  public static function makeGrayscale(displayObject:DisplayObject, cmfAlpha:Number = 1):void {
                      var cmf:ColorMatrixFilter = new ColorMatrixFilter([0.2, 0, 0, 0,        20,
                                                                         0,   0, 0, 0,        20,
                                                                         0,   0, 0, 0,        20,
                                                                         0,   0, 0, cmfAlpha, 0]);

       

                      displayObject.filters = [ cmf ];
                  }
              ]]>
          </mx:Script>

       


          <mx:Canvas id="cvs"

                  resize="makeGrayscale(cvs)"

                  width="{n_stpr.value}" minWidth="500" height="{n_stpr.value}" minHeight="500"

                  backgroundColor="#FF0000">
              <mx:Label text="Air version: {NativeApplication.nativeApplication.runtimeVersion}"

                      fontSize="36" x="200" y="240"/>
              <mx:Label text="Flash version: {Capabilities.version}" fontSize="36" x="200" y="300"/>
              <mx:NumericStepper id="n_stpr" value="2875" stepSize="1" maximum="3500"

                      fontSize="36" width="200" x="200" y="360"/>
          </mx:Canvas>
      </mx:WindowedApplication>





      ========== TesterAir-app.xml ==========

      <?xml version="1.0" encoding="UTF-8"?>
      <application xmlns="http://ns.adobe.com/air/application/2.0">


      ...


      </application>