0% found this document useful (0 votes)
8 views2 pages

R Theta

This document lists graphics functions for drawing shapes, images, text, and manipulating graphics states. It includes functions for drawing lines, arcs, ovals, rectangles, polygons, and images. Additional functions set colors, fonts, window properties, and control the graphics window.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

R Theta

This document lists graphics functions for drawing shapes, images, text, and manipulating graphics states. It includes functions for drawing lines, arcs, ovals, rectangles, polygons, and images. Additional functions set colors, fonts, window properties, and control the graphics window.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Functions

initGraphics( )
initGraphics(width, height)
drawArc(bounds, start, sweep)
drawArc
(x, y, width, height, start, sweep)
fillArc (bounds, start, sweep)
fillArc (x, y, width, height, start, sweep)
drawImage(filename, pt)
drawImage(filename, x, y)
drawImage(filename, bounds)
drawImage(filename, x, y, width, height)
getImageBounds(filename)
drawLine(p0, p1)
drawLine(x0, y0, x1, y1)
drawPolarLine(p0, r, theta)
drawPolarLine(x0, y0, r, theta)
drawOval(bounds)
drawOval(x, y, width, height)
fillOval(bounds)
fillOval(x, y, width, height)
drawRect(bounds)
drawRect(x, y, width, height)
fillRect(bounds)
fillRect(x, y, width, height)
drawPolygon(polygon)
drawPolygon(polygon, pt)
drawPolygon(polygon, x, y)
fillPolygon(polygon)
fillPolygon(polygon, pt)
fillPolygon(polygon, x, y)
drawString(str, pt)
drawString(str, x, y)
getStringWidth(str)
setFont(font)
getFont( )
setColor(color)
getColor( )
saveGraphicsState( )

Creates the graphics window on the screen.


Draws an elliptical arc inscribed in a rectangle.
Fills a wedge-shaped area of an elliptical arc.
Draws the image from the specified file with its upper
left corner at the specified point.
Returns the bounds of the image contained in the
specified file.
Draws a line connecting the specified points.
Draws a line of length r in the direction theta from
the initial point.
Draws the frame of a oval with the specified bounds.
Fills the frame of a oval with the specified bounds.
Draws the frame of a rectangle with the specified
bounds.
Fills the frame of a rectangle with the specified
bounds.
Draws the outline of the specified polygon.

Fills the frame of the specified polygon.


Draws the string str so that its baseline origin appears
at the specified point.
Returns the width of the string str when displayed in
the current font.
Sets a new font.
Returns the current font.
Sets the color used for drawing.
Returns the current color as a string in the form
"#rrggbb".
Saves the state of the graphics context.

restoreGraphicsState( )
getWindowWidth( )
getWindowHeight( )
repaint )
pause(milliseconds)
waitForClick( )
setWindowTitle(title)
getWindowTitle( )
exitGraphics( )

Restores the graphics state from the most recent call to


saveGraphicsState().
Returns the width of the graphics window in pixels.
Returns the height of the graphics window in pixels.
Issues a request to update the graphics window.
Pauses for the indicated number of milliseconds.
Waits for a mouse click to occur anywhere in the
window.
Sets the title of the primary graphics window.
Returns the title of the primary graphics window.
Closes the graphics window and exits from the
application without waiting for any additional user
interaction.

You might also like