Functions & Hooks

useDerivedImage

function useDerivedImage(source: TgfxImage | null, derivation: Derivation): TgfxImage | null;

Derive a handle from another and dispose it with the component.

The declarative half of image.scaled() and friends. Returns null while the source is still loading, so it composes with useImage directly.

const photo = useImage(require('./photo.jpg'))
const thumb = useDerivedImage(photo, { type: 'scaled', width: 200, height: 200 })

Parameters

source

TgfxImage | null

derivation

Derivation

Returns

TgfxImage | null

On this page