예제 #1
0
        private static void Main(string[] args)
        {
            Parser.Default.ParseArguments <Options>(args)
            .WithParsed(options =>
            {
                if (!File.Exists(options.InputPath))
                {
                    throw new FileNotFoundException($"Cannot find file : {options.InputPath}");
                }

                using (new MagickTmpDir())
                {
                    using var archive       = InputArchive.FromFile(options.InputPath);
                    using var templateImage = new MagickImage(options.TemplatePath);
                    ImageAssembler.AssembleImage(templateImage, archive, options.OutputPath, options.Duplicates);

                    Console.WriteLine($"Done output file : {options.OutputPath}");
                }
            });
        }
        public static void AssembleImage(IMagickImage template, InputArchive archive, string outputPath, bool duplicates)
        {
            var assembler = new ImageAssembler(template, archive, duplicates);

            assembler.CreateMosaic(outputPath);
        }