开发者

icon to byte [] C# compact framework

I've looked around for an answer to this for quite some time.

I need to convert an icon to a byte[] in .NETCF but there is no icon.save() function in compact framework to create a MemoryStream object. Wha开发者_Python百科t is another way that I can do this?

Thanks


There's two things I can think of, one of them is suggested by Christian, the other one is that if it is a resource, can't you get a ResourceStream? This works if you make the icon an Embedded Resource (example found here)

This SO thread also discusses something not unlike your problem.


Is it possible to call Icon.ToBitmap() and then read the bytes from the bitmap?


If all you need is the raw bytes of the .Ico file then you can just read it directly with a file stream

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