3 Replies Latest reply on May 16, 2011 2:16 AM by Moussambani2

    Air app crashes or hangs while manipulating bitmapdata

    Moussambani2

      Hi,

       

      My air app behaves in 3 ways on the same piece of code, it crashes, hangs or works like charm. Here is a piece of the code that causes the problem (this is executed inside a few loops) folowed by the details on the last output the code produced and details on the crash:

       

       

      Code:
      trace("Free memory: " + System.freeMemory); // to check if it's a memory problem
      try   
      {

           // trace x,t height, width to check if the parameters of getPixel are valid
          trace("about getPixel(" + x + ", " + t + ") on source image with width = " + currentImageBitmap.width + " and height " + currentImageBitmap.height);
          var color:uint = currentImageBitmap.getPixel(x, t);
      } catch (e:Error)
      {
          trace("Error occurred: " + e.message);
      }
      trace("about to call getPixel(" + bundle + ", " + t + ")  from result image of width " + bitmap_data.width + " and height " + bitmap_data.height);
      if (color > bitmap_data.getPixel(bundle, t))
      {
          trace("about to call setPixel(" + bundle + ", " + t + ", " + color + ")  on result image of width " + bitmap_data.width + " and height " + bitmap_data.height);
          bitmap_data.setPixel(bundle, t, color);
      }

       

      Response 1:

      The adl has stopped working

       

      Problem signature:
        Problem Event Name:    APPCRASH
        Application Name:    adl.exe
        Application Version:    2.5.0.16600
        Application Timestamp:    4ca30eb6
        Fault Module Name:    Adobe AIR.dll
        Fault Module Version:    2.5.0.16600
        Fault Module Timestamp:    4ca30e16
        Exception Code:    c0000005
        Exception Offset:    001ce3cb
        OS Version:    6.1.7600.2.0.0.256.4
        Locale ID:    1033
        Additional Information 1:    0a9e
        Additional Information 2:    0a9e372d3b4ad19135b953a78882e789
        Additional Information 3:    0a9e
        Additional Information 4:    0a9e372d3b4ad19135b953a78882e789

       

      Read our privacy statement online:
        http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

       

      If the online privacy statement is not available, please read our privacy statement offline:
        C:\Windows\system32\en-US\erofflps.txt

       


      Last output:
      Free memory: 10371072
      about getPixel(1093, 1167) on source image with width = 2000 and height 1232

       

      Response 2:

       

      Problem: Adobe AIR Debug Launcher is not responding

       

      Last output:
      Free memory: 9531392

       


      Response 3:
      Works like a charm

       

      Here are some details on my installation:

      OS: Windows 7
      Flash builder: 4.0.0 (Premium)
      SDK: Flex SDK 4.5.0.17689 (Hero)

       

       

      Instead of using getPixel and setPixel I have also tried an implementation with getVector and setVector but this had basically the same result.

       

      Any help or hint to what I'm doing wrong would be very appreciated. I've been breaking my head over this for 2 days now.

       

      Bas