cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shraddha113
New Member

Html canvas element in pcf control

Hi all,

 

I am trying to use HTML canvas element in pcf control by using typescript code. But, I cannot access canvas.toDataURL() function in pcf control. It gives me an error like:

Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.

I have also tried

 var mapCanvas = document.createElement('canvas'as HTMLCanvasElement;
but it gives same error.Can someone tell me the solution of these? Is pcf support canvas element?
 
Thanks!
3 REPLIES 3
Community Support
Community Support

Re: Html canvas element in pcf control

Hi @Shraddha113 ,

Do you want to export image by using command like this: canvas.toDataURL("image/png")?

If so, this is supported in pcf. The problem should be about your code.

You need to set crossOrigin for the image outside the onload function.

Here's a similar issue for your reference:

https://stackoverflow.com/questions/43310565/failto-execute-todataurl-on-htmlcanvaselement

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Shraddha113
New Member

Re: Html canvas element in pcf control

Hi,

Yes. I have try this also but it still gives the same error. So, is there some other way?

Community Support
Community Support

Re: Html canvas element in pcf control

Hi @Shraddha113 ,

Since I did not met the same problem before, I don't quite know where's the problem.

I'm sorry that I am not quite familiar with pcf, I suggest you open a ticket here:

https://powerapps.microsoft.com/en-us/support/pro/ticket/

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Users online (6,052)