Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Collapse]Spreadsheet
   [Expand]Product Information
    Product Structure
    Getting Started
   [Expand]Spreadsheet Document
    Supported Formats
   [Expand]Cell Basics
   [Expand]Spreadsheet Formulas
    Defined Names
    Data Binding
    Data Validation
   [Expand]Data Presentation
    Data Grouping
   [Expand]Pivot Table Overview
   [Expand]Charting Overview
    Printing
    Events
   [Expand]Mail Merge Overview
    Protection
    Find and Replace
   [Collapse]Visual Elements
     Workbook
     Worksheet
    [Expand]Cells and Cell Ranges
     Rows and Columns
     Formulas
     Name Box
     Pictures
    [Expand]Dialogs
    Services
   [Expand]Shortcuts
   [Expand]Examples
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Pictures

The SpreadsheetControl provides the capability to insert pictures into a spreadsheet document. An individual image embedded in a worksheet is represented by the Picture object, which inherits the base Shape interface. All images are stored in the PictureCollection, accessible via the Worksheet.Pictures property. To create a picture and add it to a worksheet programmatically, use the PictureCollection.AddPicture method. For an example, refer to the How to: Insert and Delete Pictures topic.

To enable end-users to insert pictures in a worksheet, add the Illustrations Ribbon page group to the SpreadsheetControl. For an example on how to provide a Ribbon UI for the SpreadsheetControl, see the Getting Started topic.

The SpreadsheetControl supports graphics of the following types.

  • Bitmap (*.bmp, *.dib)
  • JPEG File Interchange Format (*.jpg, *.jpeg)
  • Portable Network Graphics (*.png)
  • Graphics Interchange Format (*.gif)
  • Tagged Image File Format (*.tif, *.tiff)
  • Microsoft Enhanced Metafile (*.emf)
  • Windows Metafile (*.wmf)

The SpreadsheetControl allows end-users to move, resize and rotate embedded pictures, as described in the table below. For an example on how to modify pictures in a worksheet programmatically, refer to the How to: Modify an Embedded Picture document.

Action

End-User Capabilities

API properties/methods

Move a picture

Click the picture you wish to move and drag it to a new location.

Shape.Move

Shape.Left

Shape.Top

Resize a picture

Click the rotation handle of the selected picture and drag it in the direction in which you wish to rotate the object.

Shape.Height

Shape.Width

Shape.LockAspectRatio

Shape.BottomRightCell

Shape.TopLeftCell

Rotate a picture

Drag the sizing handle away from the center (or towards the center) of the selected picture, and release it once the desired size is reached.

Shape.Rotation

Shape.IncrementRotation

Expanded End-User Restrictions

The SpreadsheetControl allows you to prevent end-users from modifying pictures embedded in a worksheet. To implement end-user restrictions, use the SpreadsheetControlOptions.Behavior property, which provides access to the restriction settings. The table below lists possible restrictions you can set when working with pictures in the SpreadsheetControl.

Restriction

Description

SpreadsheetDrawingBehaviorOptions.Move Gets or sets whether or not end-users are allowed to change the position of pictures.
SpreadsheetDrawingBehaviorOptions.Resize Gets or sets whether or not end-users are allowed to change the size of pictures.
SpreadsheetDrawingBehaviorOptions.Rotate Gets or sets whether or not end-users are allowed to rotate pictures.
SpreadsheetDrawingBehaviorOptions.ChangeZOrder Gets or sets whether or not end-users are allowed to change the order of pictures in a worksheet.

Set the desired property to the DocumentCapability.Disabled or DocumentCapability.Hidden value, to make the operation unavailable, and disable or hide the Bring Forward and Send Backward commands in the Ribbon UI and the spreadsheet popup menu.

Expanded Supported Keyboard Shortcuts

The SpreadsheetControl also provides the capability for end-users to use key combinations to quickly perform operations with pictures.

Shortcut

Description

DELETE Deletes the selected picture.
BACKSPACE Deletes the selected picture.
ARROW KEYS Move the selected picture in a worksheet.
ALT+LEFT ARROW KEY Rotates the selected picture counterclockwise by 15 degrees.
CTRL+ALT+LEFT ARROW KEY Rotates the selected picture counterclockwise by 1 degree.
ALT+RIGHT ARROW KEY Rotates the selected picture clockwise by 15 degrees.
CTRL+ALT+RIGHT ARROW KEY Rotates the selected picture clockwise by 1 degree.
SHIFT+RIGHT ARROW KEY Increases the width and height of the selected picture by 10%.
SHIFT+UP ARROW KEY Increases the width and height of the selected picture by 10%.
CTRL+SHIFT+RIGHT ARROW KEY Increases the width and height of the selected picture by 1%.
CTRL+SHIFT+UP ARROW KEY Increases the width and height of the selected picture by 1%.
SHIFT+LEFT ARROW KEY Decreases the width and height of the selected picture by 10%.
SHIFT+DOWN ARROW KEY Decreases the width and height of the selected picture by 10%.
CTRL+SHIFT+LEFT ARROW KEY Decreases the width and height of the selected picture by 1%.
CTRL+SHIFT+DOWN ARROW KEY Decreases the width and height of the selected picture by 1%.
CTRL+A Selects all pictures in a worksheet.
TAB Selects the next picture in a worksheet.
TAB+SHIFT Selects the previous picture in a worksheet.

How would you rate this topic?​​​​​​​