Pass canvas image to report

Stimulsoft Reports.JS discussion
Post Reply
ADev2000
Posts: 5
Joined: Tue Jul 16, 2019 8:36 pm

Pass canvas image to report

Post 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.
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Pass canvas image to report

Post by Lech Kulikowski »

Hello,

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

Thank you.
ADev2000
Posts: 5
Joined: Tue Jul 16, 2019 8:36 pm

Re: Pass canvas image to report

Post 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
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Pass canvas image to report

Post by Lech Kulikowski »

Hello,

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

Thank you.
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Pass canvas image to report

Post 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.
Post Reply