Back to Devexpress

SharedImageCollection Class

windowsforms-devexpress-dot-utils-5054aa93.md

latest3.2 KB
Original Source

SharedImageCollection Class

An image collection that allows you to share images between controls on multiple forms.

Namespace : DevExpress.Utils

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

csharp
public class SharedImageCollection :
    Component,
    ISupportInitialize,
    IImageCollectionBase
vb
Public Class SharedImageCollection
    Inherits Component
    Implements ISupportInitialize,
               IImageCollectionBase

Remarks

The SharedImageCollection is an ImageCollection descendant. It allows the collection to share images between controls on multiple forms.

The contents of all SharedImageCollection s in the same project are synchronized. You can drop a SharedImageCollection on a form and add images to this collection, and then drop another SharedImageCollection on another form and access the same images in this form.

Note

Images in SharedImageCollection s in different forms are synchronized at design time only if the forms remain open.

The ImageSize property specifies the size of images when they are displayed in a control. The SharedImageCollection does not resize images according to the ImageSize property when the images are added to the collection.

Use the ImageSource property to add images to the collection at runtime. At design time, you can use the component’s smart tag menu to load images from various sources.

See the following topic for more information: ImageCollection.

You can load images to a SharedImageCollection from a project’s resources (the project should be built before the images are loaded). Note that you cannot use a project’s resources to share images between multiple projects in a solution. To share images between multiple projects, load images from the disk or use an image library. See the Load Images from External Assembly section in the following help topic for more information: ImageCollection.

Inheritance

Object MarshalByRefObject Component SharedImageCollection

See Also

SharedImageCollection Members

ImageCollection

DevExpress.Utils Namespace