# RtfImage

RTF picture payload preserved without external imaging dependencies.

Class 

`OfficeIMO.Rtf`

**Namespace**

`OfficeIMO.Rtf`

**Assembly**

`OfficeIMO.Rtf`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[RtfImage.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfImage.cs#L10)

**Implements**

`IRtfCloneable` `IRtfBlock` `IRtfInline`

**Modifiers**

sealed

RTF picture payload preserved without external imaging dependencies.

## Inheritance

- object
- RtfImage

## Usage

Explore 6 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 5

- Method [RtfDocument.AddImage](/api/rtf/officeimo-rtf-rtfdocument/#method-addimage-officeimo-rtf-rtfimageformat-byte)
- Method [RtfDocument.InsertImage](/api/rtf/officeimo-rtf-rtfdocument/#method-insertimage-int32-officeimo-rtf-rtfimageformat-byte)
- Property [RtfObject.ResultImage](/api/rtf/officeimo-rtf-rtfobject/#property-resultimage)
- Method [RtfParagraph.AddImage](/api/rtf/officeimo-rtf-rtfparagraph/#method-addimage-officeimo-rtf-rtfimageformat-byte)
- Method [RtfSection.AddImage](/api/rtf/officeimo-rtf-rtfsection/#method-addimage-officeimo-rtf-rtfimageformat-byte)

### Accepted by parameters 1

- Method [RtfLosslessEditor.ReplaceImage](/api/rtf/officeimo-rtf-rtflosslesseditor/#method-replaceimage-int32-officeimo-rtf-rtfimage) parameter `replacement`

Filter members 

Show inherited

## Constructors

`public RtfImage(RtfImageFormat format, byte[] data)` [#](#constructor-ctor-officeimo-rtf-rtfimageformat-byte)

[RtfImage.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfImage.cs#L10)

Creates an image block.

Parameters

**format OfficeIMO.Rtf.RtfImageFormat required**

**data byte[] required**

## Methods

`public RtfImageLayout ResolveLayout(double? fallbackWidthTwips = null, double? fallbackHeightTwips = null)` [#](#method-resolvelayout-nullable-system-double-nullable-system-double)

[RtfImage.Layout.cs:6](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfImage.Layout.cs#L6)

Resolves the picture's unscaled and visible sizes in twips. Pixel sizes use 96 DPI when no goal size is supplied.

Parameters

**fallbackWidthTwips double? = null optional**

**fallbackHeightTwips double? = null optional**

Returns

`RtfImageLayout`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public RtfImageFormat Format { get; set; }` [#](#property-format)

[RtfImage.cs:17](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfImage.cs#L17)

Image format.

`public byte[] Data { get; set; }` [#](#property-data)

[RtfImage.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfImage.cs#L21)

Raw image bytes.

`public long PayloadLength { get; }` [#](#property-payloadlength)

[RtfImage.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfImage.cs#L25)

Available decoded byte length without materializing a deferred source payload.

`public int? SourceWidth { get; set; }` [#](#property-sourcewidth)

[RtfImage.cs:28](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfImage.cs#L28)

Original width in pixels when present.

`public int? SourceHeight { get; set; }` [#](#property-sourceheight)

[RtfImage.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfImage.cs#L31)

Original height in pixels when present.

`public int? DesiredWidthTwips { get; set; }` [#](#property-desiredwidthtwips)

[RtfImage.cs:34](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfImage.cs#L34)

Desired width in twips when present.

`public int? DesiredHeightTwips { get; set; }` [#](#property-desiredheighttwips)

[RtfImage.cs:37](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfImage.cs#L37)

Desired height in twips when present.

`public int? ScaleXPercent { get; set; }` [#](#property-scalexpercent)

[RtfImage.cs:40](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfImage.cs#L40)

Horizontal picture scale as a percentage. An omitted value means 100.

`public int? ScaleYPercent { get; set; }` [#](#property-scaleypercent)

[RtfImage.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfImage.cs#L43)

Vertical picture scale as a percentage. An omitted value means 100.

`public int? CropLeftTwips { get; set; }` [#](#property-croplefttwips)

[RtfImage.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfImage.cs#L46)

Unscaled twips cropped from the left edge. Negative values add space.

`public int? CropTopTwips { get; set; }` [#](#property-croptoptwips)

[RtfImage.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfImage.cs#L49)

Unscaled twips cropped from the top edge. Negative values add space.

`public int? CropRightTwips { get; set; }` [#](#property-croprighttwips)

[RtfImage.cs:52](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfImage.cs#L52)

Unscaled twips cropped from the right edge. Negative values add space.

`public int? CropBottomTwips { get; set; }` [#](#property-cropbottomtwips)

[RtfImage.cs:55](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfImage.cs#L55)

Unscaled twips cropped from the bottom edge. Negative values add space.

`public string? Description { get; set; }` [#](#property-description)

[RtfImage.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfImage.cs#L58)

Alternative text or description.

<!-- PowerForge markdown artifact sha256:91FA235EEB8F9D4C74A6E8CAAF5A503A6EAB2B2B436B0E7C7722F7DCB3DFEF9F -->
