diff --git a/source/Cosmos.System2/Graphics/Bitmap.cs b/source/Cosmos.System2/Graphics/Bitmap.cs
index c45212aed..dc00f574a 100644
--- a/source/Cosmos.System2/Graphics/Bitmap.cs
+++ b/source/Cosmos.System2/Graphics/Bitmap.cs
@@ -54,6 +54,48 @@ namespace Cosmos.System.Graphics
}
}
}
+
+ ///
+ /// Create new instance of the class, with a specified path to a BMP file.
+ ///
+ /// Path to file.
+ ///
+ ///
+ /// - Thrown if path is invalid.
+ /// - Memory error.
+ ///
+ ///
+ ///
+ ///
+ /// - Thrown if path is null.
+ /// - Memory error.
+ ///
+ ///
+ /// Thrown on fatal error (contact support).
+ /// Thrown on IO error.
+ ///
+ ///
+ /// - Thrown on fatal error (contact support).
+ /// - The path refers to non-file.
+ ///
+ ///
+ /// Thrown if the stream is closed.
+ ///
+ ///
+ /// - Thrown if header is not from a BMP.
+ /// - Info header size has the wrong value.
+ /// - Number of planes is not 1. Can not read file.
+ /// - Total Image Size is smaller than pure image size.
+ ///
+ ///
+ /// Thrown if pixelsize is other then 32 / 24 or the file compressed.
+ /// Thrown if the caller does not have permissions to read / write the file.
+ /// Thrown if the file cannot be found.
+ /// Thrown if the specified path is invalid.
+ /// Thrown if the specified path is exceed the system-defined max length.
+ public Bitmap(string path) : this(path, ColorOrder.BGR)
+ {
+ }
///
/// Create new instance of the class, with a specified path to a BMP file.
@@ -101,6 +143,29 @@ namespace Cosmos.System.Graphics
CreateBitmap(fs, colorOrder);
}
}
+
+ ///
+ /// Create new inctanse of the class, with a specified image data byte array.
+ ///
+ /// byte array.
+ /// Thrown if imageData is null / memory error.
+ /// Thrown on memory error.
+ /// Thrown on fatal error (contact support).
+ /// Thrown on IO error.
+ /// Thrown on fatal error (contact support).
+ /// Thrown on fatal error (contact support).
+ ///
+ ///
+ /// - Thrown if header is not from a BMP.
+ /// - Info header size has the wrong value.
+ /// - Number of planes is not 1.
+ /// - Total Image Size is smaller than pure image size.
+ ///
+ ///
+ /// Thrown if pixelsize is other then 32 / 24 or the file compressed.
+ public Bitmap(byte[] imageData) : this(imageData, ColorOrder.BGR) //Call the image constructor with wrong values
+ {
+ }
///
/// Create new inctanse of the class, with a specified image data byte array.