CameraPicture
A picture a Camera took, as a JPEG file in the cache that an Image or fileSystem can use at once.
Verwendung
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} />
)}
</>
);
}Typdeklaration
export type CameraPicture = SpecCameraPicture;Mitglieder 4
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
uri | string | Ja | A JPEG in the app's cache directory (file://), for <Image source> and fileSystem. |
width | number | Ja | In pixels, upright. |
height | number | Ja | — |
bytes | ArrayBuffer | Nein | The JPEG's bytes, when bytes asked for them. |
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.