Skip to main content

DXGraphics Class

A graphics surface.

Declaration

public class DXGraphics extends JavaObject implements IDisposable

Implements

com.devexpress.system.IDisposable

Inherited Members

com.devexpress.system.JavaObject.clone()
com.devexpress.system.JavaObject.equals(java.lang.Object)
com.devexpress.system.JavaObject.hashCode()
com.devexpress.system.JavaObject.initFields()
com.devexpress.system.JavaObject.memberwiseClone()
com.devexpress.system.JavaObject.toString()
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)

Inheritance

Object
com.devexpress.system.JavaObject
DXGraphics

Methods

clear(Color color) Method

Clears this graphics surface with the specified color.

Declaration

public void clear(Color color)

Parameters

Name Type Description
color Color

The background color.

close() Method

Closes this graphics surface.

Declaration

public void close()

drawArc(DXPen pen, RectangleF bounds, float startAngle, float sweepAngle) Method

Draws an arc.

Declaration

public void drawArc(DXPen pen, RectangleF bounds, float startAngle, float sweepAngle)

Parameters

Name Type Description
pen DXPen

The pen.

bounds RectangleF

The arc bounds.

startAngle float

The start angle.

sweepAngle float

The sweep angle.

drawBezier(DXPen pen, PointF pt1, PointF pt2, PointF pt3, PointF pt4) Method

Draws a Bezier segment.

Declaration

public void drawBezier(DXPen pen, PointF pt1, PointF pt2, PointF pt3, PointF pt4)

Parameters

Name Type Description
pen DXPen

The pen.

pt1 com.devexpress.system.drawing.PointF

The first point.

pt2 com.devexpress.system.drawing.PointF

The second point.

pt3 com.devexpress.system.drawing.PointF

The third point.

pt4 com.devexpress.system.drawing.PointF

The fourth point.

drawBeziers(DXPen pen, PointF[] points) Method

Draws Bezier segments.

Declaration

public void drawBeziers(DXPen pen, PointF[] points)

Parameters

Name Type Description
pen DXPen

The pen.

points com.devexpress.system.drawing.PointF[]

The points.

drawEllipse(DXPen pen, RectangleF rect) Method

Draws an ellipse.

Declaration

public void drawEllipse(DXPen pen, RectangleF rect)

Parameters

Name Type Description
pen DXPen

The pen.

rect RectangleF

The ellipse bounds.

drawImage(DXImage image, int x, int y) Method

Draws an image.

Declaration

public void drawImage(DXImage image, int x, int y)

Parameters

Name Type Description
image DXImage

The image.

x int

The X-coordinate.

y int

The Y-coordinate.

drawImage(DXImage image, RectangleF destRect, RectangleF srcRect) Method

Draws an image.

Declaration

public void drawImage(DXImage image, RectangleF destRect, RectangleF srcRect)

Parameters

Name Type Description
image DXImage

The image.

destRect RectangleF

The destination rectangle.

srcRect RectangleF

The source rectangle.

drawImage(DXImage image, RectangleF rect) Method

Draws an image.

Declaration

public void drawImage(DXImage image, RectangleF rect)

Parameters

Name Type Description
image DXImage

The image.

rect RectangleF

The destination rectangle.

drawLine(DXPen pen, float x1, float y1, float x2, float y2) Method

Draws a line.

Declaration

public void drawLine(DXPen pen, float x1, float y1, float x2, float y2)

Parameters

Name Type Description
pen DXPen

The pen.

x1 float

The first X-coordinate.

y1 float

The first Y-coordinate.

x2 float

The second X-coordinate.

y2 float

The second Y-coordinate.

drawLine(DXPen pen, PointF pt1, PointF pt2) Method

Draws a line.

Declaration

public void drawLine(DXPen pen, PointF pt1, PointF pt2)

Parameters

Name Type Description
pen DXPen

The pen.

pt1 com.devexpress.system.drawing.PointF

The first point.

pt2 com.devexpress.system.drawing.PointF

The second point.

drawLines(DXPen pen, Point[] points) Method

Draws connected lines.

Declaration

public void drawLines(DXPen pen, Point[] points)

Parameters

Name Type Description
pen DXPen

The pen.

points com.devexpress.system.drawing.Point[]

The points.

drawLines(DXPen pen, PointF[] points) Method

Draws connected lines.

Declaration

public void drawLines(DXPen pen, PointF[] points)

