开发者

XNA.Texture2D to System.Drawing.Bitmap

开发者 https://www.devze.com 2022-12-29 07:56 出处:网络
I need load XNA.Texture2D to Pi开发者_StackOverflow中文版ctureBox. i\'ve tried this: http://www.gamedev.net/community/forums/viewreply.asp?ID=3224621 but it doesn\'t work. Any suggestions?You should

I need load XNA.Texture2D to Pi开发者_StackOverflow中文版ctureBox.

i've tried this: http://www.gamedev.net/community/forums/viewreply.asp?ID=3224621 but it doesn't work. Any suggestions?


You should be able to use that method, but make sure that your XNA Texture2D is created with a format of 32bbpARGB. Any other format will prevent that method from working directly.


Easier way to do it is save the Texture2D using Texture2D.SaveAsPng or Texture2D.SaveAsJpeg to a memory stream and the open the virtual file using Bitmap(Stream).

0

精彩评论

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