Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/samafshari/RedCorners.Forms.CameraView

CameraView for Xamarin.Forms; a wrapper for RedCorners.Forms.ZXing with a nicer name
https://github.com/samafshari/RedCorners.Forms.CameraView

Last synced: 29 days ago
JSON representation

CameraView for Xamarin.Forms; a wrapper for RedCorners.Forms.ZXing with a nicer name

Awesome Lists containing this project

README

        

# RedCorners.Forms.CameraView

A CameraView for Xamarin.Forms (iOS and Android only), based on ZXing.Net by Redth.

To include the namespace in your XAML:

```
xmlns:rfc="clr-namespace:RedCorners.Forms;assembly=RedCorners.Forms.CameraView"
```

Then simply use it:

```

```

To take a photo:

```
await cameraView.CapturePhotoAsync(path);
```

Permissions are handled by Xamarin.Essentials on first use. You have to set up Xamarin.Essentials permissions in your projects.

# Example

```







```

```
public MainPage()
{
InitializeComponent();

titleView.BackCommand = new Command(() =>
{
previewImage.Source = null;
titleView.HasButton = false;
});
}

private async void Button_Clicked(object sender, EventArgs e)
{
var path = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"photo.jpg");

await cameraView.CapturePhotoAsync(path);

previewImage.Source = path;
titleView.HasButton = true;
}
```