https://github.com/doo/scanbot-image-picker-xamarin
Xamarin Image Picker for Android and iOS
https://github.com/doo/scanbot-image-picker-xamarin
Last synced: 3 months ago
JSON representation
Xamarin Image Picker for Android and iOS
- Host: GitHub
- URL: https://github.com/doo/scanbot-image-picker-xamarin
- Owner: doo
- License: mit
- Created: 2020-02-17T14:38:22.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-04T14:04:53.000Z (over 2 years ago)
- Last Synced: 2025-05-31T09:33:21.747Z (about 1 year ago)
- Language: C#
- Size: 823 KB
- Stars: 0
- Watchers: 11
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## Scanbot Image Picker for Xamarin Native & Forms
A tool to simplify and unify image picking from from the gallery. No more discrepancies between platforms, no more `OnActivityResult`, `resultCode`, `FinishedPickingMedia`. No messing with permissions, no launching controllers or starting activities – **Pick & Go**.
Available as nuget packages for [Xamarin](https://www.nuget.org/packages/Scanbot.Xamarin.ImagePicker/) and [Xamarin.Forms](https://www.nuget.org/packages/Scanbot.Xamarin.Forms.ImagePicker/)
### Usage
#### Droid
```cs
Bitmap bitmap = await Scanbot.ImagePicker.Droid.ImagePicker.Instance.Pick();
```
#### iOS
```cs
UIImage image = await Scanbot.ImagePicker.iOS.ImagePicker.Instance.Pick();
```
#### Forms
```c#
ImageSource source = await Scanbot.ImagePicker.Forms.ImagePicker.Instance.Pick();
```
**Quirk**: Depending on your target framework and Xamarin.Forms version, this may throw a `NullReferenceException`. That means native dependcendies weren't properly referenced. In that case, add the following to your `AppDelegate` and `MainActivity`, respectively:
```c#
Scanbot.ImagePicker.Forms.Droid.DependencyManager.Register();
```
```C#
Scanbot.ImagePicker.Forms.iOS.DependencyManager.Register();
```
### Contributing
Contributions in the form of **issues**, **pull requests** and **suggestions** are very welcome.
### Disclaimer
This package is still in beta and should be used with that in mind. It is volatile. It has not been thorougly tested, all use cases are definitely not covered, breaking changes will happen without much notice.
### License
[MIT](LICENSE.md)