Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,28 @@ camera.takePicture(options).
});
```

### Save a picture

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:

``` TypeScript
const source = new ImageSource();
source.fromAsset(imageAsset)
.then((imageSource: ImageSource) => {
const folderPath = knownFolders.documents().path;
const fileName = "test.jpg";
const filePath = path.join(folderPath, fileName);
const saved: boolean = imageSource.saveToFile(filePath, "jpg");
if (saved) {
console.log("Gallery: " + this._dataItem.picture_url);
console.log("Saved: " + filePath);
console.log("Image saved successfully!");
}
});
```

This could be used to create thumbnails for quick display within your application.

### Check if the device has available camera

The first thing that the developers should check if the device has an available camera.
Expand Down