Graphics¶
-
php\swing\Graphics Class Graphics
Properties
Methods
__construct()¶private
getTextWidth($str)¶Return width of str for drawText + current font
Parameters:
- $str –
Returns: int
getTextHeight()¶Return height of one line text with current font
Returns: int
setPaintMode()¶
drawLine($x1, $y1, $x2, $y2)¶Draw line
Parameters:
- $x1 – int
- $y1 – int
- $x2 – int
- $y2 – int
drawRect($x, $y, $width, $height)¶Draw rect
Parameters:
- $x – int
- $y – int
- $width – int
- $height – int
fillRect($x, $y, $width, $height)¶
Parameters:
- $x – int
- $y – int
- $width – int
- $height – int
draw3DRect($x, $y, $width, $height, $raised)¶Draws a 3-D highlighted outline of the specified rectangle.
Parameters:
- $x – int
- $y – int
- $width – int
- $height – int
- $raised –
fill3DRect($x, $y, $width, $height, $raised)¶
Parameters:
- $x – int
- $y – int
- $width – int
- $height – int
- $raised –
drawOval($x, $y, $width, $height)¶Draw oval
Parameters:
- $x – int
- $y – int
- $width – int
- $height – int
fillOval($x, $y, $width, $height)¶
Parameters:
- $x – int
- $y – int
- $width – int
- $height – int
drawArc($x, $y, $width, $height, $startAngle, $arcAngle)¶
Parameters:
- $x – int
- $y – int
- $width – int
- $height – int
- $startAngle – int
- $arcAngle – int
fillArc($x, $y, $width, $height, $startAngle, $arcAngle)¶
Parameters:
- $x – int
- $y – int
- $width – int
- $height – int
- $startAngle – int
- $arcAngle – int
drawPolygon($xy)¶
Parameters:
- $xy – array - - [[x1, y1], [x2, y2], ... ]
fillPolygon($xy)¶
Parameters:
- $xy – array - - [[x1, y1], [x2, y2], ... ]
drawPolyline($xy)¶
Parameters:
- $xy – array - - [[x1, y1], [x2, y2], ... ]
drawImage($image, $x = 0, $y = 0, $newWidth = null, $newHeight = null)¶
Parameters:
- $image – php\swing\Image
- $x – int
- $y – int
- $newWidth – null, int
- $newHeight – null, int
drawText($text, $x, $y)¶
Parameters:
- $text – string
- $x – int
- $y – int
clipRect($x, $y, $width, $height)¶Intersects the current clip with the specified rectangle.
Parameters:
- $x – int
- $y – int
- $width – int
- $height – int
clearRect($x, $y, $width, $height)¶Clears the specified rectangle by filling it with the background color of the current drawing surface.
Parameters:
- $x – int
- $y – int
- $width – int
- $height – int
setXORMode($color)¶
Parameters:
- $color – php\swing\Color, int, array
translate($x, $y)¶Translates the origin of the graphics context to the point (x, y) in the current coordinate system.
Parameters:
- $x – int
- $y – int
copyArea($x, $y, $width, $height, $dx, $dy)¶Copies an area of the component by a distance specified by $dx and $dy
Parameters:
- $x – int
- $y – int
- $width – int
- $height – int
- $dx – int
- $dy – int
create($x = null, $y = null, $w = null, $h = null)¶Create new copy Graphics from this
Parameters:
- $x – int, null
- $y – int, null
- $w – int, null
- $h – int, null
Returns:
dispose()¶