Exemplo n.º 1
0
 /// <summary>
 /// 根据内存流创建图像
 /// </summary>
 /// <param name="p_MemoryStream">内存流</param>
 /// <returns></returns>
 public static Bitmap CreateBitmap(GraphicsDevice p_GraphicsDevice, Stream p_Stream)
 {
     Bitmap bitmap = new Bitmap();
     try
     {
         bitmap.Texture = Texture2D.FromStream(p_GraphicsDevice, p_Stream);
     }
     catch (Exception)
     {
     }
     return bitmap;
 }
Exemplo n.º 2
0
 /// <summary>
 /// 根据字节数组创建图像
 /// </summary>
 /// <param name="p_Datas">图片字节数组</param>
 /// <returns></returns>
 public static Bitmap CreateBitmap(GraphicsDevice p_GraphicsDevice, byte[] p_Datas)
 {
     Bitmap bitmap = new Bitmap();
     try
     {
         MemoryStream stream = new MemoryStream(p_Datas);
         bitmap.Texture = Texture2D.FromStream(p_GraphicsDevice, stream);
     }
     catch (Exception)
     {
     }
     return bitmap;
 }