So, I created an interface and implemented this interface in my Windows Phone 8 application to start the camera stream. For instance:
public void StartCamera()
{
var cam = new Microsoft.Devices.PhotoCamera(Microsoft.Devices.CameraType.Primary);
System.Windows.Controls.Canvas canvas = new System.Windows.Controls.Canvas();
var videobrush = new System.Windows.Media.VideoBrush();
canvas.Background = videobrush;
videobrush.SetSource(cam);
}
so now the object canvasholds the camera stream. But how do I pass this back to Xamarin forms and show it.
In Xamarin Forms, I have:
IOperations camera = DependencyService.Get<IOperations>();
if (camera != null)
{
camera.StartCamera();
}
and this works regardless of the fact that I can not control the flow of the camera. How to display this stream in Xamarin forms?
user1 source
share