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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 | Versions 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.
-
MonoAndroid 8.0
- RedCorners.Forms.ZXing (>= 8.47.3)
- Xamarin.Android.Support.v7.AppCompat (>= 28.0.0.3)
- Xamarin.Essentials (>= 1.3.1)
- Xamarin.Forms (>= 4.4.0.991640)
-
Xamarin.iOS 1.0
- RedCorners.Forms.ZXing (>= 8.47.3)
- Xamarin.Essentials (>= 1.3.1)
- Xamarin.Forms (>= 4.4.0.991640)
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 | 620 | 5/20/2020 |
A CameraView control for Xamarin.Forms (iOS and Android), based on ZXing.Net by Redth