CameraPicture
A picture a Camera took, as a JPEG file in the cache that an Image or fileSystem can use at once.
Utilização
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} />
)}
</>
);
}Declaração do tipo
export type CameraPicture = SpecCameraPicture;Membros 4
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
uri | string | Sim | A JPEG in the app's cache directory (file://), for <Image source> and fileSystem. |
width | number | Sim | In pixels, upright. |
height | number | Sim | — |
bytes | ArrayBuffer | Não | The JPEG's bytes, when bytes asked for them. |
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.