예제 #1
0
        /**
         * Create a copy of the pen object
         */
        /// <include file='doc\Pen.uex' path='docs/doc[@for="Pen.Clone"]/*' />
        /// <devdoc>
        ///    Creates an exact copy of this <see cref='System.Drawing.Pen'/>.
        /// </devdoc>
        public object Clone()
        {
            IntPtr clonePen = IntPtr.Zero;

            int status = SafeNativeMethods.GdipClonePen(new HandleRef(this, nativePen), out clonePen);

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

            return(new Pen(clonePen));
        }