Graphical representation of an image.
To display a centered
GImage of the Stanford tree:
window = GWindow() tree = GImage("StanfordTree.gif") x = (window.width - tree.width) / 2 y = (window.height - tree.height) / 2 window.add(tree, x, y)
The above code assumes that you have a file named
the current directory.
The search for matching image files begins in the current directory and,
failing that, searches an
images/ subdirectory relative to the calling script.
blank(width, height, background=<campy.graphics.gcolor.GColor object>)¶
Initialize a new image from the given file.
The image file should either exist in the current directory or in a subdirectory named
Parameters: filename – the name of the image file to load.
Get the pixel at (x, y).
set_pixel(x, y, pixel)¶
Set the pixel at (x, y).