/// <summary> /// Instanciate a new ImageAdapter object using the specified file containing the Bitmap /// </summary> /// <param name="bitmapFileName">The file containing the Bitmap to use in the Adapter</param> public ImageAdapter(string bitmapFileName) { using (Bitmap bmp = ImageUtility.GetUnlockedBitmap(bitmapFileName)) { InternalConstructor(bmp); } }
/// <summary> /// Load an image as IImageAdapterUnmananged /// </summary> /// <param name="fileName">File name of the image to be loaded</param> void IImageAdapterUnmanaged.Load( string fileName) { using (Bitmap bmp = ImageUtility.GetUnlockedBitmap(fileName)) { InternalConstructor(bmp); } }
private Bitmap GetBitmapFile(string bitmapName) { if (_keys.Count == 0) { throw new ApplicationException("You need to call LoadPackage before trying to access it"); } if (_keys.Contains(MASTERBMP) == false) { return(null); } int index = _keys.IndexOf(MASTERBMP); return(ImageUtility.GetUnlockedBitmap(_keys[index].ToString())); }