ImageExtensionsDrawInto(Image, Bitmap, Rectangle, ScalingMode) Method
Draws the source Image
into the target Bitmap
with possible scaling.
This method is similar to Graphics.DrawImage
methods, except that this one works between any pair of source and target PixelFormat
s and supports quantizing.
KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 7.2.0
public static void DrawInto(
this Image source,
Public Shared Sub DrawInto (
source As Image,
target As Bitmap,
targetRectangle As Rectangle,
scalingMode As ScalingMode
static void DrawInto(
static member DrawInto :
source : Image *
target : Bitmap *
targetRectangle : Rectangle *
scalingMode : ScalingMode -> unit
- source Image
- The source Image to be drawn into the target.
- target Bitmap
- The target Bitmap into which source should be drawn.
- targetRectangle Rectangle
- A Rectangle that specifies the location and size of the drawn source.
- scalingMode ScalingMode
- Specifies the scaling mode if the bitmap data to be drawn needs to be resized.
In Visual Basic and C#, you can call this method as an instance method on any object of type Image
. 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)
The method has the best performance if source and targetRectangle have the same size, or when scalingMode is NoScaling.
The image to be drawn is automatically clipped if targetRectangle exceeds bounds, or scalingMode is NoScaling
and source and targetRectangle have different sizes.
If target can represent a narrower set of colors, then the result will be automatically quantized to the colors of the target.