![]() ![]() Rectangle covers an area width pixels wide by The left and right edges of the rectangle Int height) Fill the specified rectangle. Public int getTransparency() Return the current transparency of the image. (invisible) and 255 is completely opaque (the default). Parameters: t - A value in the range 0 to 255. Public void setTransparency(int t) Set the transparency of the image. color) Sets the color at the given pixel to the given color. Throws: - If the pixel location is not within the Int y) Return the color at the given pixel. Public getColor() Return the current drawing color. Parameters: color - The color to be used. Public void setColor( color) Set the current drawing color. ![]() This font will be used for subsequent text Public void setFont( f) Set the current font. Parameters: image - The image to draw onto this one. Int y) Draws the given Image onto this image Public void drawImage( GreenfootImage image, Public void fill() Fill the entire image with the current drawing dcolor. Public void mirrorHorizontally() Mirrors the image horizontally (flip around the x-axis). ![]() Public void mirrorVertically() Mirrors the image vertically (flip around the y-axis). Parameters: width - Width of new image height - Height of new image Int height) Scales this image to a new size. Public void rotate(int degrees) Rotates this image around the center. Public int getHeight() Return the height of the image. Public int getWidth() Return the width of the image. Returns: The backing this GreenfootImage Since: Greenfoot version 1.0.2 The returned image will be reflected in the GreenfootImage. Public getAwtImage() Returns the that backs this GreenfootImage. Parameters: string - the string to be drawn size - the requested height in pixels of each line of text (the actual height may be different by a pixel or so) foreground - the color of the text background - the color of the image behind the text Since: 2.0.1 Method Detail Is split into multiple lines which are drawn horizontally-centred. background) Creates an image with the given string drawn as text using the given font size, with the given foregroundĬolor on the given background color. Throws Create a GreenfootImage from another GreenfootImage. Public GreenfootImage( GreenfootImage image) height - The height of the image in pixels. Parameters: width - The width of the image in pixels. Int height) Create an empty (transparent) image with the specified size. Throws: - If the image can not be loaded. Parameters: filename - Typically the name of a file in the images directory within The file name may be an absolute path, or a base name for a file located in Throws Create an image from an image file. Methods inherited from class Ĭlone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait Return a text representation of the image. Sets the color at the given pixel to the given color. Mirrors the image vertically (flip around the y-axis). Mirrors the image horizontally (flip around the x-axis). Return the current transparency of the image. Returns the that backs this GreenfootImage. GreenfootImage( filename)Ĭreates an image with the given string drawn as text using the given font size, with the given foregroundĭraw a line, using the current drawing color, between the pointsĭraw an oval bounded by the specified rectangle with the current drawingĭraws a closed polygon defined by arrays of x and yĭraw the outline of the specified rectangle.ĭraw the text given by the specified string, using the current font andįill the entire image with the current drawing dcolor.įill an oval bounded by the specified rectangle with the current drawingįill a closed polygon defined by arrays of x and yĭraw a filled shape directly on the image. The image may be loaded from an image fileĪnd/or drawn by using various drawing methods.Ĭreate a GreenfootImage from another GreenfootImage.Ĭreate an empty (transparent) image with the specified size. Public class GreenfootImage extends Īn image to be shown on screen. SUMMARY: NESTED | FIELD | CONSTR | METHOD ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |