Back to Devexpress

TdxOfficeImage Class

vcl-dxrichedit-dot-utils-dot-officeimage.md

latest10.4 KB
Original Source

TdxOfficeImage Class

A universal image container compatible with popular document formats.

Declaration

delphi
TdxOfficeImage = class(
    TdxSmartImage
)

Remarks

The TdxOfficeImage class is a TGraphic descendant that implements an image container for Rich Edit and Document Server components.

In this topic…

How to Use TdxOfficeImage

Content management APIs in Rich Edit and Document Server components uses TdxOfficeImage instances to store and display images in a document. You can use any property of the TdxOfficeImage type directly.

Refer to the following section for a full list of properties that use the TdxOfficeImage type: Direct TdxOfficeImage Class References.

Use TdxOfficeImage Independently

Add the dxRichEdit.Utils.OfficeImage unit to the uses clause of your project (in Delphi) or include the dxRichEdit.Utils.OfficeImage header to the required source code file (in C++Builder).

Supported Image Formats

All supported formats are implemented as the following codec classes derived from the TdxSmartImageCodec class:

TdxGPImageCodecBMPA Device-Independent Bitmap (BMP/DIB) image format codec.TdxGPImageCodecGIFA Graphics Interchange Format (GIF) codec.TdxGPImageCodecJPEGA Joint Photographic Experts Group (JPEG) image format codec.TdxGPImageCodecPNGA Portable Network Graphics (PNG) image format codec.TdxGPImageCodecTIFFA Tagged Image File Format (TIFF) codec.TdxGPImageCodecWMFA Windows Metafile (WMF) image format codec.

Main API Members

The list below outlines key API members of the TdxOfficeImage class that allow you to work with images.

Image Container Creation

This section contains TdxOfficeImage class constructors and other methods that allow you to create image containers.

CloneCreates a new image container populated with a copy of the stored image.CreateSizeCreates an image container filled with a specific color.CreateFromBitmap | CreateFromHBitmap | CreateFromBits | CreateFromStreamCreate an image container and populate it from the specified source.GetAsBitmapCreates a TBitmap container and populates it with the stored image.

Data Import and Export

Assign | AssignFromGraphic | AssignFromSmartImageRepopulate the image container with an image from another image container.CopyToClipboard | CutToClipboard | PasteFromClipboardMove image data between the image container and the clipboard.GetBitmapBitsReturns the stored image as an array of pixel data.LoadFromBits | LoadFromFieldValue | LoadFromResource | LoadFromFile | LoadFromStreamRepopulate the image container from the specified source.SaveToStream | SaveToStreamByCodecSave the stored image to a stream.SaveToFileSaves the stored image to a file.

Content and Resource Management

ClearClears the image container.ChangeColorFills all pixels of the stored image with a color.ConvertToBitmapRasterizes the stored vector image.CreateCanvas | StretchDrawDraw the stored image.Dormant | HandleNeededAllow you to suspend and restore the image container to optimize GDI resource usage.FlipFlips the stored image horizontally or vertically.ImageCodecSpecifies the format of the stored image. You can use this property to convert the stored image to any supported format, except for SVG.MakeCompositionThese overloaded functions blend two images from two image containers using the alpha channel.Resize | ScaleScale the source image.

Animation and Multi-Frame Image Settings

ActiveFrameSpecifies the currently displayed frame in a multi-frame image.AnimationFrameCountReturns the number of frames in a multi-frame image.Animation | AnimationLoop | AnimationLoopCount | AnimationLoopIndex | StartAnimation | StopAnimationAllow you to track and manage animation playback for the stored animated image.

General-Purpose API Members

ClientRect | SizeReturn stored image dimensions.CompareCompares two image containers.GetHashCodeCalculates a CRC32 hash code from stored image data.IsAlphaUsedAllows you to identify if the stored image has transparent pixels.

Direct TdxOfficeImage Class References

The following public API members reference a TdxOfficeImage object:

IdxRichEditDocumentImage.ImageProvides access to the Office Image container that hosts the inline image’s source bitmap.IdxRichEditShape.PictureProvides access to the Office Image container that hosts the source bitmap of the floating shape (picture).

Other Image Container Classes

DevExpress products also use the following image container classes:

TdxSmartGlyph

A DPI-aware image container that can load an image from a DFM file.

Most DevExpress controls use this image container to store, manage, and display UI element icons.

TdxSmartImageA universal image container used for image import, export, conversion, and draw operations.

Inheritance

TObject TPersistent TInterfacedPersistent TGraphic TdxCustomSmartImage TdxGPImage TdxSmartImage TdxOfficeImage

See Also

TdxOfficeImage Members

dxRichEdit.Utils.OfficeImage Unit