You are here: Start » AVL.NET » Function Reference » Image » Image IO » AVL.LoadImageFromBuffer

AVL.LoadImageFromBuffer

Loads a single image from a file stored in memory.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void LoadImageFromBuffer
(
	AvlNet.ByteBuffer inBuffer,
	int inOffset,
	int? inLength,
	bool inLoadAlphaChannel,
	AvlNet.Image outImage
)

Parameters

Name Type Range Default Description
inBufferAvlNet.ByteBufferSource buffer containing image file data.
inOffsetint0Image data start position in source buffer. Default value: 0.
inLengthint?Image data length in source buffer. Default value: atl::NIL.
inLoadAlphaChannelboolWhether to load the alpha channel (if exists) as an additional image channel.
outImageAvlNet.ImageOutput image.

Description

This function loads an Image from a common format file similarly to LoadImage, but instead of accessing the file system it uses only the memory by loading the file content from ByteBuffer.

The operation loads an image from a file in one of the standard image file formats. Currently the filter supports the following formats:

  • BMP (*.bmp),
  • JPEG (*.jpg, *jpeg),
  • PNG (*.png),
  • TIFF (*.tif, *.tiff).

The format of the image file is recognized automatically based on the file header.

The resulting outImage will be three-channel image of UInt8 pixel type, or sometimes of UInt16 pixel type for 16-bit depth images of supported formats (PNG, TIFF).

Errors

List of possible exceptions:

Error type Description
IoError Reading beyond the end of the byte buffer in LoadImageFromBuffer.

Function Overrides

See also