Skip to main content

PhotoResult

Namespace: BlazorNative.Core

The terminal outcome of a IMobileBridge.CapturePhotoAsync(CaptureOptions, CancellationToken) call: a status and, only when CameraStatus.Captured, the captured file's file:// path and its FINAL (post-downscale) dimensions + size. Every other status carries a null path and zeros (the GeolocationResult / SecretResult twin). The path points into the app's PRIVATE cache (Android getCacheDir() / iOS NSTemporaryDirectory()) — not world-readable, not external storage; the exposure is a location, not the image's content, and the bytes never enter managed memory as a marshalled string (they stay in the file the OS wrote — a benefit of the file-path handoff over bytes-inline). THE OWNERSHIP BOUNDARY: once the path crosses to .NET the APP OWNS THE FILE — the façade does NOT auto-delete on return (the app may still be reading it, or handing it to BnImage which decodes asynchronously); the shell prunes its own capture subdir on each capture as a leak backstop. See docs/bridge-extension.md §(f).10.

public readonly record struct PhotoResult

Inheritance ObjectValueTypePhotoResult
Implements IEquatable<PhotoResult>
Attributes NullableContextAttribute, NullableAttribute, IsReadOnlyAttribute

Properties

Status

The capture outcome.

public CameraStatus Status { get; init; }

Property Value

CameraStatus

Path

file:// path in the app cache; null unless CameraStatus.Captured.

public string? Path { get; init; }

Property Value

String

Width

Final (post-downscale) pixel width; 0 unless Captured.

public int Width { get; init; }

Property Value

Int32

Height

Final (post-downscale) pixel height; 0 unless Captured.

public int Height { get; init; }

Property Value

Int32

SizeBytes

Final file size in bytes; 0 unless Captured.

public long SizeBytes { get; init; }

Property Value

Int64

Constructors

PhotoResult(CameraStatus, String, Int32, Int32, Int64)

The terminal outcome of a IMobileBridge.CapturePhotoAsync(CaptureOptions, CancellationToken) call: a status and, only when CameraStatus.Captured, the captured file's file:// path and its FINAL (post-downscale) dimensions + size. Every other status carries a null path and zeros (the GeolocationResult / SecretResult twin). The path points into the app's PRIVATE cache (Android getCacheDir() / iOS NSTemporaryDirectory()) — not world-readable, not external storage; the exposure is a location, not the image's content, and the bytes never enter managed memory as a marshalled string (they stay in the file the OS wrote — a benefit of the file-path handoff over bytes-inline). THE OWNERSHIP BOUNDARY: once the path crosses to .NET the APP OWNS THE FILE — the façade does NOT auto-delete on return (the app may still be reading it, or handing it to BnImage which decodes asynchronously); the shell prunes its own capture subdir on each capture as a leak backstop. See docs/bridge-extension.md §(f).10.

public PhotoResult(CameraStatus Status, string? Path, int Width, int Height, long SizeBytes)

Parameters

Status CameraStatus
The capture outcome.

Path String?
file:// path in the app cache; null unless CameraStatus.Captured.

Width Int32
Final (post-downscale) pixel width; 0 unless Captured.

Height Int32
Final (post-downscale) pixel height; 0 unless Captured.

SizeBytes Int64
Final file size in bytes; 0 unless Captured.