Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Description

Excerpt

Gets or sets whether the aspect ratio of the picture should be locked.

Signature
C#
C#
public bool LockAspectRatio { get; set; }
{signature}
{signature:
}
Signature
vb.net
vb.net
Public Function LockAspectRatio() As Boolean
{signature}
{remarks}
Use this property to maintain or break the same aspect ratio for a picture in a header or footer while resizing.  The default value is true.

You will still be able to manipulate the [Height|HeaderFooterPicture.Height] and [Width|HeaderFooterPicture.Width] independently in ExcelWriter, regardless of this value. The aspect ratio is only locked when trying to resize the picture in Excel.
{remarks}
{example}
{code:csharp|title=C#}
Remarks

Use this property to maintain or break the same aspect ratio for a picture in a header or footer while resizing. The default value is true.

You will still be able to manipulate the Height and Width independently in ExcelWriter, regardless of this value. The aspect ratio is only locked when trying to resize the picture in Excel.

Example
Code Block
csharp
csharp
titleC#

HeaderFooterPicture hfp = header.GetPicture();

//--- Lock the aspect ratio of the picture so that it is not
//--- stretched as it is resized
hfp.LockAspectRatio = true;
hfp.Height = 20;
hfp.Width = 30;
{code} {code:
Code Block
vb.net
|title=
vb.net
titlevb.net
}

Dim hfp As HeaderFooterPicture = header.GetPicture()

'--- Lock the aspect ratio of the picture so that it is not
'--- stretched as it is resized
hfp.LockAspectRatio = True
hfp.Height = 20
hfp.Width = 30
{code} {example}