This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BitmapLoader | |
{ | |
private static byte[] PNG_IDENTIFIER = { 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A }; | |
/// <summary> | |
/// Loads an image, checks if it is a PNG containing palette transparency, and if so, ensures it loads correctly. | |
/// The theory can be found at http://www.libpng.org/pub/png/book/chapter08.html | |
/// </summary> | |
/// <param name="filename">Filename to load</param> | |
/// <returns>The loaded image</returns> |