Exemplo n.º 1
0
        internal static Image MakeBclim(string path, char fc)
        {
            byte[] bclim = Bclim.GetBclim(path, fc);
            string fp    = Path.GetFileNameWithoutExtension(path);

            if (fp == null)
            {
                throw new ArgumentNullException(nameof(path), "Path does not contain a file name");
            }

            fp = $"new_{fp.Substring( fp.IndexOf( '_' ) + 1 )}";
            string pp      = Path.GetDirectoryName(path);
            string newPath = Path.Combine(pp, fp + ".bclim");

            File.WriteAllBytes(newPath, bclim);

            return(Bclim.MakeBmp(newPath));
        }
Exemplo n.º 2
0
        internal static void OpenFile(string path, bool autosave = false, bool crop = true, char format = 'X')
        {
            // Handle file
            if (!File.Exists(path))
            {
                throw new Exception("Can only accept files, not folders");
            }
            string ext = Path.GetExtension(path);

            switch (ext)
            {
            case ".png":
                Bclim.MakeBclim(path, format);
                break;

            case ".bin":
            case ".bclim":
                Bclim.MakeBmp(path, autosave, crop);
                break;
            }
        }