Table of Contents

Class CompressedImage

Namespace
Ranorex
Assembly
Ranorex.Core.dll

Represents an image where the image data is internally stored in a byte array, compressed according to the specified image format (PNG by default).

public sealed class CompressedImage
Inheritance
CompressedImage
Inherited Members

Constructors

CompressedImage(Image)

Creates a new compressed PNG image out of a given image.

public CompressedImage(Image image)

Parameters

image Image

The image to compress.

CompressedImage(Image, ImageFormat)

Creates a new compressed image out of a given image.

public CompressedImage(Image image, ImageFormat format)

Parameters

image Image

The image to compress.

format ImageFormat

The image format to use for storage.

CompressedImage(Image, ImageFormat, int)

Creates a new compressed image out of a given image.

public CompressedImage(Image image, ImageFormat format, int quality)

Parameters

image Image

The image to compress.

format ImageFormat

The image format to use for storage.

quality int

The quality to use for JPEG. Ignored otherwise.

CompressedImage(string)

Initializes a new instance of the CompressedImage class from a base64 string.

public CompressedImage(string base64Data)

Parameters

base64Data string

The image data encoded in a base64 string.

Properties

Guid

A unique ID identifying the image. The Guid is chosen randomly and not connected to the image content in any way.

[Browsable(false)]
public string Guid { get; }

Property Value

string

Image

The reconstructed image from the compressed data.

public Bitmap Image { get; }

Property Value

Bitmap

Methods

Clone()

Creates a clone of this instance.

public CompressedImage Clone()

Returns

CompressedImage

A new instance with the same data.

Store(string)

Writes the compressed data to a file.

public void Store(string fileName)

Parameters

fileName string

The name of the file to write to (png extension recommended).

ToBase64String()

Creates a Base64 string representation of this instance.

public string ToBase64String()

Returns

string

A Base64 string representation.

Operators

implicit operator Bitmap(CompressedImage)

Implicitly casts a CompressedImage object to a Bitmap.

public static implicit operator Bitmap(CompressedImage cImg)

Parameters

cImg CompressedImage

The compressed image.

Returns

Bitmap

Returns an Image instance.