[open] load image from any path (not only pool)
Is there any way to load an image to a canvas from another path which is not the pool?
why?
I see that the createCanvas-> copyFromOtherCanvas ->drawSomething-> showCanvas takes a lot, specially if the canvas I am copying from has lots of elements. I saw instead that if I load a static image instead of copying the canvas is much more faster. So basically I wanted to:
canvas1=self.offline_canvas()
canvas2=self.offline_canvas()
canvas1.copy(exp.items['mysketchpad']
canvas1.text("some new text")
canvas1._canvas.save("c:\\temp\canvas1.png")
canvas2.image(loadSomeHow"c:\\temp\canvas1.png",x=0,y=0)
canvas2.show()
thanks!
Comments
Hi,
Yes, there is a way and it is super straightforward. Actually, you have it already. This line:
canvas2.image(loadSomeHow"c:\\temp\canvas1.png",x=0,y=0)should do the trick ( Of course if you remove the "loadSomeHow" part).However, the
canvas.savefunction is new to me. I haven't known that it exists. If it does, you could alternatively also fetch the path of thefilepooland save your screenshots to that location, so that you can load them from there:path = exp.pool_folderGood luck,
Eduard