Creates an XImage from an array of bytes.

 

   

Syntax
 

[C#]
static XImage FromData(byte[] data, XReadOptions options)

[Visual Basic]
Shared Function FromData(data() As Byte, options As XReadOptions) As XImage

Throws Exceptions may throw Exception()

 

   

Params
 
Name Description
data The data containing the graphic.
options The settings for the read. The XImage takes ownership of this parameter. This may be null.
return The resulting IndirectObject.

 

   

Notes
 

The data will typically be one of the following types: JPEG, GIF, TIFF, BMP, PNG, PSD, PDB, EXIF, WMF, EMF, EPS, PS or SWF (Flash).

The advantage of this method over SetFile, is that you can specify the ReadModule you would like to use. This allows precise control over the way that your graphics are imported.

In addition you can also control the way that transparency is treated using the PreserveTransparency property.

For details of the formats supported and the way they are imported, see the ReadModule property and the the Doc.Read method.

The object takes the ownership of the XReadOptions, which is disposed of when the object is disposed of. You can make the object release the ownership without disposing of the XReadOptions using the parameterized overloads of Dispose and Clear. The XReadOptions must not be modified as long as the object has the ownership.

The array of bytes should not be modified until the XImage object is cleared, disposed of, or garbage-collected.

 

   

Example
 

None.