Exemple #1
0
        /// <summary>
        /// Loads a DDS image from a Stream, and returns a Bitmap object of the image.
        /// </summary>
        /// <param name="stream">The stream to read the image data from.</param>
        /// <param name="alpha">Preserve the alpha channel or not. (default: true)</param>
        /// <returns>The Bitmap representation of the image.</returns>
        public static Bitmap LoadImage(Stream stream, bool alpha = true, Utils.PixelFormat pixel = Utils.PixelFormat.UNKNOWN)
        {
            DDSImage im = new DDSImage(stream, alpha, pixel);

            return(im.BitmapImage);
        }
Exemple #2
0
        /// <summary>
        /// Loads a DDS image from a byte array, and returns a Bitmap object of the image.
        /// </summary>
        /// <param name="data">The image data, as a byte array.</param>
        /// <param name="alpha">Preserve the alpha channel or not. (default: true)</param>
        /// <returns>The Bitmap representation of the image.</returns>
        public static Bitmap LoadImage(byte[] data, bool alpha = true, Utils.PixelFormat pixel = Utils.PixelFormat.UNKNOWN)
        {
            DDSImage im = new DDSImage(data, false, pixel);

            return(im.BitmapImage);
        }