View Single Post
Old 09-03-2008, 05:03 AM   #4
Dan East
Thumbs Must Hurt
 
Join Date: Apr 2008
Model: 8130
PIN: N/A
Carrier: US Cellular
Posts: 82
Default

getBitmapResource is a static method, so you don't have to create a Bitmap object to use it. I'm only recently getting back into java coding, so I'm very rusty on variable scope and garbage collection, but you're passing an object to BitmapField that you do not keep in scope, so perhaps it is being destroyed by the GC?

Instead of this:
bmp = new Bitmap(taillehorizon , taillevertical);
picture = new BitmapField(bmp.getBitmapResource("Accueil.png"));

Do this:
bmp = Bitmap.getBitmapResource("Accueil.png");
picture = new BitmapField(bmp);

And make sure bmp is static or a member of your class.
Offline   Reply With Quote