Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Android.Widget.ImageView to Xamarin.Forms.Image

$
0
0

I want to tranfer my project from Xamarin.Android to Xamarin.Forms.

In Xamarin.Android I wrote:

ImageView imageView = new ImageView(context);
bitmap = Bitmap.CreateBitmap(100, 100, Bitmap.Config.Argb8888);
bitmap.EraseColor(Color.Transparent);
Canvas canvas = new Canvas(bitmap);
imageView.SetImageBitmap(bitmap);
relativeLayout.AddView(imageView);

How i can convert this ImageView to Xamarin.Forms.Image?

Xamarin.Forms.RelativeLayout relativeLayout = new Xamarin.Forms.RelativeLayout();
relativeLayout.Children.Add((Xamarin.Forms.Image)imageView); //ERROR

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>