Example #1
0
        public void OnAddEllipticalMask(object sender, EventArgs evt)
        {
            var guid   = Guid.NewGuid().ToString();
            var mask   = new LayerMask(guid);
            var width  = Project.selectedLayer.Image.Width;
            var height = Project.selectedLayer.Image.Height;

            mask.Image = AutoMagick.EllipticalGradient(MagickColors.Black, MagickColors.White, width, height);

            Project.selectedLayer.AddLayerMask(mask);
        }
Example #2
0
        public LayerGradient(Project project) : base(project)
        {
            var resources = Paths.ResourcesPath(project);

            fileName = Guid.NewGuid().ToString();
            var path   = Path.Combine(resources, "bases", fileName);
            var width  = project.size.width;
            var height = project.size.height;
            var image  = AutoMagick.Gradient(StartColor, EndColor, width, height, Angle);

            Directory.CreateDirectory(Path.GetDirectoryName(path));
            image.Write(path, MagickFormat.Bmp);
        }
Example #3
0
        public void GenerateImage()
        {
            var resources = Paths.ResourcesPath(Project);
            var path      = Path.Combine(resources, "bases", fileName);
            var image     = AutoMagick.PerlinNoise(Project.size.width, Project.size.height);

            if (IsColor == false)
            {
                image = (MagickImage)image.Separate(Channels.Green).First();
            }

            Directory.CreateDirectory(Path.GetDirectoryName(path));
            image.Write(path, MagickFormat.Bmp);
            imageOriginal = null;
        }