public static System.Drawing.Image LoadImageFromStream(Stream stream) { ImageImporter importer = new ImageImporter(); DevIL.Image img = importer.LoadImageFromStream(stream); DevIL.Unmanaged.ImageInfo imageInfo = img.GetImageInfo(); System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(imageInfo.Width, imageInfo.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb); System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(0, 0, imageInfo.Width, imageInfo.Height); System.Drawing.Imaging.BitmapData bitmapData = bitmap.LockBits(rectangle, System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb); DevIL.Unmanaged.IL.CopyPixels(0, 0, 0, imageInfo.Width, imageInfo.Height, 1, DataFormat.BGRA, DevIL.DataType.UnsignedByte, bitmapData.Scan0); bitmap.UnlockBits(bitmapData); return((System.Drawing.Image)bitmap); }