Canvas icon indicating copy to clipboard operation
Canvas copied to clipboard

How to place and Image inside of the Canvas

Open ssuttonDev opened this issue 3 years ago • 1 comments

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>

ssuttonDev avatar Jan 25 '22 22:01 ssuttonDev

You can draw an image by just calling DrawImageAsync(ElementReference elementReference, double dx, double dy, ...)

_context.DrawImageAsync(_imageSelected, 0, 0);

LeonSpors avatar Feb 23 '22 10:02 LeonSpors