hta9wa
-
5 mars 2013 à 17:13
BunoCS
Messages postés15475Date d'inscriptionlundi 11 juillet 2005StatutModérateurDernière intervention23 avril 2024
-
5 mars 2013 à 20:54
bonjour,
je veux afficher un bitmap sur android
mais j'ai pas réussir. voilà mon code
veuillez m'aide SVP
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.filtre_main);
File imageFile = new File("C:/Users/DELL/Desktop/image.jpg");
if (imageFile.exists())
{
// Load the image from file
bit = BitmapFactory.decodeFile("C:/Users/DELL/Desktop/image.jpg");
// Display the image in the image viewer
img = (ImageView)findViewById(R.id.img);
if (img != null)
{
img.setImageBitmap(bit);
}
}
}