Dynamic Web TWAIN  - TWAIN ActiveX/Plug-in, Scanner COM Control
TWAIN ActiveX/Plug-in HTTP Control/SDK

LoadImageFromBytes Method

Description

Loads image from a byte array with the specified file format.

Syntax

ObjectName.LoadImageFromBytes(Uint32 bufferSize, Variant * buffer, long ImageType)

Parameters

Uint32 bufferSize: Specifies the buffer size.

Variant * buffer: A byte array of the image data.

long ImageType: Specifies the file format.

Return value

True indicates success. False indicates failure.

Remarks

Dynamic Web TWAIN supports the following types of image files:

Allowed Values ImageType
0 BMP
1 JPEG
2 TIFF
3 PNG
4 PDF

The loaded image will be displayed in the Dynamic Web TWAIN.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

See also

LoadImage method, LoadImageEx method

 

Sample

Javascript Sample:

    		Twain.SelectedImagesCount = 2;
		Twain.SelectedImageIndex(0) = 4;// add put_ or set_ prefix
		Twain.SelectedImageIndex(1) = 3;
		var size = Twain.GetSelectedImagesSize(2);
      		Array ary = new Array(size);
		Twain.SaveSelectedImagesToBytes(size, ary);	
	
		Twain.LoadImageFromBytes(size, ary, 2);

VB Sample:

	Dim ary as Variant
	Twain.SelectedImagesCount = 2
	Twain.SelectedImageIndex[0] = 4
	Twain.SelectedImageIndex[1] = 3
	Dim size as long
	Set size = Twain.GetSelectedImagesSize(2)
	Redim ary(size) as byte
	Twain.SaveSelectedImagesToBytes(size, ary)
	
	Twain.LoadImageFromBytes(size, ary, 2);











TWAIN ActiveX | TWAIN Plug-in | TWAIN Control | TWAIN SDK | Scanner COM
Software Configuration Management | Version Control | Source Control
Copyright © 2011 Dynamsoft Corporation. All Rights Reserved.