кстати нашел еще код - результат его выполнения тот же:
public static void imagetotexture(GraphicsDevice device, ref Texture2D texture, System.Drawing.Image image)
{
if (image == null)
return;
if (texture == null || texture.IsDisposed || texture.Width != image.Width || texture.Height !=
image.Height || texture.Format != SurfaceFormat.Color)
{
if (texture != null && !texture.IsDisposed)
texture.Dispose();
texture = new Texture2D(device, image.Width, image.Height, false, SurfaceFormat.Color);
}
else
{
for (int i = 0; i < 16; i++)
if (device.Textures[i] == texture)
{
device.Textures[i] = null;
break;
}
}
using (MemoryStream mstream = new MemoryStream())
{
image.Save(mstream, System.Drawing.Imaging.ImageFormat.Png);
mstream.Seek(0, SeekOrigin.Begin);
texture = Texture2D.FromStream(device, mstream, image.Width, image.Height, false);
}
}