Version

RenderSize Property

Indicates the render size of the image, excluding any render effects such as shadows.
Syntax
'Declaration
 
Public Property RenderSize As Nullable(Of RichTextSize)
public Nullable<RichTextSize> RenderSize {get; set;}
Exceptions
ExceptionDescription
System.ArgumentOutOfRangeExceptionIf both the width and height are negative.
Remarks

RenderSize specifies the render size of the image, excluding any render effects such as shadows. If this property is not set then the value for it will be calculated automatically from the image.

If either the width or height of the RenderSize is set to a negative value then once the image is available (e.g. after it has been loaded) then the negative dimension will be calculated using the other (non-negative) dimension and the actual size of the image such that the image's aspect ratio is maintained. This calculated size will be returned by the RenderSizeResolved property. In this scenario, the RenderSizeResolved property will return null until the image has been loaded.

For example, if the image is 200 pixels wide by 300 pixels high and the RenderSize is set with a width of 100 and a height of -1 then the RenderSizeResolved property will return a width of 100 pixels and a height of 150 pixels once the image is loaded.

Note: Some serializers may chose to ignore a RenderSize that has a negative width or height if the image hasn't been loaded yet. Both the supplied RTF and Word serializers fall into this category because those formats don't support specifying only one dimension. Therefore, if one of those serializers is used to serialize the document before the image is available, i.e. it hasn't finished loading yet, then the aspect ratio can not be maintained and the RenderSize setting is ignored. The Html serializer is currently the only one that can deal with this because the html format supports specifying either a width or height attribute on an 'img' element.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also