开发者

In WPF, how to Convert a D3DImage to Bitmap?

开发者 https://www.devze.com 2023-03-02 10:03 出处:网络
I开发者_如何学Python\'m trying to paste images from an external source (Paint.NET in my test), but it gives a D3DImage which I don\'t know how to convert to Bitmap.

I开发者_如何学Python'm trying to paste images from an external source (Paint.NET in my test), but it gives a D3DImage which I don't know how to convert to Bitmap. How to do that?


A D3DImage, although it is a strange beast, is an ImageSource, so you can use as the Source for an Image and an Image is a Visual so you can use RenderTargetBitmap on it. There is sample code in the RenderTargetBitmap documentation that actually copies the bitmap from the Visual to another Image on same page:

  • RenderTargetBitmap Class
0

精彩评论

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

关注公众号