FormsCameraView.iOS 1.0.0

dotnet add package FormsCameraView.iOS --version 1.0.0
                    
NuGet\Install-Package FormsCameraView.iOS -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.iOS" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FormsCameraView.iOS" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="FormsCameraView.iOS" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FormsCameraView.iOS --version 1.0.0
                    
#r "nuget: FormsCameraView.iOS, 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.
#:package FormsCameraView.iOS@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FormsCameraView.iOS&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=FormsCameraView.iOS&version=1.0.0
                    
Install as a Cake Tool

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 Compatible and additional computed target framework versions.
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
1.0.0 1,073 10/9/2018