- This topic has 39 replies, 2 voices, and was last updated 6 years, 1 month ago by
Yuri Kovelenov.
-
AuthorPosts
-
2019-09-11 at 3:46 pm #18599
ManuelCustomerHi
I want to add a button to save the current view of a object to a jpg file
Is it possible?
Thanks
2019-09-12 at 7:27 am #18604
Yuri KovelenovStaffHi,
You can use the take screenshot puzzle for that (also need to enable screenshots with configure app puzzle). It only generates the image though. To be able to download it, you can use the following JavaScript snippet
app.ExternalInterface.downloadScreenshot = function(image) { var link = document.createElement('a'); link.setAttribute('download', 'myImage.png'); link.setAttribute('href', image); link.click(); }and call it from Puzzles as described here.

Attached an example project.
2019-09-12 at 7:35 am #18609
Yuri KovelenovStaff2019-09-12 at 9:31 am #18614
ManuelCustomerThanks a lot
The only problem now, is that i get a black image :-S
Any idea that can be?
Thanks
2019-09-12 at 9:38 am #18615
Yuri KovelenovStaffalso need to enable screenshots with configure app puzzle)
:)
2019-09-12 at 9:39 am #18616
ManuelCustomerFixed!
Sorry, i hadn’t checked the option in initialization panel ^^
Thanks
2019-09-12 at 9:44 am #18618
ManuelCustomerNow i see that, another question…
Is there any possibility to change the background automatically or make it transparent when you save the pic?
Thks again ^^
2019-09-12 at 9:46 am #18620
Yuri KovelenovStaffTry the transparent background option in the same puzzle: https://www.soft8soft.com/docs/manual/en/puzzles/Initialization.html#configure_application
2019-09-12 at 10:12 am #18623
ManuelCustomerTry the transparent background option in the same puzzle: https://www.soft8soft.com/docs/manual/en/puzzles/Initialization.html#configure_application
As i have a sphere background, i solve it like this (look attached file)
Is there any cleaner form to do it?
Because here, i depend of cpu speed, i suppose isn’t it?
2019-09-12 at 10:18 am #18625
Yuri KovelenovStaff2019-09-12 at 10:30 am #18628
ManuelCustomerYep, you can use 0 second time to make it lapse only 1 rendering frame.
I tested it, but i doesn’t work :-S
2019-09-12 at 10:56 am #18634
Yuri KovelenovStaff2019-09-12 at 11:42 am #18636
ManuelCustomerWhat does it produce? non-transparent background?
Correct!
It seems that with “0” value, there’s no time to grab the transparent backgroud.
2019-09-12 at 12:56 pm #18637
Yuri KovelenovStaff2019-09-13 at 2:40 pm #18698
ManuelCustomeryou can try another approach – using the every frame puzzle with a counter to wait for 1 or 2 rendering frames.
I don’t know how to use it, as i can’t puzzle it into my “click” function :-S
-
AuthorPosts
- You must be logged in to reply to this topic.

