Skip to main content
A newer version of this page is available. .

How to: Resize a Picture

The following API allows you to change the picture’s size and rotation angle:

API

Description

Shape.ScaleX

Gets or sets the X-axis scale factor.

Shape.ScaleY

Gets or sets the Y-axis scale factor.

Shape.RotationAngle

Specifies the picture’s rotation angle.

The following code rotates text boxes and resizes floating pictures.

XtraRichEdit_Shapes_RotateResize_Code

document.LoadDocument("FirstLook.docx", DevExpress.XtraRichEdit.DocumentFormat.OpenXml);
foreach (Shape s in document.Shapes)
{
 // Rotate a text box and resize a floating picture.
    if (s.TextBox == null)
    {
        s.ScaleX = 0.1f;
        s.ScaleY = 0.1f;
    }
    else
    {
        s.RotationAngle = 45;
    }
}