File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,28 @@ camera.takePicture(options).
168168 });
169169```
170170
171+ ### Save a picture
172+
173+ To save a picture with the width & height that you have defined you must use the imageAsset and save it to the file system like so:
174+
175+ ``` TypeScript
176+ const source = new ImageSource ();
177+ source .fromAsset (imageAsset )
178+ .then ((imageSource : ImageSource ) => {
179+ const folderPath = knownFolders .documents ().path ;
180+ const fileName = " test.jpg" ;
181+ const filePath = path .join (folderPath , fileName );
182+ const saved: boolean = imageSource .saveToFile (filePath , " jpg" );
183+ if (saved ) {
184+ console .log (" Gallery: " + this ._dataItem .picture_url );
185+ console .log (" Saved: " + filePath );
186+ console .log (" Image saved successfully!" );
187+ }
188+ });
189+ ```
190+
191+ This could be used to create thumbnails for quick display within your application.
192+
171193### Check if the device has available camera
172194
173195The first thing that the developers should check if the device has an available camera.
You can’t perform that action at this time.
0 commit comments