Skip to content

Instantly share code, notes, and snippets.

@olokobayusuf
Created October 20, 2021 13:43
Embed
What would you like to do?
// Create a device query to discover the rear camera
var query = new MediaDeviceQuery(MediaDeviceCriteria.RearCamera);
// Get the rear camera
var device = query.current as CameraDevice;
// Create a texture output to convert pixel buffers to textures
var textureOutput = new TextureOutput();
// Start the camera preview
device.StartRunning(textureOutput);
// Get the preview texture from the texture output
Texture2D previewTexture = await textureOutput;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment