/// <summary>
 /// Clears the color matrix.
 /// </summary>
 public void ClearColorMatrix()
 {
     colorMatrix = null;
     colorMatrixFlags = ColorMatrixFlag.Default;
     colorAdjustType = ColorAdjustType.Default;
     isColorMatrixSet = false;
 }
 public void SetColorMatrix(ColorMatrix newColorMatrix, ColorMatrixFlag mode, ColorAdjustType type)
 {
     colorMatrix = newColorMatrix;
     colorMatrixFlags = mode;
     colorAdjustType = type;
     isColorMatrixSet = true;
 }
Example #3
0
		public void SetColorMatrices(ColorMatrix newColorMatrix, ColorMatrix gMatrix, ColorMatrixFlag mode, ColorAdjustType type)
		{
			clrMatrix = newColorMatrix;
			this.gMatrix = gMatrix;
			clrMatrixFlag = mode;
			clrAdjustType = type;
		}
 Reset(
     ColorAdjustType type
     )
 {
     return SetStatus(NativeMethods.GdipResetImageAttributes(
                                         nativeImageAttr,
                                         type));
 }
 SetToIdentity(
     ColorAdjustType type
     )
 {
     return SetStatus(NativeMethods.GdipSetImageAttributesToIdentity(
                                         nativeImageAttr,
                                         type));
 }
Example #6
0
 public GpStatus ClearNoOp(
     ColorAdjustType type
     )
 {
     return SetStatus(GdiPlus.GdipSetImageAttributesNoOp(
                                         nativeImageAttr,
                                         type,
                                         false));
 }
Example #7
0
 GpStatus ClearNoOp(
     ColorAdjustType type
     )
 {
     return SetStatus(NativeMethods.GdipSetImageAttributesNoOp(
                                         nativeImageAttr,
                                         type,
                                         false));
 }
Example #8
0
 GpStatus ClearGamma(
     ColorAdjustType type
     )
 {
     return SetStatus(NativeMethods.GdipSetImageAttributesGamma(
                                         nativeImageAttr,
                                         type,
                                         false,
                                         0.0f));
 }
Example #9
0
 GpStatus ClearColorKey(
     ColorAdjustType type
     )
 {
     return SetStatus(NativeMethods.GdipSetImageAttributesColorKeys(
                                         nativeImageAttr,
                                         type,
                                         false,
                                         0,
                                         0));
 }
Example #10
0
        /// <include file='doc\ImageAttributes.uex' path='docs/doc[@for="ImageAttributes.ClearColorKey1"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public void ClearColorKey(ColorAdjustType type)
        {
            int zero = 0;
            int status = SafeNativeMethods.Gdip.GdipSetImageAttributesColorKeys(
                                        new HandleRef(this, nativeImageAttributes),
                                        type,
                                        false,
                                        zero,
                                        zero);

            if (status != SafeNativeMethods.Gdip.Ok)
                throw SafeNativeMethods.Gdip.StatusException(status);
        }
Example #11
0
        public void SetGamma(float gamma, ColorAdjustType type)
        {
            int status = Gdip.GdipSetImageAttributesGamma(
                new HandleRef(this, nativeImageAttributes),
                type,
                true,
                gamma);

            if (status != Gdip.Ok)
            {
                throw Gdip.StatusException(status);
            }
        }
Example #12
0
 GpStatus SetColorKey(
     Color colorLow,
     Color colorHigh,
     ColorAdjustType type
     )
 {
     return(SetStatus(NativeMethods.GdipSetImageAttributesColorKeys(
                          nativeImageAttr,
                          type,
                          true,
                          colorLow.ToArgb(),
                          colorHigh.ToArgb())));
 }
Example #13
0
        public void ClearGamma(ColorAdjustType type)
        {
            int status = Gdip.GdipSetImageAttributesGamma(
                new HandleRef(this, nativeImageAttributes),
                type,
                false,
                0.0f);

            if (status != Gdip.Ok)
            {
                throw Gdip.StatusException(status);
            }
        }
Example #14
0
        public void SetOutputChannel(ColorChannelFlag flags, ColorAdjustType type)
        {
            int status = Gdip.GdipSetImageAttributesOutputChannel(
                new HandleRef(this, nativeImageAttributes),
                type,
                true,
                flags);

            if (status != Gdip.Ok)
            {
                throw Gdip.StatusException(status);
            }
        }
Example #15
0
        /// <include file='doc\ImageAttributes.uex' path='docs/doc[@for="ImageAttributes.ClearColorMatrix1"]/*' />
        /// <devdoc>
        ///    <para>
        ///       Clears the color adjust matrix.
        ///    </para>
        /// </devdoc>
        public void ClearColorMatrix(ColorAdjustType type)
        {
            int status = SafeNativeMethods.Gdip.GdipSetImageAttributesColorMatrix(
                new HandleRef(this, nativeImageAttributes),
                type,
                false,
                null,
                null,
                ColorMatrixFlag.Default);

            if (status != SafeNativeMethods.Gdip.Ok)
                throw SafeNativeMethods.Gdip.StatusException(status);
        }
Example #16
0
        /// <include file='doc\ImageAttributes.uex' path='docs/doc[@for="ImageAttributes.SetColorMatrix2"]/*' />
        /// <devdoc>
        ///    <para>
        ///       Sets the 5 X 5 color adjust matrix to the specified 'Matrix' with the 
        ///       specified 'ColorMatrixFlags'.
        ///    </para>
        /// </devdoc>
        public void SetColorMatrix(ColorMatrix newColorMatrix, ColorMatrixFlag mode, ColorAdjustType type)
        {
            int status = SafeNativeMethods.Gdip.GdipSetImageAttributesColorMatrix(
                        new HandleRef(this, nativeImageAttributes),
                        type,
                        true,
                        newColorMatrix,
                        null,
                        mode);

            if (status != SafeNativeMethods.Gdip.Ok)
                throw SafeNativeMethods.Gdip.StatusException(status);
        }
Example #17
0
        public void ClearOutputChannelColorProfile(ColorAdjustType type)
        {
            int status = Gdip.GdipSetImageAttributesOutputChannel(
                new HandleRef(this, nativeImageAttributes),
                type,
                false,
                ColorChannelFlag.ColorChannelLast);

            if (status != Gdip.Ok)
            {
                throw Gdip.StatusException(status);
            }
        }
Example #18
0
        public void SetThreshold(float threshold, ColorAdjustType type)
        {
            int status = Gdip.GdipSetImageAttributesThreshold(
                new HandleRef(this, nativeImageAttributes),
                type,
                true,
                threshold);

            if (status != Gdip.Ok)
            {
                throw Gdip.StatusException(status);
            }
        }
Example #19
0
 public GpStatus SetColorKey(
      Color colorLow,
      Color colorHigh,
     ColorAdjustType type
     )
 {
     return SetStatus(NativeMethods.GdipSetImageAttributesColorKeys(
                                         nativeImageAttr,
                                         type,
                                         true,
                                         colorLow.ToArgb(),
                                         colorHigh.ToArgb()));
 }
Example #20
0
        public void ClearRemapTable(ColorAdjustType type)
        {
            int status = Gdip.GdipSetImageAttributesRemapTable(
                new HandleRef(this, nativeImageAttributes),
                type,
                false,
                0,
                NativeMethods.NullHandleRef);

            if (status != Gdip.Ok)
            {
                throw Gdip.StatusException(status);
            }
        }
	// Get the attribute information for a specific ColorAdjustType value.
	private AttributeInfo GetInfo(ColorAdjustType type)
			{
				AttributeInfo current = info;
				while(current != null)
				{
					if(current.type == type)
					{
						return current;
					}
					current = current.next;
				}
				info = new AttributeInfo(info, type);
				return info;
			}
Example #22
0
        public void SetOutputChannelColorProfile(String colorProfileFilename,
                                                 ColorAdjustType type)
        {
            int status = SafeNativeMethods.Gdip.GdipSetImageAttributesOutputChannelColorProfile(
                new HandleRef(this, nativeImageAttributes),
                type,
                true,
                colorProfileFilename);

            if (status != SafeNativeMethods.Gdip.Ok)
            {
                throw SafeNativeMethods.Gdip.StatusException(status);
            }
        }
Example #23
0
        // Get the attribute information for a specific ColorAdjustType value.
        private AttributeInfo GetInfo(ColorAdjustType type)
        {
            AttributeInfo current = info;

            while (current != null)
            {
                if (current.type == type)
                {
                    return(current);
                }
                current = current.next;
            }
            info = new AttributeInfo(info, type);
            return(info);
        }
Example #24
0
        /// <include file='doc\ImageAttributes.uex' path='docs/doc[@for="ImageAttributes.SetColorKey1"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public void SetColorKey(Color colorLow, Color colorHigh, ColorAdjustType type)
        {
            int lowInt = colorLow.ToArgb();
            int highInt = colorHigh.ToArgb();

            int status = SafeNativeMethods.Gdip.GdipSetImageAttributesColorKeys(
                                        new HandleRef(this, nativeImageAttributes),
                                        type,
                                        true,
                                        lowInt,
                                        highInt);

            if (status != SafeNativeMethods.Gdip.Ok)
                throw SafeNativeMethods.Gdip.StatusException(status);
        }
        public void GetAdjustedPalette(ColorPalette palette, ColorAdjustType type)
        {
            IntPtr colorPalette = palette.getGDIPalette();

            try {
                Status status = GDIPlus.GdipGetImageAttributesAdjustedPalette(nativeImageAttr, colorPalette, type);
                GDIPlus.CheckStatus(status);
                palette.setFromGDIPalette(colorPalette);
            } finally {
                if (colorPalette != IntPtr.Zero)
                {
                    Marshal.FreeHGlobal(colorPalette);
                }
            }
        }
Example #26
0
        public void SetColorMatrices(ColorMatrix newColorMatrix, ColorMatrix grayMatrix, ColorMatrixFlag mode,
                                     ColorAdjustType type)
        {
            int status = Gdip.GdipSetImageAttributesColorMatrix(
                new HandleRef(this, nativeImageAttributes),
                type,
                true,
                newColorMatrix,
                grayMatrix,
                mode);

            if (status != Gdip.Ok)
            {
                throw Gdip.StatusException(status);
            }
        }
Example #27
0
        public void SetOutputChannelColorProfile(string colorProfileFilename,
                                                 ColorAdjustType type)
        {
            // Called in order to emulate exception behavior from netfx related to invalid file paths.
            Path.GetFullPath(colorProfileFilename);

            int status = Gdip.GdipSetImageAttributesOutputChannelColorProfile(
                new HandleRef(this, nativeImageAttributes),
                type,
                true,
                colorProfileFilename);

            if (status != Gdip.Ok)
            {
                throw Gdip.StatusException(status);
            }
        }
Example #28
0
        /// <include file='doc\ImageAttributes.uex' path='docs/doc[@for="ImageAttributes.GetAdjustedPalette"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public void GetAdjustedPalette(ColorPalette palette, ColorAdjustType type)
        {
            // does inplace adjustment
            IntPtr memory = palette.ConvertToMemory();

            int status = SafeNativeMethods.GdipGetImageAttributesAdjustedPalette(
                new HandleRef(this, nativeImageAttributes), new HandleRef(null, memory), type);

            if (status != SafeNativeMethods.Ok)
            {
                Marshal.FreeHGlobal(memory);
                throw SafeNativeMethods.StatusException(status);
            }

            palette.ConvertFromMemory(memory);
            Marshal.FreeHGlobal(memory);
        }
        public void GetAdjustedPalette(ColorPalette palette, ColorAdjustType type)
        {
            IntPtr handle = palette.ConvertToMemory();

            try
            {
                int status = SafeNativeMethods.Gdip.GdipGetImageAttributesAdjustedPalette(new HandleRef(this, this.nativeImageAttributes), new HandleRef(null, handle), type);
                if (status != 0)
                {
                    throw SafeNativeMethods.Gdip.StatusException(status);
                }
                palette.ConvertFromMemory(handle);
            }
            finally
            {
                if (handle != IntPtr.Zero)
                {
                    Marshal.FreeHGlobal(handle);
                }
            }
        }
Example #30
0
        public void GetAdjustedPalette(ColorPalette palette, ColorAdjustType type)
        {
            // does inplace adjustment
            IntPtr memory = palette.ConvertToMemory();

            try
            {
                Gdip.CheckStatus(Gdip.GdipGetImageAttributesAdjustedPalette(
                                     new HandleRef(this, nativeImageAttributes),
                                     memory,
                                     type));
                palette.ConvertFromMemory(memory);
            }
            finally
            {
                if (memory != IntPtr.Zero)
                {
                    Marshal.FreeHGlobal(memory);
                }
            }
        }
Example #31
0
        public void GetAdjustedPalette(ColorPalette palette, ColorAdjustType type)
        {
            // does inplace adjustment
            IntPtr memory = palette.ConvertToMemory();

            try
            {
                int status = Gdip.GdipGetImageAttributesAdjustedPalette(
                    new HandleRef(this, nativeImageAttributes), new HandleRef(null, memory), type);

                if (status != Gdip.Ok)
                {
                    throw Gdip.StatusException(status);
                }
                palette.ConvertFromMemory(memory);
            }
            finally
            {
                if (memory != IntPtr.Zero)
                {
                    Marshal.FreeHGlobal(memory);
                }
            }
        }
Example #32
0
 public void SetThreshold(float threshold, ColorAdjustType type) => throw new NotImplementedException();
Example #33
0
 public void ClearOutputChannelColorProfile(ColorAdjustType type) => throw new NotImplementedException();
Example #34
0
 public void SetOutputChannelColorProfile(string colorProfileFilename, ColorAdjustType type) => throw new NotImplementedException();
        /// <include file='doc\ImageAttributes.uex' path='docs/doc[@for="ImageAttributes.ClearNoOp1"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public void ClearNoOp(ColorAdjustType type)
            {
                int status = SafeNativeMethods.Gdip.GdipSetImageAttributesNoOp(
                    new HandleRef(this, nativeImageAttributes),
                    type,
                    false);

            if (status != SafeNativeMethods.Gdip.Ok)
                    throw SafeNativeMethods.Gdip.StatusException(status);
            }
Example #36
0
 internal static extern GpStatus GdipResetImageAttributes(GpImageAttributes imageattr,
     ColorAdjustType type);
Example #37
0
 public void SetColorMatrices(ColorMatrix newColorMatrix, ColorMatrix?grayMatrix, ColorMatrixFlag mode,
                              ColorAdjustType type)
 {
     throw new PlatformNotSupportedException();
 }
