将DevExpress.Utils.ImageCollection变量的image导出
private void tspBtnExportExcel_Click(object sender, EventArgs e)
{
//暂时用来导出图片
string filePath = System.Environment.CurrentDirectory + @"\Photo\";
DevExpress.Utils.Images images = ribbonImageCollectionLarge.Images;
InnerImagesList inner = images.InnerImages;
foreach (DevExpress.Utils.ImageInfo imageInfo in inner)
{
//导出之前必须保证filePath路径是存在的
try
{
imageInfo.Image.Save(filePath + imageInfo.Name, System.Drawing.Imaging.ImageFormat.Png);
}
catch (Exception ex)
{
MessageBox.Show("错误", ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}