Canvas
Canvas copied to clipboard
How to place and Image inside of the Canvas
I am looking for an example that places an image into the canvas. Something like the following where the the contents from the img tag is draw into the canvas. Is this possible?
<img @ref="imageSelected" id="imageSelected" src="@SelectedImage.Base64JPGImage" alt="@SelectedImage.DisplayedName" hidden >
<BECanvas Width="300" Height="700" @ref="_canvasReference"> </BECanvas>
You can draw an image by just calling DrawImageAsync(ElementReference elementReference, double dx, double dy, ...)
_context.DrawImageAsync(_imageSelected, 0, 0);