static public Image LoadImageByPath(string ImagePath) { if (Path.GetExtension(ImagePath).Equals("TGA", StringComparison.CurrentCultureIgnoreCase)) { ImageTGA tmpImageTGA = new ImageTGA(ImagePath); return(tmpImageTGA.Image); } else { return(Image.FromFile(ImagePath)); } }
static public void SaveImageByPath(string OriginalPath, string TargetPath) { if (Path.GetExtension(OriginalPath).Equals("TGA", StringComparison.CurrentCultureIgnoreCase)) { File.Copy(OriginalPath, TargetPath, true); } else { Bitmap tmpImage = new Bitmap(OriginalPath); ImageTGA tmpImageTGA = new ImageTGA(); tmpImageTGA.Image = tmpImage; tmpImageTGA.SaveImage(TargetPath); } }