question

AGAI-1146 avatar image
0 Votes"
AGAI-1146 asked YijingSun-MSFT edited

how to display image by canvas in MVC

How to display image by canvas in MVC.
Thanks.

dotnet-aspnet-mvc
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Forgot to say, I want to display local pictures,thanks

0 Votes 0 ·

1 Answer

YijingSun-MSFT avatar image
0 Votes"
YijingSun-MSFT answered YijingSun-MSFT edited

Hi @AGAI-1146 ,
I suggest you could use drawImage() method in the Canvas context with ajax. You could set up a controller method that returns your image url as a result.And then you could use the drawImage() method in the Canvas context to draw the image on the Canvas using ajax jquery.

About ajax jquery,you could refer to below article:
https://api.jquery.com/jquery.ajax/

I have created a demo just like this and you could refer to :
120455-new-text-document-9.txt
Best regards,
Yijing Sun


If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our  documentation  to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.