Program.cs
/// <summary>
/// Converts all PNGs in the folder to 8-bit color
/// </summary>
/// <exception cref="System.Exception">Catch all error for a number of scenarios</exception>
/// <param name="folderPath"></param>
/// <param name="maxDegreeOfParallelism"></param>
Converts all PNGs in the folder to 8-bit color
Converts all PNGs in the folder to 8 - bit color
public static void To8BitPngByFolder(string folderPath, int maxDegreeOfParallelism = -1)
        {
            string[] files = Directory.GetFiles(folderPath, "*.png");
            var options = new ParallelOptions();
            if (maxDegreeOfParallelism > 0)
            {
                options.MaxDegreeOfParallelism = maxDegreeOfParallelism;
            }
            foreach (var item in files)
            {
                To8BitPngByFile(item);
            }
        }
public static void To8BitPngByFolder ( string folderPath , int maxDegreeOfParallelism = - 1 ) { string [ ] files = Directory . GetFiles ( folderPath , " " ) ; var options = new ParallelOptions ( ) ; if ( maxDegreeOfParallelism > 0 ) { options . MaxDegreeOfParallelism = maxDegreeOfParallelism ; } foreach ( var item in files ) { To8BitPngByFile ( item ) ; } }
Converts all PNGs in the folder to 8-bit color
Converts all PNGs in the folder to 8 - bit color
Catch all error for a number of scenarios
Catch all error for a number of scenarios
folderPath
string
None
maxDegreeOfParallelism
int
None