Exemplo n.º 1
0
 /// <summary> Initializes a new instance of the ImageMagickSharp.PixelWand class. </summary>
 /// <exception cref="Exception"> Thrown when an exception error condition occurs. </exception>
 public PixelWand()
 {
     this.Handle = PixelWandInterop.NewPixelWand();
     if (this.Handle == IntPtr.Zero)
     {
         throw new Exception("Error acquiring pixel wand.");
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Releases the unmanaged resources used by the ImageMagickSharp.PixelWand and optionally
 /// releases the managed resources. </summary>
 /// <param name="disposing"> true to release both managed and unmanaged resources; false to
 /// release only unmanaged resources. </param>
 protected virtual void Dispose(bool disposing)
 {
     if (this.Handle != IntPtr.Zero)
     {
         PixelWandInterop.DestroyPixelWand(this);
         this.Handle = IntPtr.Zero;
     }
 }
Exemplo n.º 3
0
        /// <summary> Gets or sets the red. </summary>
        /// <value> The red. </value>

        /*private double Red
         * {
         *      get { return PixelWandInterop.PixelGetRed(this); }
         *      set { PixelWandInterop.PixelSetRed(this, value); }
         * }
         *
         * /// <summary> Gets or sets the green. </summary>
         * /// <value> The green. </value>
         * private double Green
         * {
         *      get { return PixelWandInterop.PixelGetGreen(this); }
         *      set { PixelWandInterop.PixelSetGreen(this, value); }
         * }
         *
         * /// <summary> Gets or sets the blue. </summary>
         * /// <value> The blue. </value>
         * private double Blue
         * {
         *      get { return PixelWandInterop.PixelGetBlue(this); }
         *      set { PixelWandInterop.PixelSetBlue(this, value); }
         * }*/
        #endregion

        #region [Wand Methods - Exception]

        /// <summary> Gets the exception. </summary>
        /// <returns> The exception. </returns>
        public override IntPtr GetException(out int exceptionSeverity)
        {
            IntPtr exceptionPtr = PixelWandInterop.PixelGetException(this, out exceptionSeverity);

            return(exceptionPtr);
        }
Exemplo n.º 4
0
 /// <summary> Clears the exception. </summary>
 /// <returns> An IntPtr. </returns>
 public override void ClearException()
 {
     PixelWandInterop.PixelClearException(this);
 }
Exemplo n.º 5
0
        /// <summary> From a RGB. </summary>
        /// <param name="alpha"> The alpha. </param>
        /// <param name="red"> The red. </param>
        /// <param name="green"> The green. </param>
        /// <param name="blue"> The blue. </param>
        /// <returns> A PixelWand. </returns>

        /*private static PixelWand FromARGB(double alpha, double red, double green, double blue)
         * {
         *      return new PixelWand()
         *      {
         *              Alpha = alpha,
         *              Red = red,
         *              Green = green,
         *              Blue = blue,
         *      };
         * }
         *
         * /// <summary> From RGB. </summary>
         * /// <param name="red"> The red. </param>
         * /// <param name="green"> The green. </param>
         * /// <param name="blue"> The blue. </param>
         * /// <returns> A PixelWand. </returns>
         * private static PixelWand FromRGB(double red, double green, double blue)
         * {
         *      return new PixelWand()
         *      {
         *              Red = red,
         *              Green = green,
         *              Blue = blue,
         *      };
         * }*/

        #endregion

        #region [Pixel Wand]

        /// <summary> Clears the pixel wand. </summary>

/*		private void ClearPixelWand()
 *              {
 *                      PixelWandInterop.ClearPixelWand(this);
 *              }
 *
 *              /// <summary> Clone pixel wand. </summary>
 *              /// <returns> A PixelWand. </returns>
 *              private PixelWand ClonePixelWand()
 *              {
 *                      return new PixelWand(PixelWandInterop.ClonePixelWand(this));
 *              }*/

        /// <summary> Destroys the pixel wand. </summary>
        private void DestroyPixelWand()
        {
            PixelWandInterop.DestroyPixelWand(this);
        }