[]
        
(Showing Draft Content)

GrapeCity.Documents.Word.ImageData

Class ImageData

Namespace
GrapeCity.Documents.Word
Assembly
GcDocs.Word.dll

Represents the image data of a picture.

public class ImageData : EmbeddedImageData
Inheritance
object
ImageData
Inherited Members
object.ToString()
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
object.MemberwiseClone()

Properties

Brightness

Gets or sets a value to change the brightness.

Allowed values are from -1 (darkest) to 1 (lightest), inclusive.

The default is 0.

public float Brightness { get; set; }

Property Value

float

ComplementaryVectorData

Gets the complementary vector data of the image.

public VectorGraphicImageData ComplementaryVectorData { get; }

Property Value

VectorGraphicImageData

Compression

Gets or sets the image compression value.

public ImageCompression Compression { get; set; }

Property Value

ImageCompression

Contrast

Gets or sets a value to change the contrast.

Allowed values are from -1 to 1, inclusive.

The default is 0.

public float Contrast { get; set; }

Property Value

float

Crop

Gets the portion of the image used for the fill.

public EdgeExtent Crop { get; }

Property Value

EdgeExtent

Remarks

Each edge of the source rectangle is defined by a percentage offset from the corresponding edge of the bounding box. A positive percentage specifies an inset, while a negative percentage specifies an outset. For example, a left offset of 25% specifies that the left edge of the source rectangle is located to the right of the bounding box's left edge by an amount equal to 25% of the bounding box's width.

Dpi

Gets or sets the DPI (dots per inch) used to calculate the size of the image.

If zero, the DPI in the image is used.

public uint Dpi { get; set; }

Property Value

uint

Effects

Gets the list of the image effects.

public ImageEffectList Effects { get; }

Property Value

ImageEffectList

FillType

Gets or sets the image fill type.

public ImageFillType FillType { get; set; }

Property Value

ImageFillType

HasImage

Gets a value indicating whether the picture contains image bytes or links to an image.

public override bool HasImage { get; }

Property Value

bool

Gets a value indicating whether the image is linked to this picture (when Source is specified).

public bool IsLink { get; }

Property Value

bool

IsLinkOnly

Gets a value indicating whether the image is linked and not stored in the document.

public bool IsLinkOnly { get; }

Property Value

bool

RotateWithObject

Gets or sets whether the data rotates along with the object when the object is rotated.

public bool RotateWithObject { get; set; }

Property Value

bool

Saturation

Gets the amount of saturation applied to the picture.

public float Saturation { get; }

Property Value

float

Sharpness

Gets the amount to sharpen (if positive) or the amount to blur (if negative).

public float Sharpness { get; }

Property Value

float

Source

Gets or sets the path and name of the source file for the linked image.

public Uri Source { get; set; }

Property Value

System.Uri

Stretch

Gets a stretch fill rectangle.

When stretching an image, the source rectangle is scaled to fit the specified fill rectangle.

public EdgeExtent Stretch { get; }

Property Value

EdgeExtent

Temperature

Gets the color temperature of the light source in the picture.

public int Temperature { get; }

Property Value

int

Tile

Gets the image tile format used to fill the available space.

public TileFill Tile { get; }

Property Value

TileFill

Transparency

Gets or sets the degree of transparency of the image as a value between 0 (opaque) and 1 (clear).

Allowed values are from 0 to 1, inclusive.

The default is 0.

public float Transparency { get; set; }

Property Value

float

WebVideoProperties

Gets the properties for displaying an online video to the user.

public WebVideoProperties WebVideoProperties { get; }

Property Value

WebVideoProperties

Methods

Equals(ImageData)

protected bool Equals(ImageData other)

Parameters

other ImageData

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Recolor(RecolorType)

Changes the color of the image.

public void Recolor(RecolorType type)

Parameters

type RecolorType

The color change type.

RecolorDark(UserColor)

Changes the color of the image.

For each pixel, combines black color and specified color using a linear interpolation.

public void RecolorDark(UserColor color)

Parameters

color UserColor

The user color to transform and combine with black.

RecolorLight(UserColor)

Changes the color of the image.

For each pixel, combines specified color and white color using a linear interpolation.

public void RecolorLight(UserColor color)

Parameters

color UserColor

The user color to transform and combine with white.

Save(Stream)

Saves the image into the specified stream.

public override void Save(Stream stream)

Parameters

stream System.IO.Stream

The stream where to save the image to.

SetColorTransparent(UserColor)

Makes a color in the current image transparent.

public void SetColorTransparent(UserColor color)

Parameters

color UserColor

The user color the make transparent.

SetImage(byte[], string)

Sets the image that is displayed by this picture.

public override void SetImage(byte[] bytes, string contentType)

Parameters

bytes byte[]

The byte array of the image.

contentType string

The content type of the image data.

SetImage(Uri, string)

Sets the image that is displayed by this picture.

public override void SetImage(Uri uri, string contentType)

Parameters

uri System.Uri

The URI to the image file.

contentType string

The content type of the image data.

ToByteArray()

Returns a byte array representing the image, regardless of whether the image is stored or linked.

If the image is linked, this method downloads the image each time it is called.

public override byte[] ToByteArray()

Returns

byte[]

The image bytes.

ToStream()

Creates and returns a stream containing the image bytes.

If the image bytes are stored in the picture, creates and returns a MemoryStream object.

If the image is linked and stored in a file, opens the file and returns a FileStream object.

If the image is linked and stored in an external URL, downloads the file and returns a MemoryStream object.

public override Stream ToStream()

Returns

System.IO.Stream

A stream containing the image bytes.