Example #38
0
 public void ClearColorMatrix(ColorAdjustType type)
 {
     // FIXME
 }
        /// <include file='doc\ImageAttributes.uex' path='docs/doc[@for="ImageAttributes.ClearRemapTable1"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public void ClearRemapTable(ColorAdjustType type)
        {
                int status = SafeNativeMethods.Gdip.GdipSetImageAttributesRemapTable(
                                new HandleRef(this, nativeImageAttributes),
                                type,
                                false,
                                0,
                                NativeMethods.NullHandleRef);

            if (status != SafeNativeMethods.Gdip.Ok)
                    throw SafeNativeMethods.Gdip.StatusException(status);
        }
        /// <include file='doc\ImageAttributes.uex' path='docs/doc[@for="ImageAttributes.SetRemapTable1"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public void SetRemapTable(ColorMap[] map, ColorAdjustType type) {
            int index = 0;
            int mapSize = map.Length;
            int size = 4; // Marshal.SizeOf(index.GetType());
            IntPtr memory = Marshal.AllocHGlobal(checked(mapSize*size*2));

            try {
                for (index=0; index<mapSize; index++) {
                    Marshal.StructureToPtr(map[index].OldColor.ToArgb(), (IntPtr)((long)memory+index*size*2), false);
                    Marshal.StructureToPtr(map[index].NewColor.ToArgb(), (IntPtr)((long)memory+index*size*2+size), false);
                }

                int status = SafeNativeMethods.Gdip.GdipSetImageAttributesRemapTable(
                    new HandleRef(this, nativeImageAttributes),
                    type,
                    true,
                    mapSize,
                    new HandleRef(null, memory));

                if (status != SafeNativeMethods.Gdip.Ok) {
                    throw SafeNativeMethods.Gdip.StatusException(status);
                }
            }
            finally {
                Marshal.FreeHGlobal(memory);
            }
        }
        /// <include file='doc\ImageAttributes.uex' path='docs/doc[@for="ImageAttributes.ClearOutputChannelColorProfile1"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public void ClearOutputChannelColorProfile(ColorAdjustType type)
        {
                int status = SafeNativeMethods.Gdip.GdipSetImageAttributesOutputChannel(
                    new HandleRef(this, nativeImageAttributes),
                    type,
                    false,
                    ColorChannelFlag.ColorChannelLast);

            if (status != SafeNativeMethods.Gdip.Ok)
                    throw SafeNativeMethods.Gdip.StatusException(status);
        }
        /// <include file='doc\ImageAttributes.uex' path='docs/doc[@for="ImageAttributes.SetOutputChannelColorProfile1"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public void SetOutputChannelColorProfile(String colorProfileFilename,
                                                 ColorAdjustType type)
        {
            IntSecurity.DemandReadFileIO(colorProfileFilename);

            int status = SafeNativeMethods.Gdip.GdipSetImageAttributesOutputChannelColorProfile(
                                        new HandleRef(this, nativeImageAttributes),
                                        type,
                                        true,
                                        colorProfileFilename);
                            
            if (status != SafeNativeMethods.Gdip.Ok)
                    throw SafeNativeMethods.Gdip.StatusException(status);
        }
 /// <include file='doc\ImageAttributes.uex' path='docs/doc[@for="ImageAttributes.SetOutputChannel1"]/*' />
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public void SetOutputChannel(ColorChannelFlag flags, ColorAdjustType type)
 {
         int status = SafeNativeMethods.Gdip.GdipSetImageAttributesOutputChannel(
             new HandleRef(this, nativeImageAttributes),
             type,
             true,
             flags);
                     
     if (status != SafeNativeMethods.Gdip.Ok)
             throw SafeNativeMethods.Gdip.StatusException(status);
     }
        /// <include file='doc\ImageAttributes.uex' path='docs/doc[@for="ImageAttributes.ClearColorKey1"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public void ClearColorKey(ColorAdjustType type)
            {
            int zero = 0;
            int status = SafeNativeMethods.Gdip.GdipSetImageAttributesColorKeys(
                                        new HandleRef(this, nativeImageAttributes),
                                        type,
                                        false,
                                        zero,
                                        zero);

           if (status != SafeNativeMethods.Gdip.Ok)
                    throw SafeNativeMethods.Gdip.StatusException(status);
            }
        /// <include file='doc\ImageAttributes.uex' path='docs/doc[@for="ImageAttributes.SetColorKey1"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public void SetColorKey(Color colorLow, Color colorHigh, ColorAdjustType type)
        {
            int lowInt = colorLow.ToArgb();
            int highInt = colorHigh.ToArgb();

            int status = SafeNativeMethods.Gdip.GdipSetImageAttributesColorKeys(
                                        new HandleRef(this, nativeImageAttributes),
                                        type,
                                        true,
                                        lowInt,
                                        highInt);

            if (status != SafeNativeMethods.Gdip.Ok)
                throw SafeNativeMethods.Gdip.StatusException(status);
            }
Example #46
0
 public void ClearThreshold(ColorAdjustType type) => throw new NotImplementedException();
Example #47
0
 public void GetAdjustedPalette(ColorPalette palette, ColorAdjustType type) => throw new NotImplementedException();
 /// <include file='doc\ImageAttributes.uex' path='docs/doc[@for="ImageAttributes.GetAdjustedPalette"]/*' />
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public void GetAdjustedPalette(ColorPalette palette, ColorAdjustType type)
 {
     // does inplace adjustment
     IntPtr memory = palette.ConvertToMemory();
     try {
         int status = SafeNativeMethods.Gdip.GdipGetImageAttributesAdjustedPalette(
                             new HandleRef(this, nativeImageAttributes), new HandleRef(null, memory), type);
                                         
         if (status != SafeNativeMethods.Gdip.Ok) {
             throw SafeNativeMethods.Gdip.StatusException(status);
         }
         palette.ConvertFromMemory(memory);
     } finally {
         if(memory != IntPtr.Zero) {
             Marshal.FreeHGlobal(memory);
         }
     }
 }
