Exemplo n.º 1
0
        /// <include file='doc\Bitmap.uex' path='docs/doc[@for="Bitmap.GetPixel"]/*' />
        /// <devdoc>
        ///    <para>
        ///       Gets the color of the specified pixel
        ///       in this <see cref='System.Drawing.Bitmap'/>.
        ///    </para>
        /// </devdoc>
        public Color GetPixel(int x, int y)
        {
            int color = 0;

            int status = SafeNativeMethods.GdipBitmapGetPixel(new HandleRef(this, nativeImage), x, y, out color);

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

            return(Color.FromArgb(color));
        }