- Aurigma Graphics Mill 5.5 for .NET
- Introduction
- What's New?
- Overview of Features
- Getting Started
- Programming with Graphics Mill for .NET
- File Formats
- Graphics Mill for .NET Add-ons
- Class Library Reference
- Aurigma.GraphicsMill Namespace
- Aurigma.GraphicsMill.AjaxControls Namespace
- Aurigma.GraphicsMill.AjaxControls.VectorObjects Namespace
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.Math Namespace
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.RedoUndo Namespace
- Aurigma.GraphicsMill.Codecs Namespace
- Aurigma.GraphicsMill.Drawing Namespace
- Brush Class
- BrushType Enumeration
- Charset Enumeration
- Font Class
- GdiGraphics Class
- GdiGraphics Members
- GdiGraphics Constructor
- GdiGraphics Methods
- {dtor} Method
- Clear Method
- Dispose Method
- DrawArc Method
- DrawBezier Method
- DrawBeziers Method
- DrawEllipse Method
- DrawFormattedText Method
- DrawImage Method
- DrawImage Method (Bitmap, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, CombineMode, Single, InterpolationMode)
- DrawImage Method (Bitmap, Single, Single, Single, Single, Single, Single, Single, Single, CombineMode, Single, InterpolationMode)
- DrawImage Method (Bitmap, Point, CombineMode)
- DrawImage Method (Bitmap, PointF, CombineMode)
- DrawImage Method (Bitmap, Int32, Int32, CombineMode)
- DrawImage Method (Bitmap, Single, Single, CombineMode)
- DrawImage Method (Bitmap, Rectangle, CombineMode, Single, InterpolationMode)
- DrawImage Method (Bitmap, RectangleF, CombineMode, Single, InterpolationMode)
- DrawImage Method (Bitmap, Rectangle, Rectangle, CombineMode, Single, InterpolationMode)
- DrawImage Method (Bitmap, RectangleF, RectangleF, CombineMode, Single, InterpolationMode)
- DrawImage Method (Bitmap, Int32, Int32, Int32, Int32, CombineMode, Single, InterpolationMode)
- DrawImage Method (Bitmap, Single, Single, Single, Single, CombineMode, Single, InterpolationMode)
- DrawLine Method
- DrawLines Method
- DrawPie Method
- DrawPolygon Method
- DrawRectangle Method
- DrawString Method
- DrawText Method
- ExcludeClip Method
- FillEllipse Method
- FillPie Method
- FillPolygon Method
- FillRectangle Method
- FloodFill Method
- FromHdc Method
- FromHwnd Method
- GetHdc Method
- GetPixel Method
- IntersectClip Method
- Lock Method
- ResetClip Method
- SetClip Method
- SetPixel Method
- TranslateClip Method
- Unlock Method
- GdiGraphics Properties
- GdiGraphicsMode Enumeration
- HatchBrush Class
- HatchStyle Enumeration
- HorizontalAlignment Enumeration
- LineCap Enumeration
- Pen Class
- SolidBrush Class
- TextTrimmingMode Enumeration
- VerticalAlignment Enumeration
- Aurigma.GraphicsMill.Licensing Namespace
- Aurigma.GraphicsMill.Transforms Namespace
- Aurigma.GraphicsMill.WebControls Namespace
- Aurigma.GraphicsMill.WinControls Namespace
- GraphicsMill Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls.VectorObjects Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.Math Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.RedoUndo Namespace (Client Class Library)
- Samples
- Licensing
- Copyright Notices
GdiGraphics.DrawImage Method (Bitmap, Single, Single, Single, Single, Single, Single, Single, Single, CombineMode, Single, InterpolationMode)
Draws a Bitmap object.
Namespace:
Aurigma.GraphicsMill.Drawing
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Syntax
Public Sub DrawImage ( _
bitmap As Bitmap, _
destinationX As Single, _
destinationY As Single, _
destinationWidth As Single, _
destinationHeight As Single, _
sourceX As Single, _
sourceY As Single, _
sourceWidth As Single, _
sourceHeight As Single, _
combine As CombineMode, _
opacity As Single, _
interpolationMode As InterpolationMode _
)
public void DrawImage(
Bitmap bitmap,
float destinationX,
float destinationY,
float destinationWidth,
float destinationHeight,
float sourceX,
float sourceY,
float sourceWidth,
float sourceHeight,
CombineMode combine,
float opacity,
InterpolationMode interpolationMode
)
Parameters
- bitmap
-
Type: Aurigma.GraphicsMill.Bitmap
Bitmap object you are going to draw.
- destinationX
-
Type: System.Single
Horizontal position of left-top corner of the destination rectangle.
- destinationY
-
Type: System.Single
Vertical position of left-top corner of the destination rectangle.
- destinationWidth
-
Type: System.Single
Width of the destination rectangle. You can pass 0 to indicate that method should calculate width automatically (see Remarks section for details).
- destinationHeight
-
Type: System.Single
Height of the destination rectangle. You can pass 0 to indicate that method should calculate height automatically (see Remarks section for details).
- sourceX
-
Type: System.Single
Horizontal position of left-top corner of the source rectangle.
- sourceY
-
Type: System.Single
Vertical position of left-top corner of the source rectangle.
- sourceWidth
-
Type: System.Single
Width of the source rectangle. You can pass 0 to indicate that method should calculate width automatically (see Remarks section for details).
- sourceHeight
-
Type: System.Single
Height of the source rectangle. You can pass 0 to indicate that method should calculate height automatically (see Remarks section for details).
- combine
- Algorithm of images blending (plain pixels copying, alpha blending, bitwise operations, etc).
- opacity
-
Type: System.Single
A number in range [0, 1] specifying total opacity of the image. If 0, image is completely transparent, if 1, image is completely opaque.
- interpolationMode
- Algorithm of resizing. Using this parameter you can select between speed and quality of resizing.
Remarks
Image is drawn from source rectangle on given bitmap to destination rectangle on this GdiGraphics. If source rectangle dimensions differ from dimensions of destination rectangle, it is resized to have the same size as destination rectangle.
If bitmap has pixel format which is not GDI-compatible (e.g. extended pixel formats, CMYK, etc) method will automatically create a copy converted to the Format32bppArgb. That's why you always get it drawn, but if you are going to call this method multiple times, it is recommended to convert it to some GDI-compatible format (like Format32bppArgb) to increase the performance.
If you want method to calculate width and height automatically (both for source and destination rectangles) , you can pass 0 to these arguments. It will be calculated with the following way:
- If both width and heigth are 0, it will take source image dimensions (Width and Height properties). This way no resize will be done during drawing.
- If only one of arguments is 0, it will calculate this argument to save proportion. For example, source image is 800x600, and you pass 400 as width and 0 as height. Height will be calculated to preserve aspect ratio of the image, i.e. it will be equal to 300.
All coordinates are measured in units specified with Unit property of the bitmap.