Parameters

Name Type Description
pen DXPen

The pen.

points com.devexpress.system.drawing.PointF[]

The points.

drawPath(DXPen pen, DXGraphicsPath dxPath) Method

Draws a path.

Declaration

public void drawPath(DXPen pen, DXGraphicsPath dxPath)

Parameters

Name Type Description
pen DXPen

The pen.

dxPath DXGraphicsPath

The path.

drawPie(DXPen pen, Rectangle bounds, float startAngle, float sweepAngle) Method

Draws a pie shape.

Declaration

public void drawPie(DXPen pen, Rectangle bounds, float startAngle, float sweepAngle)

Parameters

Name Type Description
pen DXPen

The pen.

bounds Rectangle

The pie bounds.

startAngle float

The start angle.

sweepAngle float

The sweep angle.

drawPolygon(DXPen pen, PointF[] points) Method

Draws a polygon.

Declaration

public void drawPolygon(DXPen pen, PointF[] points)

Parameters

Name Type Description
pen DXPen

The pen.

points com.devexpress.system.drawing.PointF[]

The polygon points.

drawRectangle(DXPen pen, RectangleF bounds) Method

Draws a rectangle.

Declaration

public void drawRectangle(DXPen pen, RectangleF bounds)

Parameters

Name Type Description
pen DXPen

The pen.

bounds RectangleF

The rectangle bounds.

drawString(String text, DXFont font, DXBrush brush, PointF point, DXStringFormat format) Method

Draws a string.

Declaration

public void drawString(String text, DXFont font, DXBrush brush, PointF point, DXStringFormat format)

Parameters

Name Type Description
text String

The text.

font DXFont

The font.

brush DXBrush

The brush.

point com.devexpress.system.drawing.PointF

The point.

format DXStringFormat

The string format.

drawString(String text, DXFont font, DXBrush brush, RectangleF layoutRectangle, DXStringFormat format) Method

Draws a string.

Declaration

public void drawString(String text, DXFont font, DXBrush brush, RectangleF layoutRectangle, DXStringFormat format)

Parameters

Name Type Description
text String

The text.

font DXFont

The font.

brush DXBrush

The brush.

layoutRectangle RectangleF

The layout rectangle.

format DXStringFormat

The string format.

fillEllipse(DXBrush brush, RectangleF rect) Method

Fills an ellipse.

Declaration

public void fillEllipse(DXBrush brush, RectangleF rect)

Parameters

Name Type Description
brush DXBrush

The brush.

rect RectangleF

The ellipse bounds.

fillPath(DXBrush brush, DXGraphicsPath path) Method

Fills a path.

Declaration

public void fillPath(DXBrush brush, DXGraphicsPath path)

Parameters

Name Type Description
brush DXBrush

The brush.

path DXGraphicsPath

The path.

fillPie(DXBrush brush, Rectangle bounds, float startAngle, float sweepAngle) Method

Fills a pie shape.

Declaration

public void fillPie(DXBrush brush, Rectangle bounds, float startAngle, float sweepAngle)

Parameters

Name Type Description
brush DXBrush

The brush.

bounds Rectangle

The pie bounds.

startAngle float

The start angle.

sweepAngle float

The sweep angle.

fillPolygon(DXBrush brush, PointF[] points) Method

Fills a polygon.

Declaration

public void fillPolygon(DXBrush brush, PointF[] points)

Parameters

Name Type Description
brush DXBrush

The brush.

points com.devexpress.system.drawing.PointF[]

The polygon points.

fillRectangle(DXBrush brush, float x, float y, float width, float height) Method

Fills a rectangle.

Declaration

public void fillRectangle(DXBrush brush, float x, float y, float width, float height)

Parameters

Name Type Description
brush DXBrush

The brush.

x float

The X-coordinate.

y float

The Y-coordinate.

width float

The width.

height float

The height.

fillRectangle(DXBrush brush, RectangleF bounds) Method

Fills a rectangle.

Declaration

public void fillRectangle(DXBrush brush, RectangleF bounds)

Parameters

Name Type Description
brush DXBrush

The brush.

bounds RectangleF

The rectangle bounds.

fillRectangles(DXBrush brush, List<RectangleF> rects) Method

Fills rectangles.

Declaration

public void fillRectangles(DXBrush brush, List<RectangleF> rects)

Parameters

Name Type Description
brush DXBrush

