BaseImage¶
Object that loads an image, stores as a surface, transform it and let write the image to an surface.
Parameters: Updates the original surface to the current surface.
Returns: None
Draw the image in a given surface.
Parameters: - surface (
pygame.Surface
) – Pygame surface object - area (
pygame.Rect
, None) – Area to draw, if None, Image will be drawn on entire surface - position (tuple) – Position to draw
Returns: None
- surface (
Returns true if the image is the same as the object
Parameters: image (BaseImage) – Image object Returns: True if the image is the same (note, the surface) Return type: bool
This can flip the image either vertically, horizontally, or both. Flipping a image is non-destructive and does not change the dimensions.
Parameters: Returns: None
Returns: Image drawing mode Return type: int
Returns: Return the extension of the image file Return type: str
Returns: Return the name of the image file Return type: str
Return the rect of the image.
Returns: Pygame rect object Return type: pygame.Rect
Return the size in pixels of the image.
Returns: (width,height) Return type: tuple
Return the surface object.
Returns: Image surface Return type: pygame.Surface
Set the image size to another size. This is a fast scale operation.
Parameters: Returns: None
Restore image to the original surface.
Returns: None
Unfiltered counterclockwise rotation. The angle argument represents degrees and can be any floating point value. Negative angle amounts will rotate clockwise.
Unless rotating by 90 degree increments, the image will be padded larger to hold the new size. If the image has pixel alphas, the padded area will be transparent. Otherwise pygame will pick a color that matches the image colorkey or the topleft pixel value.
Parameters: angle (int, float) – Rotation angle Returns: None
Scale the image to a desired width and height factor.
Parameters: Returns: None
This will return a new image that is double the size of the original. It uses the AdvanceMAME Scale2X algorithm which does a ‘jaggy-less’ scale of bitmap graphics.
This really only has an effect on simple images with solid colors. On photographic and antialiased images it will look like a regular unfiltered scale.
Returns: None