Пример #1
0
    private NativeMagickGeometry CreateNativeInstance()
    {
      NativeMagickGeometry instance = new NativeMagickGeometry();
      instance.Initialize(ToString());

      return instance;
    }
Пример #2
0
    private NativeMagickGeometry CreateNativeInstance()
    {
      NativeMagickGeometry instance = new NativeMagickGeometry();
      instance.Initialize(ToString());

      return instance;
    }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MagickGeometry"/> class using the specified geometry.
        /// </summary>
        /// <param name="value">Geometry specifications in the form: &lt;width&gt;x&lt;height&gt;
        /// {+-}&lt;xoffset&gt;{+-}&lt;yoffset&gt; (where width, height, xoffset, and yoffset are numbers)</param>
        public MagickGeometry(string value)
        {
            Throw.IfNullOrEmpty(nameof(value), value);

            using (NativeMagickGeometry instance = new NativeMagickGeometry())
            {
                GeometryFlags flags = instance.Initialize(value);
                Initialize(instance, flags);
            }
        }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MagickGeometry"/> class using the specified geometry.
        /// </summary>
        /// <param name="value">Geometry specifications in the form: &lt;width&gt;x&lt;height&gt;
        /// {+-}&lt;xoffset&gt;{+-}&lt;yoffset&gt; (where width, height, xoffset, and yoffset are numbers)</param>
        public MagickGeometry(string value)
        {
            Throw.IfNullOrEmpty(nameof(value), value);

            using (var instance = new NativeMagickGeometry())
            {
                var flags = instance.Initialize(value);

                if (!EnumHelper.HasFlag(flags, GeometryFlags.AspectRatio))
                {
                    Initialize(instance, flags);
                }
                else
                {
                    InitializeFromAspectRation(instance, value);
                }
            }
        }
Пример #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MagickGeometry"/> class using the specified geometry.
        /// </summary>
        /// <param name="value">Geometry specifications in the form: &lt;width&gt;x&lt;height&gt;
        /// {+-}&lt;xoffset&gt;{+-}&lt;yoffset&gt; (where width, height, xoffset, and yoffset are numbers)</param>
        public MagickGeometry(string value)
        {
            Throw.IfNullOrEmpty(nameof(value), value);

            using (var instance = new NativeMagickGeometry())
            {
                var flags = instance.Initialize(value);

                if (!EnumHelper.HasFlag(flags, GeometryFlags.AspectRatio))
                {
                    Initialize(instance, flags);
                    return;
                }

                AspectRatio = true;
                var ratio = value.Split(':');
                Width  = int.Parse(ratio[0]);
                Height = int.Parse(ratio[1]);
            }
        }
Пример #6
0
    /// <summary>
    /// Initializes a new instance of the <see cref="MagickGeometry"/> class using the specified geometry.
    /// </summary>
    /// <param name="value">Geometry specifications in the form: &lt;width&gt;x&lt;height&gt;
    /// {+-}&lt;xoffset&gt;{+-}&lt;yoffset&gt; (where width, height, xoffset, and yoffset are numbers)</param>
    public MagickGeometry(string value)
    {
      Throw.IfNullOrEmpty(nameof(value), value);

      using (NativeMagickGeometry instance = new NativeMagickGeometry())
      {
        GeometryFlags flags = instance.Initialize(value);
        Initialize(instance, flags);
      }
    }