Beispiel #1
0
        /// <summary>
        /// Copies the settings from the specified <see cref="MagickSettings"/>.
        /// </summary>
        /// <param name="settings">The settings to copy the data from.</param>
        protected void Copy(MagickSettings settings)
        {
            if (settings == null)
            {
                return;
            }

            BackgroundColor   = MagickColor.Clone(settings.BackgroundColor);
            ColorSpace        = settings.ColorSpace;
            ColorType         = settings.ColorType;
            CompressionMethod = settings.CompressionMethod;
            Debug             = settings.Debug;
            Density           = Density.Clone(settings.Density);
            Endian            = settings.Endian;
            _Font             = settings._Font;
            _FontPointsize    = settings._FontPointsize;
            Format            = settings.Format;
            Monochrome        = settings.Monochrome;
            Page    = MagickGeometry.Clone(settings.Page);
            Verbose = settings.Verbose;

            ColorFuzz = settings.ColorFuzz;
            Interlace = settings.Interlace;
            Ping      = settings.Ping;
            Quality   = settings.Quality;
            Size      = settings.Size;

            foreach (string key in settings._Options.Keys)
            {
                _Options[key] = settings._Options[key];
            }

            Drawing = settings.Drawing.Clone();
        }
Beispiel #2
0
        internal DrawingSettings Clone()
        {
            DrawingSettings clone = new DrawingSettings();

            clone.BorderColor          = MagickColor.Clone(BorderColor);
            clone.FillColor            = MagickColor.Clone(FillColor);
            clone.FillRule             = FillRule;
            clone.Font                 = Font;
            clone.FontFamily           = FontFamily;
            clone.FontPointsize        = FontPointsize;
            clone.FontStyle            = FontStyle;
            clone.FontWeight           = FontWeight;
            clone.StrokeAntiAlias      = StrokeAntiAlias;
            clone.StrokeColor          = MagickColor.Clone(StrokeColor);
            clone.StrokeDashOffset     = StrokeDashOffset;
            clone.StrokeLineCap        = StrokeLineCap;
            clone.StrokeLineJoin       = StrokeLineJoin;
            clone.StrokeMiterLimit     = StrokeMiterLimit;
            clone.StrokeWidth          = StrokeWidth;
            clone.TextAntiAlias        = TextAntiAlias;
            clone.TextDirection        = TextDirection;
            clone.TextEncoding         = TextEncoding;
            clone.TextGravity          = TextGravity;
            clone.TextInterlineSpacing = TextInterlineSpacing;
            clone.TextInterwordSpacing = TextInterwordSpacing;
            clone.TextKerning          = TextKerning;
            clone.TextUnderColor       = MagickColor.Clone(TextUnderColor);

            clone.Affine           = Affine;
            clone.FillPattern      = MagickImage.Clone(FillPattern);
            clone._StrokeDashArray = _StrokeDashArray != null ? (double[])_StrokeDashArray.Clone() : null;
            clone.StrokePattern    = MagickImage.Clone(StrokePattern);
            clone.Text             = Text;

            return(clone);
        }