Example #49
0
 /// <summary>
 /// Clears the gamma for the color adjust type.
 /// </summary>
 /// <param name="type">Type.</param>
 public void ClearGamma(ColorAdjustType type)
 {
     isGammaSet = false;
 }
Example #50
0
		private static Color ProcessColorMatrices (Color color, ColorMatrix colorMatrix, ColorMatrix grayMatrix, ColorMatrixFlag flags, ColorAdjustType type)
		{
			using (Bitmap bmp = new Bitmap (64, 64)) {
				using (Graphics gr = Graphics.FromImage (bmp)) {
					ImageAttributes imageAttr = new ImageAttributes ();
					bmp.SetPixel (0, 0, color);
					imageAttr.SetColorMatrices (colorMatrix, grayMatrix, flags, type);
					gr.DrawImage (bmp, new Rectangle (0, 0, 64, 64), 0, 0, 64, 64, GraphicsUnit.Pixel, imageAttr);
					return bmp.GetPixel (0, 0);
				}
			}
		}
Example #51
0
 internal static extern GpStatus GdipSetImageAttributesGamma(GpImageAttributes imageattr,
        ColorAdjustType type,
        bool enableFlag,
        float gamma);
Example #52
0
 public void ClearNoOp(ColorAdjustType type) => throw new NotImplementedException();
Example #53
0
 public void SetOutputChannel(ColorChannelFlag flags, ColorAdjustType type) => throw new NotImplementedException();
Example #54
0
 internal static extern GpStatus GdipSetImageAttributesThreshold(GpImageAttributes imageattr,
            ColorAdjustType type,
            bool enableFlag,
            float threshold);
Example #55
0
 internal static extern GpStatus GdipSetImageAttributesColorKeys(GpImageAttributes imageattr,
            ColorAdjustType type,
            bool enableFlag,
            int colorLow,
            int colorHigh);
        /// <include file='doc\ImageAttributes.uex' path='docs/doc[@for="ImageAttributes.SetColorMatrices2"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public void SetColorMatrices(ColorMatrix newColorMatrix, ColorMatrix grayMatrix, ColorMatrixFlag mode, 
                                     ColorAdjustType type)
            {
                int status = SafeNativeMethods.Gdip.GdipSetImageAttributesColorMatrix(
                    new HandleRef(this, nativeImageAttributes),
                    type,
                    true,
                    newColorMatrix,
                    grayMatrix,
                    mode);

                if (status != SafeNativeMethods.Gdip.Ok)
                    throw SafeNativeMethods.Gdip.StatusException(status);
            }   
Example #57
0
 internal static extern GpStatus GdipSetImageAttributesNoOp(GpImageAttributes imageattr,
       ColorAdjustType type,
       bool enableFlag);
 /// <include file='doc\ImageAttributes.uex' path='docs/doc[@for="ImageAttributes.SetThreshold1"]/*' />
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public void SetThreshold(float threshold, ColorAdjustType type)
     {
         int status = SafeNativeMethods.Gdip.GdipSetImageAttributesThreshold(
             new HandleRef(this, nativeImageAttributes),
             type,
             true,
             threshold);
 
         if (status != SafeNativeMethods.Gdip.Ok)
                 throw SafeNativeMethods.Gdip.StatusException(status);
     }
Example #59
0
 internal static extern GpStatus GdipSetImageAttributesToIdentity(GpImageAttributes imageattr,
             ColorAdjustType type);
        /// <include file='doc\ImageAttributes.uex' path='docs/doc[@for="ImageAttributes.SetGamma1"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public void SetGamma(float gamma, ColorAdjustType type)
            {
                int status = SafeNativeMethods.Gdip.GdipSetImageAttributesGamma(
                    new HandleRef(this, nativeImageAttributes),
                    type,
                    true,
                    gamma);

                if (status != SafeNativeMethods.Gdip.Ok)
                        throw SafeNativeMethods.Gdip.StatusException(status);
        }