如何从图标中提取256x256图标并在.Net、Winforms、XP中显示
下面是我用来提取所需图标大小的代码:
Dim i As Icon = My.Resources.Spectrum
Using i2 As New Icon(i, New Size(256, 256))
Me.PictureBox1.Image = i2.ToBitmap
End Using
它适用于 16x16 到 128x128,但对于 256x256,它提取 128x128 图标。我尝试了 0x0,因为我似乎记得这就是大尺寸存储在元数据中的方式,但这也不起作用。
Here's the code that I use to extract the icon size that I want:
Dim i As Icon = My.Resources.Spectrum
Using i2 As New Icon(i, New Size(256, 256))
Me.PictureBox1.Image = i2.ToBitmap
End Using
This works from 16x16 up to 128x128 but for 256x256 it extracts the 128x128 icon. I tried 0x0, because I seem to remember that that is how the large size is stored in the meta data, but that didn't work either.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在应用程序中使用 256 x 256 Vista 图标
Using 256 x 256 Vista icon in application
您确定您的源实际上包含 256x256 资源吗?您是否尝试过使用不同的源图标?
Are you sure your source actually contains a 256x256 resource? Have you tried against a different source icon?