FormsCameraView.Droid
1.0.0
dotnet add package FormsCameraView.Droid --version 1.0.0
NuGet\Install-Package FormsCameraView.Droid -Version 1.0.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="FormsCameraView.Droid" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FormsCameraView.Droid --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: FormsCameraView.Droid, 1.0.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 FormsCameraView.Droid as a Cake Addin
#addin nuget:?package=FormsCameraView.Droid&version=1.0.0
// Install FormsCameraView.Droid as a Cake Tool
#tool nuget:?package=FormsCameraView.Droid&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
FormsCameraPreview
To install Add FormsCameraPreview in Forms project Add FormsCameraPreview.iOS in your iOS project Add FormsCameraPreview.Driod in your Android project
To use:
Add the view in your xaml:
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:FormsCameraView"
x:Class="FormsCameraView.MainPage">
<StackLayout Spacing="0">
<local:CameraView x:Name="cameraView" VerticalOptions="FillAndExpand" Margin="0"/>
<Image x:Name="imageResult" IsVisible="false" VerticalOptions="FillAndExpand" Margin="0" Aspect="AspectFill"/>
<Button x:Name="takeButton" Text="Take Photo" Clicked="Handle_Clicked"/>
<Button x:Name="retakeButton" Text="Retake Photo" IsVisible="false" Clicked="Handle_Clicked"/>
</StackLayout>
</ContentPage>
Handle OnPhotoTaken event from the backing class. Example:
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
cameraView.OnPhotoTaken += (sender, e) =>
{
if (e.Success)
{
imageResult.Source = ImageSource.FromStream(() => new MemoryStream(e.Image));
cameraView.IsVisible = false;
takeButton.IsVisible = false;
imageResult.IsVisible = true;
retakeButton.IsVisible = true;
cameraView.Stop();
}
};
}
void Handle_Clicked(object sender, System.EventArgs e)
{
if (sender == takeButton)
{
cameraView.TakePhoto();
}
else if (sender == retakeButton)
{
cameraView.IsVisible = true;
takeButton.IsVisible = true;
imageResult.IsVisible = false;
retakeButton.IsVisible = false;
cameraView.Resume();
}
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
MonoAndroid | monoandroid81 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
MonoAndroid 8.1
- FormsCameraView (>= 1.0.0)
- Xamarin.Android.Support.Design (>= 27.0.2.1)
- Xamarin.Android.Support.v4 (>= 27.0.2.1)
- Xamarin.Android.Support.v7.AppCompat (>= 27.0.2.1)
- Xamarin.Android.Support.v7.CardView (>= 27.0.2.1)
- Xamarin.Android.Support.v7.MediaRouter (>= 27.0.2.1)
- Xamarin.Forms (>= 3.2.0.871581)
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 |
---|---|---|
1.0.0 | 836 | 10/9/2018 |