BitmapDataExtensionsCopyTo Method
The overloads of the
CopyTo method can be grouped into the following categories:
- The overloads with a Rectangle parameter allow to copy only a portion of the source bitmap.
- If an overload has an IQuantizer parameter, then it allows limiting the set of colors of the result even if the pixel format of the target would allow more colors.
- If the target pixel format has a low bit-per-pixel value or you use a quantizer and you want to preserve the details as much as possible, then look for the
overloads that have an IDitherer parameter.
- To be able to configure the degree of parallelism, cancellation or progress reporting, look for the overloads whose last parameter is
a ParallelConfig instance.
- One overload has an IAsyncContext parameter.
That method is a special one and is designed to be used from your custom asynchronous methods where copying a bitmap is just one step of potentially multiple operations.
But you can also use that overload to force synchronous execution on a single thread.
See the Examples section of the AsyncHelper
class for details about how to create a context for possibly async top level methods.
- All of these methods block the caller on the current thread. For asynchronous call
you can use the CopyToAsync method (on .NET Framework 4.0 and above),
or the old-fashioned BeginCopyTo method that works on every platform target.
Note that these methods preserve the original size of the source bitmap, and copy even the alpha pixels without alpha blending.
To draw a bitmap data into another one with blending and potential resizing, use the
DrawInto methods instead.
CopyTo(IReadableBitmapData, IWritableBitmapData, Point, IDitherer) |
Copies the source IReadableBitmapData into the target IWritableBitmapData
without scaling and blending. This method works between any pair of source and target KnownPixelFormats and supports quantizing and dithering.
To draw a bitmap data into another one with blending use the DrawInto methods instead.
|
CopyTo(IReadableBitmapData, IWritableBitmapData, Point, IQuantizer, IDitherer) |
Copies the source IReadableBitmapData into the target IWritableBitmapData
without scaling and blending. This method works between any pair of source and target KnownPixelFormats and supports quantizing and dithering.
To draw a bitmap data into another one with blending use the DrawInto methods instead.
|
CopyTo(IReadableBitmapData, IWritableBitmapData, Rectangle, Point, IDitherer) |
Copies the source IReadableBitmapData into the target IWritableBitmapData
without scaling and blending. This method works between any pair of source and target KnownPixelFormats and supports quantizing and dithering.
To draw a bitmap data into another one with blending use the DrawInto methods instead.
|
CopyTo(IReadableBitmapData, IWritableBitmapData, Point, IQuantizer, IDitherer, ParallelConfig) |
Copies the source IReadableBitmapData into the target IWritableBitmapData
without scaling and blending. This method works between any pair of source and target KnownPixelFormats and supports quantizing and dithering.
To draw a bitmap data into another one with blending use the DrawInto methods instead.
|
CopyTo(IReadableBitmapData, IWritableBitmapData, Rectangle, Point, IQuantizer, IDitherer) |
Copies the source IReadableBitmapData into the target IWritableBitmapData
without scaling and blending. This method works between any pair of source and target KnownPixelFormats and supports quantizing and dithering.
To draw a bitmap data into another one with blending use the DrawInto methods instead.
|
CopyTo(IReadableBitmapData, IWritableBitmapData, IAsyncContext, Rectangle, Point, IQuantizer, IDitherer) |
Copies the source IReadableBitmapData into the target IWritableBitmapData
without scaling and blending, using a context that may belong to a higher level, possibly asynchronous operation.
|
CopyTo(IReadableBitmapData, IWritableBitmapData, Rectangle, Point, IQuantizer, IDitherer, ParallelConfig) |
Copies the source IReadableBitmapData into the target IWritableBitmapData
without scaling and blending. This method works between any pair of source and target KnownPixelFormats and supports quantizing and dithering.
To draw a bitmap data into another one with blending use the DrawInto methods instead.
|