A newer version of this page is available. Switch to the current version.

PictureEdit Class

The editor that displays images stored in bitmap, metafile, icon, JPEG, GIF, PNG or SVG format.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v19.1.dll

Declaration

[DefaultBindingPropertyEx("Image")]
[Docking(DockingBehavior.Ask)]
[SmartTagAction(typeof(PictureEditActions), "ChooseImage", "Choose Image")]
[SmartTagAction(typeof(PictureEditActions), "ErrorImage", "Error Image")]
[SmartTagAction(typeof(PictureEditActions), "InitialImage", "Initial Image")]
[ToolboxBitmap(typeof(ToolboxIconsRootNS), "PictureEdit")]
public class PictureEdit :
    BaseEdit,
    IPictureMenu,
    IGestureClient,
    IMouseWheelSupport,
    ISupportContextItemsCursor,
    IDirectXClient,
    IImageEditClient
<DefaultBindingPropertyEx("Image")>
<Docking(DockingBehavior.Ask)>
<SmartTagAction(GetType(PictureEditActions), "ChooseImage", "Choose Image")>
<SmartTagAction(GetType(PictureEditActions), "ErrorImage", "Error Image")>
<SmartTagAction(GetType(PictureEditActions), "InitialImage", "Initial Image")>
<ToolboxBitmap(GetType(ToolboxIconsRootNS), "PictureEdit")>
Public Class PictureEdit
    Inherits BaseEdit
    Implements IPictureMenu,
               IGestureClient,
               IMouseWheelSupport,
               ISupportContextItemsCursor,
               IDirectXClient,
               IImageEditClient

Related API Members

The following members accept/return PictureEdit objects:

Remarks

The PictureEdit control can display graphics from a bitmap, metafile, icon, JPEG, GIF, PNG or SVG file.

You can specify an image with the PictureEdit.Image or PictureEdit.SvgImage property. The image's display size and position are controlled by the RepositoryItemPictureEdit.SizeMode and RepositoryItemPictureEdit.PictureAlignment properties.

PictureEdit provides a context menu with commands that perform common operations: cut, copy, paste, delete, edit, load, save and zoom. The following properties control the availability of the menu and its individual commands:

In specific instances, you may want to resize the PictureEdit in code so that its image fits the control without padding. Take note that additional space must be reserved to paint the control's focus rectangle. Otherwise, a few pixels are clipped out from the image. The correct code to resize the PictureEdit and allocate space for the focus rectangle is as follows:

mPictureEdit.ClientSize = new System.Drawing.Size(mPictureEdit.Image.Width + 2, mPictureEdit.Image.Height + 2);

The PictureEditOptionsMask.MaskType property (accessible from the Properties.OptionsMask object) allows you to enable masked mode to clip out a part of the image. The following mask types are supported.

See Also