(self, frame, img, content_mode=SCALE_TO_FILL)
Create an image view from an image.

        frame.topleft

            where to position the view.

        frame.size

            if (0, 0) the frame.size is set to the image's size;
            otherwise, the image is scaled to this size.
Create an image view from an image.
Create an image view from an image .
def __init__(self, frame, img, content_mode=SCALE_TO_FILL):
        """Create an image view from an image.

        frame.topleft

            where to position the view.

        frame.size

            if (0, 0) the frame.size is set to the image's size;
            otherwise, the image is scaled to this size.

        """

        assert img is not None

        if frame is None:
            frame = pygame.Rect((0, 0), img.get_size())
        elif frame.w == 0 and frame.h == 0:
            frame.size = img.get_size()

        view.View.__init__(self, frame)

        self._enabled = False
        self.content_mode = content_mode
        self.image = img
def __init__ ( self , frame , img , content_mode = SCALE_TO_FILL ) : assert img is not None if frame is None : frame = pygame . Rect ( ( 0 , 0 ) , img . get_size ( ) ) elif frame . w == 0 and frame . h == 0 : frame . size = img . get_size ( ) view . View . __init__ ( self , frame ) self . _enabled = False self . content_mode = content_mode self . image = img