示例#1
0
        static void Main(string[] args)
        {
            ImagePath = args[0];

            var editableImage = EditableImage.FromFilePath(ImagePath);

            var watermarkLocation = new WatermarkLocation
            {
                Location = Location.BottomLeft,
                ImageMarginPercentage = 2.5,
                ImageSizePercentage   = 15
            };

            var watermarkImage = EditableImage.FromFilePath(Path.Combine(Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName), "watermark-disney-white.png"));

            var watermarkApplier = new WatermarkApplier(watermarkLocation, watermarkImage);

            watermarkApplier.Apply(editableImage);

            foreach (var border in _borders)
            {
                var borderApplier = new PercentageBorderApplier(border.Value, border.Key);
                editableImage = borderApplier.Apply(editableImage);
            }

            editableImage.Save();
        }
示例#2
0
        static void Main(string[] args)
        {
            try
            {
                ImagePath = args[0];

                if (_isDebugging)
                {
                    Console.WriteLine("Press key to start");
                    Console.ReadLine();
                    Console.WriteLine(ImagePath);
                }

                var editableImage = EditableImage.FromFilePath(ImagePath);

                if (_isDebugging)
                {
                    Console.WriteLine(editableImage.Path);
                }

                var selector = new MetadataSelector();

                var steps = selector.GetProcessSteps(editableImage);

                if (_isDebugging)
                {
                    foreach (var step in steps.Steps)
                    {
                        Console.WriteLine(step.Id);
                    }
                }

                foreach (var step in steps.Steps)
                {
                    editableImage = step.Apply(editableImage);
                }

                if (_isDebugging)
                {
                    Console.WriteLine("Ready to write");
                }

                editableImage.Save();

                if (_isDebugging)
                {
                    Console.WriteLine("END");
                    Console.ReadLine();
                }
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e.StackTrace);
                Console.WriteLine("Please press enter to close this once you have addressed the error.");
                Console.ReadLine();
            }
        }
示例#3
0
        static void Main(string[] args)
        {
            ImagePath = args[0];

            var editableImage = EditableImage.FromFilePath(ImagePath);

            var borderApplier = new PercentageBorderApplier(BorderWidthPercentage, BorderColor);

            editableImage = borderApplier.Apply(editableImage);

            editableImage.Save();
        }
示例#4
0
        static void Main(string[] args)
        {
            ImagePath = args[0];

            var editableImage = EditableImage.FromFilePath(ImagePath);

            foreach (var border in _borders)
            {
                var borderApplier = new PercentageBorderApplier(border.Value, border.Key);
                editableImage = borderApplier.Apply(editableImage);
            }

            editableImage.Save();
        }