SharedImageCollection

本文介绍了DevExpress提供的SharedImageCollection组件,该组件允许在多个窗体之间的控件共享图像。所有同一项目内的SharedImageCollection的内容都是同步的。不同于普通的ImageCollection,SharedImageCollection不会调整图像大小,并且可以在运行时通过ImageSource属性添加图像。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://documentation.devexpress.com/#WindowsForms/clsDevExpressUtilsSharedImageCollectiontopic

The image collection that allows you to share images between controls within multiple forms.

Remarks

The SharedImageCollection extends features of the ImageCollection with the capability to share images between controls within multiple forms.

The contents of all SharedImageCollections within the same project are synchronized.

You can drop a SharedImageCollection onto a form and add images to this collection.

You can then drop another SharedImageCollection(s) onto another form(s) and will get access to the same images within these forms.

 

Note:Images in SharedImageCollections within different forms are synchronized at design time only if the forms remain open.

 

Unlike the ImageCollection, the SharedImageCollection does not resize images (according to SharedImageCollection.ImageSource.ImageSize property) when they are added to the collection.

At runtime, to add images to the SharedImageCollection, use the ImageSource property, which is of the ImageCollection type.

At design time, you can load images from different sources using the component's smart tag menu.

 

For more information on image load options and how to use images from image collections in WinForms controls, see ImageCollection.

You can load images to the SharedImageCollection from project resources (The project must be built prior to loading images from resources).

Do not use this feature when you need to share images stored in one project's resources between two or more projects within a single solution.

To share images between multiple projects merged into a single solution, add these images to the SharedImageCollection directly by loading them from disk.

Alternatively, you can create a separate image library to store common images and use the Load Images from External Assembly approach described in the ImageCollection topic.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值