如何从Microsoft Office 2007保存ImageMSO图标? [英] How to save ImageMSO icon from Microsoft Office 2007?
问题描述
我从Microsoft Office 2007中发现了许多漂亮的图标。你对提取物有什么想法吗?使用VBA将所有图标保存为PNG文件?
I found a lot of nice icons from Microsoft Office 2007. Do you any idea for extract & save all icons as PNG files by using VBA?
The following code is code which is used to get image from ImageMSO.
Application.CommandBars.GetImageMso([name], [width], [height])
I can display all as PictureBox control and save excel file as web page. However, every icons is very low quality.
Moreover, I try to create C# Excel Add-in project for exporting as Bitmap object by using the following code. But I found that it can't export as semi-transparent PNG.
stdole.IPictureDisp p = Application.CommandBars.GetImageMso(fileName, size, size);
Bitmap b = Bitmap.FromHbitmap((IntPtr)p.Handle, (IntPtr)p.hPal);
PS. I want to save all icons as PNG format because I need to use semi-transparent feature of it. It allow me to use all icons on most background color more than white background.
I use ImageMso quite frequently in my Excel development. Having stumbled on this post, I took it a step further and put a package together to visually search, extract and save icons from Microsoft Excel as a file or copy and paste (with alpha channel transparency) to another application. I also compiled a list of 8,899 distinct ImageMso names from the various sources. I hope others can find this useful.
Microsoft Office Icons (ImageMSO) Gallery & Extraction
这篇关于如何从Microsoft Office 2007保存ImageMSO图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!