alias DrawImageAbort;
bool delegate(void* callbackData)
Provides a callback method for deciding when the drawImage method should prematurely cancel execution.
Parameters
callbackData
Pointer specifying data for the callback method.
Returns
true if the method decides that the drawImage method should prematurely cancel execution; otherwise, false.
final void dispose();
- Releases all the resources used by this instance.
static Handle getHalftonePalette();
- Gets a handle to the current Windows halftone palette.
static Graphics fromImage(Image image);
- Creates a new instance from the specified Image object.
Parameters
Image image
The Image object on which to create the new instance.
static Graphics fromHwnd(Handle hwnd);
- Creates a new instance from the specified handle to a window.
Parameters
Handle hwnd
Handle to a window.
static Graphics fromHdc(Handle hdc);
- Creates a new instance from the specified handle to a device context.
Parameters
Handle hdc
Handle to a device context.
static Graphics fromHdc(Handle hdc, Handle hdevice);
- Creates a new instance from the specified handle to a device context and handle to a device.
Parameters
Handle hdc
Handle to a device context.
Handle hdevice
Handle to a device.
Handle getHdc();
- Gets the handle to the device context associated with this instance.
void releaseHdc(Handle hdc);
void releaseHdc();
- Releases a device context handle obtained by a previous call to the getHdc method.
Parameters
Handle hdc
Handle to a device context obtained by a previous call to the getHdc method.
GraphicsState save();
- Saves the current state of this instance and identifies the saved state with a GraphicsState object.
void restore(GraphicsState state);
- Restores the state of this instance to the state represented by a GraphicsState object.
Parameters
GraphicsState state
The state to which to restore this instance.
GraphicsContainer beginContainer();
GraphicsContainer beginContainer(Rect dstrect, Rect srcrect, GraphicsUnit unit);
GraphicsContainer beginContainer(RectF dstrect, RectF srcrect, GraphicsUnit unit);
void endContainer(GraphicsContainer container);
void setClip(Graphics g, CombineMode combineMode = cast(CombineMode)0);
void setClip(Rect rect, CombineMode combineMode = cast(CombineMode)0);
void setClip(RectF rect, CombineMode combineMode = cast(CombineMode)0);
void setClip(Path path, CombineMode combineMode = cast(CombineMode)0);
void setClip(Region region, CombineMode combineMode);
void intersectClip(RectF rect);
void intersectClip(Rect rect);
void excludeClip(RectF rect);
void excludeClip(Rect rect);
void excludeClip(Region region);
void resetClip();
void translateClip(int dx, int dy);
void translateClip(float dx, float dy);
bool isVisible(int x, int y);
bool isVisible(Point point);
bool isVisible(int x, int y, int width, int height);
bool isVisible(Rect rect);
bool isVisible(float x, float y);
bool isVisible(PointF point);
bool isVisible(float x, float y, float width, float height);
bool isVisible(RectF rect);
void addMetafileComment(ubyte[] data);
void flush(FlushIntention intention = cast(FlushIntention)0);
void scaleTransform(float sx, float sy, MatrixOrder order = cast(MatrixOrder)0);
void rotateTransform(float angle, MatrixOrder order = cast(MatrixOrder)0);
void translateTransform(float dx, float dy, MatrixOrder order = cast(MatrixOrder)0);
void multiplyTransform(Matrix matrix, MatrixOrder order = cast(MatrixOrder)0);
void resetTransform();
void transformPoints(CoordinateSpace destSpace, CoordinateSpace srcSpace, PointF[] points);
void transformPoints(CoordinateSpace destSpace, CoordinateSpace srcSpace, Point[] points);
Color getNearestColor(Color color);
void clear(Color color);
void drawLine(Pen pen, float x1, float y1, float x2, float y2);
void drawLine(Pen pen, PointF pt1, PointF pt2);
void drawLines(Pen pen, PointF[] points);
void drawLine(Pen pen, int x1, int y1, int x2, int y2);
void drawLine(Pen pen, Point pt1, Point pt2);
void drawLines(Pen pen, Point[] points);
void drawArc(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle);
void drawArc(Pen pen, RectF rect, float startAngle, float sweepAngle);
void drawArc(Pen pen, int x, int y, int width, int height, float startAngle, float sweepAngle);
void drawArc(Pen pen, Rect rect, float startAngle, float sweepAngle);
void drawBezier(Pen pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
void drawBezier(Pen pen, PointF pt1, PointF pt2, PointF pt3, PointF pt4);
void drawBeziers(Pen pen, PointF[] points);
void drawBezier(Pen pen, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
void drawBezier(Pen pen, Point pt1, Point pt2, Point pt3, Point pt4);
void drawBeziers(Pen pen, Point[] points);
void drawRectangle(Pen pen, float x, float y, float width, float height);
void drawRectangle(Pen pen, RectF rect);
void drawRectangles(Pen pen, RectF[] rects);
void drawRectangle(Pen pen, int x, int y, int width, int height);
void drawRectangle(Pen pen, Rect rect);
void drawRectangles(Pen pen, Rect[] rects);
void drawEllipse(Pen pen, float x, float y, float width, float height);
void drawEllipse(Pen pen, RectF rect);
void drawEllipse(Pen pen, int x, int y, int width, int height);
void drawEllipse(Pen pen, Rect rect);
void drawPie(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle);
void drawPie(Pen pen, RectF rect, float startAngle, float sweepAngle);
void drawPie(Pen pen, int x, int y, int width, int height, float startAngle, float sweepAngle);
void drawPie(Pen pen, Rect rect, float startAngle, float sweepAngle);
void drawPolygon(Pen pen, PointF[] points);
void drawPolygon(Pen pen, Point[] points);
void drawPath(Pen pen, Path path);
void drawCurve(Pen pen, PointF[] points);
void drawCurve(Pen pen, PointF[] points, float tension);
void drawCurve(Pen pen, PointF[] points, int offset, int numberOfSegments, float tension = 0.5F);
void drawCurve(Pen pen, Point[] points);
void drawCurve(Pen pen, Point[] points, float tension);
void drawCurve(Pen pen, Point[] points, int offset, int numberOfSegments, float tension = 0.5F);
void drawClosedCurve(Pen pen, PointF[] points);
void drawClosedCurve(Pen pen, PointF[] points, float tension);
void drawClosedCurve(Pen pen, Point[] points);
void drawClosedCurve(Pen pen, Point[] points, float tension);
void fillRectangle(Brush brush, float x, float y, float width, float height);
void fillRectangle(Brush brush, RectF rect);
void fillRectangles(Brush brush, RectF[] rects);
void fillRectangle(Brush brush, int x, int y, int width, int height);
void fillRectangles(Brush brush, Rect[] rects);
void fillRegion(Brush brush, Region region);
void fillPolygon(Brush brush, PointF[] points, FillMode fillMode = cast(FillMode)0);
void fillPolygon(Brush brush, Point[] points, FillMode fillMode = cast(FillMode)0);
void fillEllipse(Brush brush, float x, float y, float width, float height);
void fillEllipse(Brush brush, RectF rect);
void fillEllipse(Brush brush, int x, int y, int width, int height);
void fillEllipse(Brush brush, Rect rect);
void fillPie(Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle);
void fillPie(Brush brush, RectF rect, float startAngle, float sweepAngle);
void fillPie(Brush brush, int x, int y, int width, int height, float startAngle, float sweepAngle);
void fillPath(Brush brush, Path path);
void fillClosedCurve(Brush brush, PointF[] points);
void fillClosedCurve(Brush brush, PointF[] points, FillMode fillMode, float tension = 0.5F);
void fillClosedCurve(Brush brush, Point[] points);
void fillClosedCurve(Brush brush, Point[] points, FillMode fillMode, float tension = 0.5F);
void drawImage(Image image, PointF point);
void drawImage(Image image, float x, float y);
void drawImage(Image image, RectF rect);
- Draws the specified Image at the specified location and with the specified size.
Parameters
Image image
The Image to draw.
RectF rect
The location and size of the drawn image.
void drawImage(Image image, float x, float y, float width, float height);
- Draws the specified Image at the specified location and with the specified size.
Parameters
Image image
The Image to draw.
float x
The x-coordinate of the upper-left corner of the drawn image.
float y
The y-coordinate of the upper-left corner of the drawn image.
float width
The width of the drawn image.
float height
The height of the drawn image.
void drawImage(Image image, float x, float y, Rect srcRect, GraphicsUnit srcUnit);
- Draws a portion of an image at a specified location.
Parameters
Image image
The Image to draw.
float x
The x-coordinate of the upper-left corner of the drawn image.
float y
The y-coordinate of the upper-left corner of the drawn image.
Rect srcRect
The portion of the image to draw.
GraphicsUnit srcUnit
A member of the GraphicsUnit enumeration that specifies the units of measure used by srcRect.
void drawImage(Image image, RectF destRect, RectF srcRect, GraphicsUnit srcUnit);
void drawImage(Image image, RectF destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs = cast(ImageAttributes)null, bool delegate(void* callbackData) callback = null, void* callbackData = null);
- Draws the specified portion of the specified Image at the specified location and with the specified size.
Parameters
Image image
The Image to draw.
RectF destRect
The location and size of the drawn image. The image is scaled to fit the rectangle.
float srcX
The x-coordinate of the upper-left corner of the portion of the source image to draw.
float srcY
The y-coordinate of the upper-left corner of the portion of the source image to draw.
float srcWidth
The width of the portion of the source image to draw.
float srcHeight
The height of the portion of the source image to draw.
GraphicsUnit srcUnit
A member of the GraphicsUnit enumeration that specifies the units of measure used by srcRect.
ImageAttributes imageAttrs
Specifies recoloring and gamma information.
bool delegate(void* callbackData) callback
A delegate that specifies a method to call during the drawing of the image to check whether to stop execution of the method.
void* callbackData
Value specifying additional data for the callback to use when checking whether to stop execution of the method.
void drawImage(Image image, PointF[] destPoints);
void drawImage(Image image, PointF[] destPoints, RectF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttrs = cast(ImageAttributes)null, bool delegate(void* callbackData) callback = null, void* callbackData = null);
void drawImage(Image image, Point point);
void drawImage(Image image, int x, int y);
void drawImage(Image image, Rect rect);
void drawImage(Image image, int x, int y, int width, int height);
void drawImage(Image image, int x, int y, Rect srcRect, GraphicsUnit srcUnit);
void drawImage(Image image, Rect destRect, Rect srcRect, GraphicsUnit srcUnit);
void drawImage(Image image, Rect destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs = cast(ImageAttributes)null, bool delegate(void* callbackData) callback = null, void* callbackData = null);
void drawImage(Image image, Point[] destPoints);
void drawImage(Image image, Point[] destPoints, Rect srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttrs = cast(ImageAttributes)null, bool delegate(void* callbackData) callback = null, void* callbackData = null);
void drawString(char[] s, Font font, Brush brush, float x, float y, StringFormat format = cast(StringFormat)null);
void drawString(char[] s, Font font, Brush brush, PointF point, StringFormat format = cast(StringFormat)null);
void drawString(char[] s, Font font, Brush brush, RectF layoutRect, StringFormat format = cast(StringFormat)null);
SizeF measureString(char[] s, Font font);
SizeF measureString(char[] s, Font font, PointF origin, StringFormat format = cast(StringFormat)null);
SizeF measureString(char[] s, Font font, SizeF layoutArea, StringFormat format = cast(StringFormat)null);
SizeF measureString(char[] s, Font font, SizeF layoutArea, StringFormat format, out int codepointsFitted, out int linesFilled);
Region[] measureCharacterRanges(char[] s, Font font, RectF layoutRect, StringFormat format);
float dpiX();
float dpiY();
void pageScale(float value);
float pageScale();
void pageUnit(GraphicsUnit value);
GraphicsUnit pageUnit();
void compositingMode(CompositingMode value);
CompositingMode compositingMode();
void compositingQuality(CompositingQuality value);
CompositingQuality compositingQuality();
InterpolationMode interpolationMode();
void interpolationMode(InterpolationMode value);
void smoothingMode(SmoothingMode value);
SmoothingMode smoothingMode();
void pixelOffsetMode(PixelOffsetMode value);
PixelOffsetMode pixelOffsetMode();
void textContrast(uint value);
uint textContrast();
void textRenderingHint(TextRenderingHint value);
TextRenderingHint textRenderingHint();
bool isClipEmpty();
bool isVisibleClipEmpty();
RectF clipBounds();
RectF visibleClipBounds();
void renderingOrigin(Point value);
Point renderingOrigin();
void transform(Matrix value);
Matrix transform();