Hello. I have a problem with the bitmap merge. Where did I make a mistake? The image simply does not display in ImageView.
ShowExample.Click += (e, o) =>
{
LayoutInflater inflater = LayoutInflater.From(this);
View mview = inflater.Inflate(Resource.Layout.example, null);
Android.App.AlertDialog.Builder alertDialogBulider = new Android.App.AlertDialog.Builder(this);
alertDialogBulider.SetView(mview);
var imageView = mview.FindViewById<ImageView>(Resource.Id.imageView1);
//imageView.SetImageResource(Resource.Drawable.ExampleInterpolationPic);
string appPackageName = Application.Context.PackageName;
var path = Android.Net.Uri.Parse("android.resource://" + appPackageName + "/" + Resource.Drawable.ExampleInterpolationPic).Path;
File imgFile = new File(path);
if (imgFile.Exists())
{
BitmapFactory.Options i = new BitmapFactory.Options();
i.InSampleSize = 4; //This example will make image size 1/4 of it's normal, and 1/16 the number of pixels.
Bitmap bitmap = BitmapFactory.DecodeFile(imgFile.AbsolutePath, i);
imageView.SetImageBitmap(bitmap);
}
alertDialogBulider.SetCancelable(false).SetNegativeButton("Anuluj", delegate
{
alertDialogBulider.Dispose();
});
Android.App.AlertDialog alertDialogAndroid = alertDialogBulider.Create();
alertDialogAndroid.Show();
};
Is the error occurring in BitmapFactory metod?