ImageDecoding Sample
ImageDecoding
sample shows how to pick an image from system album and decode the image.
View the sample:
Generally, you can use the following methods to decode an image file:
decodeFile
: Decode an image file with a file path.decodeFileInMemory
: Decode an image file in memory with a byte buffer or fileStream.decodeBase64String
: Decode an image file in memory with a Base64 string.decodeBufferedImage
: DecodeBitmap
.
Different from processing the video streaming, the read rate performance is much more important when processing a single image. It is suggested to switch to the PresetTemplate
to IMAGE_READ_RATE
to improve the read rate performance.
In ImageDecoding
sample, the image file picked from album is firstly read in the memory and displayed on the view. As a result, it is processed by method decodeFileInMemory
. You can also use a similar way to get the file path of the image file and process it with decodeFile
. You can get full code of how to extract the file path from another sample: PerformanceSettings.