CameraPicture
A picture a Camera took, as a JPEG file in the cache that an Image or fileSystem can use at once.
Usage
Display a captured picture.
// Display a captured picture.
import { Button, Camera, Image, cameraRef, signal, type CameraPicture } from 'kuito';
function Snap() {
const camera = cameraRef();
const last = signal<CameraPicture | null>(null);
const snap = async () => {
last.value = (await camera.current?.takePicture({ quality: 0.8 })) ?? null;
};
return (
<>
<Camera ref={camera} flex={1} />
<Button disabled={!camera.ready.value} onPress={snap}>
Take picture
</Button>
{last.value && (
<Image src={last.value.uri} width={80} aspectRatio={last.value.width / last.value.height} />
)}
</>
);
}Type declaration
export type CameraPicture = SpecCameraPicture;Members 4
| Name | Type | Required | Description |
|---|---|---|---|
uri | string | Yes | A JPEG in the app's cache directory (file://), for <Image source> and fileSystem. |
width | number | Yes | In pixels, upright. |
height | number | Yes | — |
bytes | ArrayBuffer | No | The JPEG's bytes, when bytes asked for them. |
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.