Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Create drawing


I have a simply problem, but I guess the solution will be not simple...

I have an image on a Page
<Image x:Name="testImage" Source="testImage"></Image>

And I would like to put a drawed layer (some shapes) to testImage with opacity so the testImage would be lower and the layer would be the upper. But I should make new image or drawing or bitmap, beacuse the layer is not a file.. But I don't know how I should do this?

I think I should create a bitmap, after then I should draw some shape, and after then how can I put this bitmap onto the testImage?

I tried the next:

Android.Graphics.Bitmap bitmap = Android.Graphics.Bitmap.CreateBitmap(200, 100, Bitmap.Config.Argb8888);
Xamarin.Forms.Image img = new Xamarin.Forms.Image();

but img.Source = bitmap is not ok, beacuse img.Source would be an ImageSource instance, but where is the conversion between bitmap and ImageSource?

If you are know javascript there is the canvas tag, and I can put a canvas onto an existed div . (for example)

Thank you very much.

Best Answer


Sign In or Register to comment.