How do I draw a dynamically created image on the Blazor Canvas?
Posted 3 years ago
by edhalsim
Hi,
I'm using the Blazor Canvas extensions. What I need to do is show a button on the page. When the user clicks the button, I need to:
- Dynamically generate a random map (I have this code).
- Show an image of the map on the Blazor Canvas
I can use an <img> to show the image e.g.: <img @ref="ImageMap" src=@Image64> and generate that image on button click (that works fine), but then I don't know how to show it in the Canvas itself. I've tried drawImage to no avail (or perhaps I have the call the drawImage in the wrong place).
If anyone can offer some advice, I'd really appreciate it as I've been working on this for the past week with no success.
Thanks.
- Ed.
Someone is typing...
Post a Reply
You must be logged in to add a new post.
Number of online users: 1