I think that saving a file from a web app will always save to the Downloads folder (otherwise a website could compromise the local file system).
The attached is a small improvement. There is a new WebCamera fcpx component, and the ".fcweb" file is an example that sets the aspect ratio of the snapshot image to the same as the video and also saves the image (to the "Downloads" folder).
App Developer: USB Webcam Component
-
Steve-Matrix
- Matrix Staff
- Posts: 1929
- http://meble-kuchenne.info.pl
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 286 times
- Been thanked: 448 times
Re: App Developer: USB Webcam Component
- Attachments
-
- WebCamera.fcpx
- (3.32 KiB) Downloaded 10 times
-
- WebCamera.fcweb
- (18.79 KiB) Downloaded 10 times
-
stefan.erni
- Valued Contributor
- Posts: 1245
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 230 times
- Been thanked: 247 times
Re: App Developer: USB Webcam Component
it's working very nice
The buttons can also be placed in the image, also the photo you've taken can be smal in the imagel.
To save the photo immediately, all I have to do is enter the macro command.
Autosave: The files are perfect.
I have a small problem with the time—it's showing two hours too early, and I haven't been able to find a setting to fix it.
The buttons can also be placed in the image, also the photo you've taken can be smal in the imagel.
To save the photo immediately, all I have to do is enter the macro command.
Autosave: The files are perfect.
I have a small problem with the time—it's showing two hours too early, and I haven't been able to find a setting to fix it.
-
Steve-Matrix
- Matrix Staff
- Posts: 1929
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 286 times
- Been thanked: 448 times
Re: App Developer: USB Webcam Component
Thanks, Stefan.
The date is UTC. Here is some code that will hopefully set the filename to the local time. This will replace the code int he first icon in the OnSaveImageClick macro.
The new lines are the 2 after the comment "adjust for local time".
The date is UTC. Here is some code that will hopefully set the filename to the local time. This will replace the code int he first icon in the OnSaveImageClick macro.
Code: Select all
var currentdate = new Date();
//adjust for local time
var offset = currentdate.getTimezoneOffset();
currentdate.setTime(currentdate.getTime() - (offset*60*1000));
FCL_SFILENAME = currentdate.toISOString();
FCL_SFILENAME = FCL_SFILENAME.replaceAll("T", "_");
FCL_SFILENAME = FCL_SFILENAME.replaceAll(":", "-");
FCL_SFILENAME = FCL_SFILENAME.substring(0, 19);
FCL_SFILENAME = "PIC_" + FCL_SFILENAME + ".png"
The new lines are the 2 after the comment "adjust for local time".
-
chipfryer27
- Valued Contributor
- Posts: 2008
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 440 times
- Been thanked: 655 times
Re: App Developer: USB Webcam Component
Hi Steve / Stefan
Very interesting posts.
Keen to hear more on how you get on as I think this will be a great component once released.
Regards
Very interesting posts.
Keen to hear more on how you get on as I think this will be a great component once released.
Regards