[]
        
(Showing Draft Content)

C1.Framework.Drawing.Gdi.DeviceContexts.DeviceContext.Copy

Copy Method

Copy(DeviceContext, Rectangle, Point, RasterOperationCode)

Performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source DeviceContext object into a destination DeviceContext object.

Declaration
public virtual void Copy(DeviceContext deviceContext, Rectangle destRectangle, Point srcPoint, RasterOperationCode rop)
Parameters
Type Name Description
DeviceContext deviceContext

The source DeviceContext object.

Rectangle destRectangle

A Rectangle indicates the destination rectangle.

Point srcPoint

A Point indicates the upper-left corner of source rectangle. The width and height of source rectangle are same as the destination rectangle.

RasterOperationCode rop

A RasterOperationCode indicates the raster operation code.

Remarks

Copy only does clipping on the destination DC.

If a rotation or shear transformation is in effect in the source device context, Copy will throw a SystemErrorException. If other transformations exist in the source device context (and a matching transformation is not in effect in the destination device context), the rectangle in the destination device context is stretched, compressed, or rotated, as necessary.

If the color formats of the source and destination device contexts do not match, the Copy function converts the source color format to match the destination format.

When an enhanced metafile is being recorded, an error occurs if the source device context identifies an enhanced-metafile device context. it means a SystemErrorException would be throw out.

Not all devices support the Copy function. For more information, see the RC_BITBLT raster capability entry in the GetDeviceCaps function as well as the following: MaskBlt, PlgBlt, and StretchBlt.

Exceptions
Type Condition
SystemErrorException

Copy(DeviceContext, Rectangle, Rectangle, RasterOperationCode)

Performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source DeviceContext object into a destination DeviceContext object.

Declaration
public virtual void Copy(DeviceContext deviceContext, Rectangle destRectangle, Rectangle srcRectangle, RasterOperationCode rop)
Parameters
Type Name Description
DeviceContext deviceContext

The source DeviceContext object.

Rectangle destRectangle

A Rectangle indicates the destination rectangle.

Rectangle srcRectangle

A Rectangle indicates the source rectangle.

RasterOperationCode rop

A RasterOperationCode indicates the raster operation code.

Remarks

Copy only does clipping on the destination DC.

Exceptions
Type Condition
SystemErrorException