Image¶
- class mobrob_behcon.visu.graphics.Image(p, *pixmap)[source]¶
Attributes
idCount
imageCache
Methods
__init__
(p, *pixmap)clone
()draw
(graphwin)Draw the object in graphwin, which should be a GraphWin object.
Returns the height of the image in pixels
getPixel
(x, y)Returns a list [r,g,b] with the RGB color values for pixel (x,y) r,g,b are in range(256)
getWidth
()Returns the width of the image in pixels
move
(dx, dy)move object dx units in x direction and dy units in y direction
save
(filename)Saves the pixmap image to filename.
setFill
(color)Set interior color to color
setOutline
(color)Set outline color to color
setPixel
(x, y, color)Sets pixel (x,y) to the given color
setWidth
(width)Set line weight to width
undraw
()Undraw the object (i.e.
Details
- draw(graphwin)¶
Draw the object in graphwin, which should be a GraphWin object. A GraphicsObject may only be drawn into one window. Raises an error if attempt made to draw an object that is already visible.
- getPixel(x, y)[source]¶
Returns a list [r,g,b] with the RGB color values for pixel (x,y) r,g,b are in range(256)
- move(dx, dy)¶
move object dx units in x direction and dy units in y direction
- save(filename)[source]¶
Saves the pixmap image to filename. The format for the save image is determined from the filname extension.
- setFill(color)¶
Set interior color to color
- setOutline(color)¶
Set outline color to color
- setWidth(width)¶
Set line weight to width