The brush.

rects java.util.List<com.devexpress.system.drawing.RectangleF>

The rectangles.

fillRegion(DXBrush brush, DXRegion region) Method

Fills a region.

Declaration

public void fillRegion(DXBrush brush, DXRegion region)

Parameters

Name Type Description
brush DXBrush

The brush.

region DXRegion

The region.

flush() Method

Flushes this graphics surface.

Declaration

public void flush()

fromImage(DXImage image) Method

Creates a graphics surface from the specified image.

Declaration

public static DXGraphics fromImage(DXImage image)

Parameters

Name Type Description
image DXImage

The image.

Returns

Type Description
DXGraphics

The graphics surface for the image.

getClip() Method

Returns the clip.

Declaration

public DXRegion getClip()

Returns

Type Description
DXRegion

The clipping region.

getClipBounds() Method

Returns the clip bounds.

Declaration

public RectangleF getClipBounds()

Returns

Type Description
RectangleF

The clipping bounds.

getCompositingMode() Method

Returns the compositing mode.

Declaration

public DXCompositingMode getCompositingMode()

Returns

Type Description
DXCompositingMode

The compositing mode.

getDpiX() Method

Returns the horizontal DPI.

Declaration

public float getDpiX()

Returns

Type Description
float

The horizontal DPI.

getDpiY() Method

Returns the vertical DPI.

Declaration

public float getDpiY()

Returns

Type Description
float

The vertical DPI.

getInterpolationMode() Method

Returns the interpolation mode.

Declaration

public DXInterpolationMode getInterpolationMode()

Returns

Type Description
DXInterpolationMode

The interpolation mode.

getPageScale() Method

Returns the page scale.

Declaration

public float getPageScale()

Returns

Type Description
float

The page scale.

getPageUnit() Method

Returns the page unit.

Declaration

public DXGraphicsUnit getPageUnit()

Returns

Type Description
DXGraphicsUnit

The page unit.

getSmoothingMode() Method

Returns the smoothing mode.

Declaration

public DXSmoothingMode getSmoothingMode()

Returns

Type Description
DXSmoothingMode

The smoothing mode.

getTextRenderingHint() Method

Returns the text rendering hint.

Declaration

public DXTextRenderingHint getTextRenderingHint()

Returns

Type Description
DXTextRenderingHint

The text rendering hint.

getTransform() Method

Returns the transform.

Declaration

public DXMatrix getTransform()

Returns

Type Description
DXMatrix

The transformation matrix.

measureString(String text, DXFont font, float width, DXStringFormat format) Method

Measures the specified string.

Declaration

public SizeF measureString(String text, DXFont font, float width, DXStringFormat format)

Parameters

Name Type Description
text String

The text.

font DXFont

The font.

width float

The layout width.

format DXStringFormat

The string format.

Returns

Type Description

The measured string size.

measureString(String text, DXFont font, SizeF layoutArea, DXStringFormat format) Method

Measures the specified string.

Declaration

public SizeF measureString(String text, DXFont font, SizeF layoutArea, DXStringFormat format)

Parameters

Name Type Description
text String

The text.

font DXFont

The font.

layoutArea

The layout area.

format DXStringFormat

The string format.

Returns

Type Description

The measured string size.

multiplyTransform(DXMatrix matrix, DXMatrixOrder order) Method

Multiplies the current transform by the specified matrix.

Declaration

public void multiplyTransform(DXMatrix matrix, DXMatrixOrder order)

Parameters

Name Type Description
matrix DXMatrix

The matrix.

order DXMatrixOrder

The matrix order.

multiplyTransform(DXMatrix matrix) Method

Multiplies the current transform by the specified matrix.

Declaration

public void multiplyTransform(DXMatrix matrix)

Parameters

Name Type Description
matrix DXMatrix

The matrix.

resetTransform() Method

Resets the current transform.

Declaration

public void resetTransform()

restore(Object state) Method

Restores the specified graphics state.

Declaration

public void restore(Object state)

Parameters

Name Type Description
state Object

The graphics state.

rotateTransform(float angle, DXMatrixOrder order) Method

Rotates the current transform.

Declaration

public void rotateTransform(float angle, DXMatrixOrder order)

Parameters

Name Type Description
angle float

The rotation angle.

order DXMatrixOrder

The matrix order.

rotateTransform(float angle) Method

Rotates the current transform.

Declaration

