Exemple #1
0
        public static void GenerateLogo(
            System.Drawing.Color textFillColor,
            System.Drawing.Color borderColor,
            System.Drawing.Color backgroundColor,
            System.Drawing.Color strokeColor,
            System.Drawing.Color shadowColor,
            System.Drawing.Color BackgroundShadow,
            int strokeWidth         = 1,
            bool caption            = true,
            int borderSize          = 4,
            bool border             = true,
            bool BackgroundShadowOn = true,
            string textDesc         = "Long game adventure test",
            string fontName         = @"C:\Windows\Fonts\comicbd.ttf")
        {
            using (var magick = new MagickImage(backgroundColor, 400, 175))
            {
                if (border)
                {
                    using (var borderimage = new MagickImage(new MagickColor(), 400 - 8, 175 - 8))
                    {
                        borderimage.BorderColor = borderColor;
                        borderimage.Border(borderSize);
                        borderimage.Emboss();
                        borderimage.RePage();

                        magick.Composite(borderimage, CompositeOperator.Atop);
                    }

                    if (BackgroundShadowOn)
                    {
                        var clone = AddShadow(magick);
                    }
                }

                var textToWrite = "";
                if (caption)
                {
                    textToWrite = "caption: " + textDesc;
                }
                else
                {
                    textToWrite = "label: " + textDesc;
                }

                using (var textImage = new MagickImage())
                {
                    CreateText(textImage, textToWrite, caption, textFillColor);

                    magick.Composite(textImage, Gravity.Center, CompositeOperator.Over);
                }


                magick.Write("preview.png");
            }
        }
Exemple #2
0
 protected override void ExecuteEffect(ref MagickImage input)
 {
     input.Emboss(Radius, Sigma);
 }