Je dessine un bitmap avec canvas.drawBitmap(bmp, 0, 0, null);
à ma toile et le bitmap ne s'affichera pas. Des idées?Bitmap n'est pas sur le canevas après le dessin
Merci!
Bitmap bmp = BitmapFactory.decodeFile(myfile.getPath());
//Bitmap bmp = BitmapFactory.decodeStream(bis);
Log.i(TAG, "builded Bitmap");
Log.i(TAG, "scaling bitmap...");
//int scale;
//Matrix matrix = new Matrix();
//matrix.setScale(0.1F, 0.1F);
//if (bmp.getWidth() < bmp.getHeight()){
// scale = canvas.getWidth()/bmp.getWidth();
//}else{
// scale = canvas.getHeight()/bmp.getHeight();
//}
//matrix.postScale(scale, scale, bmp.getWidth(), bmp.getHeight());
//matrix.postScale(0.5F, canvas.getWidth()/bmp.getWidth());
//Bitmap bmp2 = Bitmap.createScaledBitmap(bmp, canvas.getWidth(), canvas.getHeight(), true);
//Paint p = new Paint();
//p.setFilterBitmap(true);
//try{
bmp = Bitmap.createScaledBitmap(bmp, canvas.getWidth(), canvas.getHeight(), true);
Log.i(TAG, "scaled");
Log.i(TAG, "showing bitmap...");
canvas.drawBitmap(bmp, 0, 0, null);
Log.i(TAG, "showed bitmap");
Si je dessine une ligne après avoir dessiné le bitmap cela fonctionne! Je ne peux pas appeler invalider sur la vue parce que je n'ai pas de vue, c'est un fond en direct – nomoral