public void rotateTransform(float angle)

Parameters

Name Type Description
angle float

The rotation angle.

save() Method

Saves the current graphics state.

Declaration

public Object save()

Returns

Type Description
Object

The saved graphics state.

scaleTransform(float sx, float sy, DXMatrixOrder order) Method

Scales the current transform.

Declaration

public void scaleTransform(float sx, float sy, DXMatrixOrder order)

Parameters

Name Type Description
sx float

The horizontal scale factor.

sy float

The vertical scale factor.

order DXMatrixOrder

The matrix order.

scaleTransform(float sx, float sy) Method

Scales the current transform.

Declaration

public void scaleTransform(float sx, float sy)

Parameters

Name Type Description
sx float

The horizontal scale factor.

sy float

The vertical scale factor.

setClip(DXGraphicsPath path, DXClipCombineMode combineMode) Method

Specifies the clipping path.

Declaration

public void setClip(DXGraphicsPath path, DXClipCombineMode combineMode)

Parameters

Name Type Description
path DXGraphicsPath

The clipping path.

combineMode DXClipCombineMode

The clip combine mode.

setClip(DXGraphicsPath path) Method

Specifies the clipping path.

Declaration

public void setClip(DXGraphicsPath path)

Parameters

Name Type Description
path DXGraphicsPath

The clipping path.

setClip(DXRegion region, DXClipCombineMode combineMode) Method

Specifies the clipping region.

Declaration

public void setClip(DXRegion region, DXClipCombineMode combineMode)

Parameters

Name Type Description
region DXRegion

The clipping region.

combineMode DXClipCombineMode

The clip combine mode.

setClip(DXRegion region) Method

Specifies the clipping region.

Declaration

public void setClip(DXRegion region)

Parameters

Name Type Description
region DXRegion

The clipping region.

setClip(RectangleF rect, DXClipCombineMode combineMode) Method

Specifies the clipping rectangle.

Declaration

public void setClip(RectangleF rect, DXClipCombineMode combineMode)

Parameters

Name Type Description
rect RectangleF

The clipping rectangle.

combineMode DXClipCombineMode

The clip combine mode.

setClip(RectangleF rect) Method

Specifies the clipping rectangle.

Declaration

public void setClip(RectangleF rect)

Parameters

Name Type Description
rect RectangleF

The clipping rectangle.

setCompositingMode(DXCompositingMode value) Method

Specifies the compositing mode.

Declaration

public void setCompositingMode(DXCompositingMode value)

Parameters

Name Type Description
value DXCompositingMode

The compositing mode.

setInterpolationMode(DXInterpolationMode value) Method

Specifies the interpolation mode.

Declaration

public void setInterpolationMode(DXInterpolationMode value)

Parameters

Name Type Description
value DXInterpolationMode

The interpolation mode.

setPageScale(float value) Method

Specifies the page scale.

Declaration

public void setPageScale(float value)

Parameters

Name Type Description
value float

The page scale.

setPageUnit(DXGraphicsUnit value) Method

Specifies the page unit.

Declaration

public void setPageUnit(DXGraphicsUnit value)

Parameters

Name Type Description
value DXGraphicsUnit

The page unit.

setSmoothingMode(DXSmoothingMode value) Method

Specifies the smoothing mode.

Declaration

public void setSmoothingMode(DXSmoothingMode value)

Parameters

Name Type Description
value DXSmoothingMode

The smoothing mode.

setTextRenderingHint(DXTextRenderingHint value) Method

Specifies the text rendering hint.

Declaration

public void setTextRenderingHint(DXTextRenderingHint value)

Parameters

Name Type Description
value DXTextRenderingHint

The text rendering hint.

setTransform(DXMatrix value) Method

Specifies the transform.

Declaration

public void setTransform(DXMatrix value)

Parameters

Name Type Description
value DXMatrix

The transformation matrix.

translateTransform(float dx, float dy, DXMatrixOrder order) Method

Translates the current transform.

Declaration

public void translateTransform(float dx, float dy, DXMatrixOrder order)

Parameters

Name Type Description
dx float

The horizontal offset.

dy float

The vertical offset.

order DXMatrixOrder

The matrix order.

translateTransform(float dx, float dy) Method

Translates the current transform.

Declaration

public void translateTransform(float dx, float dy)

Parameters

Name Type Description
dx float

The horizontal offset.

dy float

The vertical offset.