示例#1
0
        /// <summary>
        /// Loads an iamge using the standard method.
        /// </summary>
        /// <param name="path">The path to the file.</param>
        protected void LoadSafe(string path)
        {
            if (string.IsNullOrEmpty(path))
            {
                return;
            }

            Clear();
            this.Image = IMAGE.StandardLoad(path);
        }
示例#2
0
 /// <summary>
 /// Loads a BMP image and returns it as a bitmap object.
 /// </summary>
 /// <param name="path">The path of the image.</param>
 /// <returns>A <see cref="Bitmap"/> object.</returns>
 public static Bitmap FromFileAsBitmap(string path)
 {
     try
     {
         return(IMAGE.StandardLoad(path));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message + "\r\nIn BMP.FromFileAsBitmap(string)");
     }
 }
示例#3
0
 /// <summary>
 /// Loads a ICO image and returns it as a bitmap object.
 /// </summary>
 /// <param name="path">The path of the image.</param>
 /// <returns>A <see cref="Bitmap"/> object.</returns>
 public static Bitmap FromFileAsBitmap(string path)
 {
     try
     {
         Bitmap bmp = IMAGE.StandardLoad(path);
         ImageHelper.RotateImageByExifOrientationData(bmp);
         return(bmp);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message + "\r\nIn ICO.FromFileAsBitmap(string)");
     }
 }