BitmapDataExtensionsDrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, Rectangle, IDitherer, ScalingMode) Method
Namespace: KGySoft.Drawing.ImagingAssembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 8.0.0-preview.1
public static void DrawInto(
this IReadableBitmapData source,
IReadWriteBitmapData target,
Rectangle sourceRectangle,
Rectangle targetRectangle,
IDitherer? ditherer,
ScalingMode scalingMode = ScalingMode.Auto
)
<ExtensionAttribute>
Public Shared Sub DrawInto (
source As IReadableBitmapData,
target As IReadWriteBitmapData,
sourceRectangle As Rectangle,
targetRectangle As Rectangle,
ditherer As IDitherer,
Optional scalingMode As ScalingMode = ScalingMode.Auto
)
public:
[ExtensionAttribute]
static void DrawInto(
IReadableBitmapData^ source,
IReadWriteBitmapData^ target,
Rectangle sourceRectangle,
Rectangle targetRectangle,
IDitherer^ ditherer,
ScalingMode scalingMode = ScalingMode::Auto
)
[<ExtensionAttribute>]
static member DrawInto :
source : IReadableBitmapData *
target : IReadWriteBitmapData *
sourceRectangle : Rectangle *
targetRectangle : Rectangle *
ditherer : IDitherer *
?scalingMode : ScalingMode
(* Defaults:
let _scalingMode = defaultArg scalingMode ScalingMode.Auto
*)
-> unit
- source IReadableBitmapData
- The source IReadableBitmapData to be drawn into the target.
- target IReadWriteBitmapData
- The target IReadWriteBitmapData into which source should be drawn.
- sourceRectangle Rectangle
- A Rectangle that specifies the portion of the source to be drawn into the target.
- targetRectangle Rectangle
- A Rectangle that specifies the location and size of the drawn source.
- ditherer IDitherer
- The ditherer to be used for the drawing. Might be ignored if target PixelFormat
format has at least 24 bits-per-pixel size.
- scalingMode ScalingMode (Optional)
- Specifies the scaling mode if the bitmap data to be drawn needs to be resized. This parameter is optional.
Default value: Auto.
In Visual Basic and C#, you can call this method as an instance method on any object of type
IReadableBitmapData. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the
BeginDrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, Rectangle, IQuantizer, IDitherer, ScalingMode, AsyncConfig)
or
DrawIntoAsync(IReadableBitmapData, IReadWriteBitmapData, Rectangle, Rectangle, IQuantizer, IDitherer, ScalingMode, TaskConfig) (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.
The method has the best performance if sourceRectangle and targetRectangle have the same size, or when scalingMode is NoScaling.
The image to be drawn is automatically clipped if sourceRectangle or targetRectangle exceed bounds, or scalingMode is NoScaling
and sourceRectangle and targetRectangle are different.
target must be an IReadWriteBitmapData because it must be readable if blending is necessary. For write-only IWritableBitmapData instances
you can use the CopyTo methods (without scaling).
If target can represent a narrower set of colors, then the result will be automatically quantized to the colors of the target.
To use dithering a ditherer must be explicitly specified.