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
imageImageThe image to compress.
CompressedImage(Image, ImageFormat)
Creates a new compressed image out of a given image.
public CompressedImage(Image image, ImageFormat format)
Parameters
imageImageThe image to compress.
formatImageFormatThe 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
imageImageThe image to compress.
formatImageFormatThe image format to use for storage.
qualityintThe 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
base64DatastringThe 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
Image
The reconstructed image from the compressed data.
public Bitmap Image { get; }
Property Value
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
fileNamestringThe 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
cImgCompressedImageThe compressed image.