setStroke
setStroke: (Graphics2D, BasicStroke) -> ()Sets the stroke draw and the line primitives use.
BufferedImage.new(…):createGraphics()
BufferedImage.new(…):getGraphics()| Method | Returns | Description |
|---|---|---|
setStroke(BasicStroke) | () | Sets the stroke draw and the line primitives use. |
getStroke() | BasicStroke | The current stroke. |
setComposite(AlphaComposite) | () | Sets the composite (AlphaComposite: a rule and an extra alpha). |
getComposite() | AlphaComposite | The current composite. |
setPaint(Color?) | () | (Graphics2D, Color?) -> (): Paints with a colour (as setColor); nil is ignored. |
setPaint(Paint) | () | |
setBackground(Color) | () | Sets the background colour clearRect fills with. |
getBackground() | Color | The background colour. |
setRenderingHint(RenderingHintsKey, any) | () | Sets one rendering hint. Antialiasing, text antialiasing, stroke control and interpolation change how later draws rasterize; the rest are s… |
getRenderingHint(RenderingHintsKey) | number? | The value of one rendering hint (its default where none was set; nil for an interpolation hint never set). |
translate(number, number) | () | (Graphics2D, number, number) -> (): Translates the origin by whole pixels. |
rotate(number) | () | (Graphics2D, number) -> (): Rotates by theta radians about the origin. |
rotate(number, number, number) | () | |
scale(number, number) | () | Scales. |
shear(number, number) | () | Shears. |
transform(AffineTransform) | () | Concatenates tx to the transform. |
setTransform(AffineTransform) | () | Replaces the transform. |
getTransform() | AffineTransform | A copy of the transform. |
clip(Shape) | () | Intersects the clip with shape (user space). |
draw(Shape) | () | Strokes shape with the current stroke. |
fill(Shape) | () | Fills shape (its winding rule). |
drawString(string, number, number) | () | (Graphics2D, string, number, number) -> (): Draws s with its baseline at y and its left edge at x, in the current font and colour, with… |
drawImage(Image?, number, number, ImageObserver?) | boolean | (Graphics2D, Image?, number, number, ImageObserver?) -> boolean: Draws img with its top-left at (x, y). true, as for any loaded image. |
drawImage(Image?, number, number, number, number, ImageObserver?) | boolean | |
drawImage(Image?, number, number, number, number, number, number, number, number, ImageObserver?) | boolean | |
drawImage(Image?, AffineTransform, ImageObserver?) | boolean |
| Method | Returns | Description |
|---|---|---|
BufferedImage.createGraphics | Graphics2D | A Graphics2D drawing into this image: each call draws at once. Dispose it when done (nothing leaks if not). |
BufferedImage.getGraphics | Graphics2D | The same as createGraphics(). |
Graphics.create | Graphics2D | (Graphics) -> Graphics2D: A new graphics object with a copy of this one's state. |
setStrokesetStroke: (Graphics2D, BasicStroke) -> ()Sets the stroke draw and the line primitives use.
getStrokegetStroke: (Graphics2D) -> BasicStrokeThe current stroke.
setCompositesetComposite: (Graphics2D, AlphaComposite) -> ()Sets the composite (AlphaComposite: a rule and an extra alpha).
getCompositegetComposite: (Graphics2D) -> AlphaCompositeThe current composite.
setPaintsetPaint: ((Graphics2D, Color?) -> ()) & ((Graphics2D, Paint) -> ())(Graphics2D, Color?) -> (): Paints with a colour (as setColor); nil is ignored.
(Graphics2D, Paint) -> (): Paints with a two-colour gradient. getColor keeps the last colour.
setBackgroundsetBackground: (Graphics2D, Color) -> ()Sets the background colour clearRect fills with.
getBackgroundgetBackground: (Graphics2D) -> ColorThe background colour.
setRenderingHintsetRenderingHint: (Graphics2D, RenderingHintsKey, any) -> ()Sets one rendering hint. Antialiasing, text antialiasing, stroke control and interpolation change how later draws rasterize; the rest are stored and answered. A value of another key raises.
getRenderingHintgetRenderingHint: (Graphics2D, RenderingHintsKey) -> number?The value of one rendering hint (its default where none was set; nil for an interpolation hint never set).
translatetranslate: (Graphics2D, number, number) -> ()(Graphics2D, number, number) -> (): Translates the origin by whole pixels.
(Graphics2D, number, number) -> (): Translates the origin.
rotaterotate: ((Graphics2D, number) -> ()) & ((Graphics2D, number, number, number) -> ())(Graphics2D, number) -> (): Rotates by theta radians about the origin.
(Graphics2D, number, number, number) -> (): Rotates by theta radians about (x, y).
scalescale: (Graphics2D, number, number) -> ()Scales.
shearshear: (Graphics2D, number, number) -> ()Shears.
transformtransform: (Graphics2D, AffineTransform) -> ()Concatenates tx to the transform.
setTransformsetTransform: (Graphics2D, AffineTransform) -> ()Replaces the transform.
getTransformgetTransform: (Graphics2D) -> AffineTransformA copy of the transform.
clipclip: (Graphics2D, Shape) -> ()Intersects the clip with shape (user space).
drawdraw: (Graphics2D, Shape) -> ()Strokes shape with the current stroke.
fillfill: (Graphics2D, Shape) -> ()Fills shape (its winding rule).
drawStringdrawString: (Graphics2D, string, number, number) -> ()(Graphics2D, string, number, number) -> (): Draws s with its baseline at y and its left edge at x, in the current font and colour, with no shadow.
(Graphics2D, string, number, number) -> (): drawString at a fractional position.
drawImagedrawImage: ((Graphics2D, Image?, number, number, ImageObserver?) -> boolean) & ((Graphics2D, Image?, number, number, number, number, ImageObserver?) -> boolean) & ((Graphics2D, Image?, number, number, number, number, number, number, number, number, ImageObserver?) -> boolean) & ((Graphics2D, Image?, AffineTransform, ImageObserver?) -> boolean)(Graphics2D, Image?, number, number, ImageObserver?) -> boolean: Draws img with its top-left at (x, y). true, as for any loaded image.
(Graphics2D, Image?, number, number, number, number, ImageObserver?) -> boolean: Draws img scaled into the rectangle.
(Graphics2D, Image?, number, number, number, number, number, number, number, number, ImageObserver?) -> boolean: Draws the source rectangle (sx1, sy1)-(sx2, sy2) of img into the destination rectangle (dx1, dy1)-(dx2, dy2), flipping where the corners are reversed.
(Graphics2D, Image?, AffineTransform, ImageObserver?) -> boolean: Draws img through xform (after the current transform).