How can I get an image out of the clipboard without losing the alpha channel in .NET?

前端 未结 4 1283
旧时难觅i
旧时难觅i 2020-12-06 06:44

I\'m trying to save a copied image from the clipboard but it\'s losing its alpha channel:

Image clipboardImage = Clipboard.GetImage();
string imagePath = Pat         


        
4条回答
  •  执念已碎
    2020-12-06 07:32

    It might be like this article suggests, that the Clipboard object, working within Win32, is only able to manage bitmaps, which don't feature the transparent/partially transparent alpha channel. The OLE clipboard is more capable, it seems:

    • Intro
    • Vague support article
    • A bit of discussion about the Win32 clipboard

    However, the netez was the best article I found on the topic. (beware I haven't tested this myself)

提交回复
热议问题