Instead of writing a loop like this you can just call Bitmap.eraseColor(). It's much more efficient.
On Sun, Dec 9, 2012 at 11:55 AM, GJTorikian <[email protected]> wrote: > All right, so after days I finally figured it out. > > After creating my bitmap, I need to set every pixel in Java: > > for (int x = 0; x < 254; x++) { > for (int y =0; y < 254; y++) { > bmp.setPixel(x, y, Color.argb(255, 0, 0, 0)); > } > } > > > The question is: WHY only for ICS? > > On Wednesday, December 5, 2012 4:07:38 PM UTC-8, GJTorikian wrote: >> >> Hi there— >> >> I'm making updates to a live wallpaper I've developed. The wallpaper is >> currently running correctly on a 2.2 device, but NOT on my 4.2 device. >> >> On the ICS device, it seems that only the last column is being correctly >> drawn. For example, in a coordinate system, if my phone is 420 x 720 (not >> sure of the exact dimensions), then only pixels (420, 0) through (420, 720) >> are being drawn. The rest is black / transparent. >> >> Here's the code I'm using: https://github.com/** >> gjtorikian/Earthbound-Battle-**Backgrounds/blob/master/src/** >> com/miadzin/livewallpaper/**earthbound/**EarthboundLiveWallpaper.java#** >> L243<https://github.com/gjtorikian/Earthbound-Battle-Backgrounds/blob/master/src/com/miadzin/livewallpaper/earthbound/EarthboundLiveWallpaper.java#L243> >> >> First, I draw a 256 x 256 bitmap. Then, I use a matrix to scale it. >> >> Again, this works fine on a non-ICS device. Another tricky aspect is that >> I'm using the JNI to do some of the bitmap math, but I still think the >> problem is in this canvas code somewhere. >> >> Thanks for any help! >> > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer [email protected] -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

