aboutsummaryrefslogtreecommitdiff
path: root/shiftskn/Pic2PNG.cs
blob: 7afc57e425c3b4884e09536c22496ad3112b4380 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;

namespace shiftskn
{
    public abstract class Pic2PNG
    {
        public static void Convert(string input, string output = "")
        {
            if (output == "" || output == null)
            {
                output = input;
            }
            Image pic = Image.FromFile(input);
            output = Path.ChangeExtension(output, "png");
            pic.Save(output, ImageFormat.Png);
            Console.WriteLine("Converted " + Path.GetFileName(input) + " to " + Path.GetFileName(output));
        }
    }
}