Page 1 of 1

Pass canvas image to report

Posted: Tue Oct 01, 2019 2:17 pm
by ADev2000
I have a image I get from a canvas in the page. Like below..

var myimg = mycanvas.toDataURL("image/png");
document.write('<img src="' + myimg + '"/>');

How can I set myimg to a STIImage objects source?

Thank you in advance.

Re: Pass canvas image to report

Posted: Fri Oct 04, 2019 2:24 pm
by Lech Kulikowski
Hello,

Please check the following topic:
viewtopic.php?t=55583

Thank you.

Re: Pass canvas image to report

Posted: Fri Oct 04, 2019 3:06 pm
by ADev2000
Lech Kulikowski wrote: Fri Oct 04, 2019 2:24 pm Hello,

Please check the following topic:
viewtopic.php?t=55583

Thank you.
Thanks for the reply. In my situation I don't have the image in the file. I have an out of canvas.toDataURL("image/png");

Please share some sample code on how do I pass that information to a STIImage control. Thanks

Re: Pass canvas image to report

Posted: Wed Oct 09, 2019 9:00 am
by Lech Kulikowski
Hello,

We will try to find a solution for you, we need some time.

Thank you.

Re: Pass canvas image to report

Posted: Wed Oct 09, 2019 7:39 pm
by Lech Kulikowski
Hello,

You can use the following code:

Code: Select all

var sampleImage = new Stimulsoft.Report.Components.StiImage();
sampleImage.image = Stimulsoft.Base.Drawing.StiImageConverter.stringToImage("base64image");
Thank you.