Inheritance: IDisposable
Esempio n. 1
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)
        {
            DDSImage im = new DDSImage(data, alpha);

            return(im.BitmapImage);
        }
Esempio n. 2
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)
        {
            DDSImage im = new DDSImage(stream, alpha);

            return(im.BitmapImage);
        }
Esempio n. 3
0
 /// <summary>
 /// Loads a DDS image from a file, and returns a Bitmap object of the image.
 /// </summary>
 /// <param name="file">The image file.</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(string file, bool alpha = true)
 {
     byte[] data = File.ReadAllBytes(file);
     DDSImage im = new DDSImage(data, alpha);
     return im.BitmapImage;
 }
Esempio n. 4
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)
 {
     DDSImage im = new DDSImage(stream, alpha);
     return im.BitmapImage;
 }
Esempio n. 5
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)
 {
     DDSImage im = new DDSImage(data, alpha);
     return im.BitmapImage;
 }
Esempio n. 6
0
        /// <summary>
        /// Loads a DDS image from a Stream, and returns a DDSResult 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 DDSResult representation of the image.</returns>
        public static DDSResult LoadImage(Stream stream)
        {
            DDSImage im = new DDSImage(stream);

            return(im.BitmapImage);
        }
Esempio n. 7
0
        /// <summary>
        /// Loads a DDS image from a byte array, and returns a DDSResult 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 DDSResult representation of the image.</returns>
        public static DDSResult LoadImage(byte[] data)
        {
            DDSImage im = new DDSImage(data);

            return(im.BitmapImage);
        }
Esempio n. 8
0
 public void PreserveAlphaChannel_IsFalse()
 {
     DDSImage im = new DDSImage(File.Open(@"Data\sample_dxt5.dds", FileMode.Open), false);
     Assert.IsFalse(im.PreserveAlpha);
 }
Esempio n. 9
0
 public void PreserveAlphaChannel_DefaultsTrue()
 {
     DDSImage im = new DDSImage(File.Open(@"Data\sample_dxt5.dds", FileMode.Open));
     Assert.IsTrue(im.PreserveAlpha);
 }