Skip to main content
Participating Frequently
May 10, 2013
Question

Loading Large png Files iPad App - Image Distortion

  • May 10, 2013
  • 4 replies
  • 1028 views

I'm developing an iPad app that dymically loads many png files with transparency. I'm simply using the loader class, and for the most part it works fine.

A couple of the png files are very large. When they are loaded they seem to drop a straight line of pixels that spans the entire image horizontally.

Like the line of pixels was removed, then the image was squashed back together.

This "pixel dropping" is present several times on the image. It always appears in the same spots. I checked the original images, and they are fine. No pixel errors.
I've tried using jpg files, and I get the same result. They are not being scaled. They are being masked, but I tried removing the mask, and I get the same result.

I've tried changing the the stage quality with no effect. I'm only experiencing this on the really large images. I'm at a loss.

Any ideas?

This topic has been closed for replies.

4 replies

Colin Holgate
Inspiring
May 10, 2013

Do you have Allow Smoothing turned on for that object? So, when you load the bitmapdata you then make the bitmap this way:

var bitmap:Bitmap = new Bitmap(bitmapdata,"auto",true);

Without doing that the smoothing defaults to false, and pixels will get dropped when scaling the image.

jakeZ1000Author
Participating Frequently
May 10, 2013

I'm not scaling the images at all. I'm just importing them, and the user can drag them vertically.

I did try smotthing them though. At this point I'm willing to try anything. It did not help. I'm getting the same results.

Thanks for the suggestion. Any other ideas?

May 13, 2013

I had a similar problem, not missing pixel lines, but my images turned low quility, unreadable text.

1) Basic stuff, propapbly not the your of your trouble:

a) Is your stage scaled (scalemode) ?

b) Also check the bitmaps local->global scale after adding them to the display list, that is how the gfx-card sees your bitmap after all up/downscales are applied. If its not 1, that might be a hint.

trace( MatrixTransformer.getScaleX(myBitmap.transform.concatenatedMatrix) );

c) Also note (live docs):

In AIR 1.5 and Flash Player 10, the maximum size for a BitmapData object is 8,191 pixels in width or height, and the total number of pixels cannot exceed 16,777,215 pixels. (So, if a BitmapData object is 8,191 pixels wide, it can only be 2,048 pixels high.) In Flash Player 9 and earlier and AIR 1.1 and earlier, the limitation is 2,880 pixels in height and 2,880 in width.

2) If you import them from your lib, you could take the easy way out and simply split the Bitmap in Photoshop before importing and add several smaller bitmaps in one parent Sprite. A little more work, but save.

3) if 2) is not an option: Check if memory or displaying it is the problem.

a)  Initialize the bitmap.bitmapData, but dont add it to the DisplayList.

b) Use BitmapData.copyPixels() to draw several smaller chunks of the original image into several bitmaps and add them again in a parent Sprite. Try to include the area where the missing lines usually appear.

Good luck.