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.
|