Exemplo n.º 1
0
 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));
     }
 }
Exemplo n.º 2
0
 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);
     }
 }