Skip to main content
All docs
V19.1

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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 pictures.

rotate

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.5f;
        s.ScaleY = 0.5f;
    }
    else
    {
        s.RotationAngle = 45;
    }
}