XNA.Texture2D - System.Drawing.Bitmap

I need to load XNA.Texture2D into a PictureBox.

I tried this: http://www.gamedev.net/community/forums/viewreply.asp?ID=3224621 , but it does not work. Any suggestions?

0
source share
2 answers

You should use this method, but make sure your XNA Texture2D is created in 32bbpARGB format. Any other format will prevent the direct operation of this method.

+2
source

An easier way to do this is to save Texture2D using Texture2D.SaveAsPng or Texture2D.SaveAsJpeg into the memory stream and open the virtual file using Bitmap(Stream) .

+1
source

Source: https://habr.com/ru/post/1442870/


All Articles