RedCorners.Forms.CameraView 8.47.0

dotnet add package RedCorners.Forms.CameraView --version 8.47.0
NuGet\Install-Package RedCorners.Forms.CameraView -Version 8.47.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RedCorners.Forms.CameraView" Version="8.47.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RedCorners.Forms.CameraView --version 8.47.0
#r "nuget: RedCorners.Forms.CameraView, 8.47.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install RedCorners.Forms.CameraView as a Cake Addin
#addin nuget:?package=RedCorners.Forms.CameraView&version=8.47.0

// Install RedCorners.Forms.CameraView as a Cake Tool
#tool nuget:?package=RedCorners.Forms.CameraView&version=8.47.0

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:

<rfc:CameraView x:Name="cameraView" />

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

<rf:TitledContentView Title="RedCorners.Forms.CameraView" HasButton="False" x:Name="titleView">
	<rf:TitledContentView.ToolBar>
		<Button Visual="Default" BackgroundColor="Transparent" Text="Capture" Clicked="Button_Clicked" TextColor="White" />
	</rf:TitledContentView.ToolBar>
	<Grid>
		<rfc:CameraView x:Name="cameraView" />
		<Image x:Name="previewImage" Aspect="AspectFill" />
	</Grid>
</rf:TitledContentView>
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;
}
Product Compatible and additional computed target framework versions.
MonoAndroid monoandroid80 is compatible. 
Xamarin.iOS xamarinios10 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.47.0 553 5/20/2020

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