BitmapDataExtensionsDrawInto Method

The overloads of the DrawInto method can be grouped into the following categories:
  • The ones that have a Point parameter for target location preserve the original size of the source bitmap.
  • The overloads with a Rectangle and Point parameter allow to draw only a portion of the source bitmap, while they still preserve the original size.
  • There are overloads that allow resizing. These either have no Point parameter but one Rectangle argument to allow drawing the whole source bitmap into the specified target rectangle; or, they have two Rectangle parameters to allow drawing a portion of the source bitmap into the specified target rectangle. All of these methods have also a ScalingMode parameter that specifies the behavior of the potential shrinking or enlarging.
  • 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.
  • A couple of overloads have an IAsyncContext parameter. These methods are special ones and are designed to be used from your custom asynchronous methods where drawing a bitmap into another one is just one step of potentially multiple operations. But you can also use these overloads 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 DrawIntoAsync overloads (on .NET Framework 4.0 and above), or the old-fashioned BeginDrawInto methods that work on every platform target.

  Note

Note that these methods always perform an alpha blending (respecting the WorkingColorSpace of the target bitmap) if the source contains alpha pixels. To copy a bitmap data into another one without blending and resizing, use the CopyTo methods instead.

Overload List

DrawInto(IReadableBitmapData, IReadWriteBitmapData, Point, IDitherer) Draws the source IReadableBitmapData into the target IReadWriteBitmapData without scaling, using blending. This method always preserves the source size in pixels, works between any pair of source and target KnownPixelFormats and supports quantizing and dithering. For scaling use the overloads with targetRectangle and ScalingMode parameters. To copy a bitmap data into another one without blending use the CopyTo methods instead.
DrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, ScalingMode) Draws the source IReadableBitmapData into the target IReadWriteBitmapData using scaling and blending. This method works between any pair of source and target KnownPixelFormats and supports quantizing. To copy a bitmap data into another one without blending use the CopyTo methods instead.
DrawInto(IReadableBitmapData, IReadWriteBitmapData, Point, IQuantizer, IDitherer) Draws the source IReadableBitmapData into the target IReadWriteBitmapData without scaling, using blending. This method always preserves the source size in pixels, works between any pair of source and target KnownPixelFormats and supports quantizing and dithering. For scaling use the overloads with targetRectangle and ScalingMode parameters. To copy a bitmap data into another one without blending use the CopyTo methods instead.
DrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, IDitherer, ScalingMode) Draws the source IReadableBitmapData into the target IReadWriteBitmapData using scaling and blending. This method works between any pair of source and target KnownPixelFormats and supports quantizing and dithering. To copy a bitmap data into another one without blending use the CopyTo methods instead.
DrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, Point, IDitherer) Draws the source IReadableBitmapData into the target IReadWriteBitmapData without scaling, using blending. This method always preserves the source size in pixels, works between any pair of source and target KnownPixelFormats and supports quantizing and dithering. For scaling use the overloads with targetRectangle and ScalingMode parameters. To copy a bitmap data into another one without blending use the CopyTo methods instead.
DrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, Rectangle, ScalingMode) Draws the source IReadableBitmapData into the target IReadWriteBitmapData using scaling and blending. This method works between any pair of source and target KnownPixelFormats and supports quantizing. To copy a bitmap data into another one without blending use the CopyTo methods instead.
DrawInto(IReadableBitmapData, IReadWriteBitmapData, Point, IQuantizer, IDitherer, ParallelConfig) Draws the source IReadableBitmapData into the target IReadWriteBitmapData without scaling, using blending. This method always preserves the source size in pixels, works between any pair of source and target KnownPixelFormats and supports quantizing and dithering. For scaling use the overloads with targetRectangle and ScalingMode parameters. To copy a bitmap data into another one without blending use the CopyTo methods instead.
DrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, IQuantizer, IDitherer, ScalingMode) Draws the source IReadableBitmapData into the target IReadWriteBitmapData using scaling and blending. This method works between any pair of source and target KnownPixelFormats and supports quantizing and dithering. To copy a bitmap data into another one without blending use the CopyTo methods instead.
DrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, Point, IQuantizer, IDitherer) Draws the source IReadableBitmapData into the target IReadWriteBitmapData without scaling, using blending. This method always preserves the source size in pixels, works between any pair of source and target KnownPixelFormats and supports quantizing and dithering. For scaling use the overloads with targetRectangle and ScalingMode parameters. To copy a bitmap data into another one without blending use the CopyTo methods instead.
DrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, Rectangle, IDitherer, ScalingMode) Draws the source IReadableBitmapData into the target IReadWriteBitmapData using scaling and blending. This method works between any pair of source and target KnownPixelFormats and supports quantizing and dithering. To copy a bitmap data into another one without blending use the CopyTo methods instead.
DrawInto(IReadableBitmapData, IReadWriteBitmapData, IAsyncContext, Rectangle, Point, IQuantizer, IDitherer) Draws the source IReadableBitmapData into the target IReadWriteBitmapData without scaling, using a context that may belong to a higher level, possibly asynchronous operation.
DrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, IQuantizer, IDitherer, ScalingMode, ParallelConfig) Draws the source IReadableBitmapData into the target IReadWriteBitmapData using scaling and blending. This method works between any pair of source and target KnownPixelFormats and supports quantizing and dithering. To copy a bitmap data into another one without blending use the CopyTo methods instead.
DrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, Point, IQuantizer, IDitherer, ParallelConfig) Draws the source IReadableBitmapData into the target IReadWriteBitmapData without scaling, using blending. This method always preserves the source size in pixels, works between any pair of source and target KnownPixelFormats and supports quantizing and dithering. For scaling use the overloads with targetRectangle and ScalingMode parameters. To copy a bitmap data into another one without blending use the CopyTo methods instead.
DrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, Rectangle, IQuantizer, IDitherer, ScalingMode) Draws the source IReadableBitmapData into the target IReadWriteBitmapData using scaling and blending. This method works between any pair of source and target KnownPixelFormats and supports quantizing and dithering. To copy a bitmap data into another one without blending use the CopyTo methods instead.
DrawInto(IReadableBitmapData, IReadWriteBitmapData, IAsyncContext, Rectangle, Rectangle, IQuantizer, IDitherer, ScalingMode) Draws the source IReadableBitmapData into the target IReadWriteBitmapData with scaling and blending, using a context that may belong to a higher level, possibly asynchronous operation.
DrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, Rectangle, IQuantizer, IDitherer, ScalingMode, ParallelConfig) Draws the source IReadableBitmapData into the target IReadWriteBitmapData using scaling and blending. This method works between any pair of source and target KnownPixelFormats and supports quantizing and dithering. To copy a bitmap data into another one without blending use the CopyTo methods instead.

See Also