Attempts to load a scaled bitmap. Args: name (str): TypeID or basename of the image being requested. location (str): Path to a location that may contain the image. scale (int): Scale factor of the image variant to load. If ``0``, attempts to load the
(cls, name, location, scale=0)
| 109 | |
| 110 | @classmethod |
| 111 | def loadScaledBitmap(cls, name, location, scale=0): |
| 112 | """Attempts to load a scaled bitmap. |
| 113 | |
| 114 | Args: |
| 115 | name (str): TypeID or basename of the image being requested. |
| 116 | location (str): Path to a location that may contain the image. |
| 117 | scale (int): Scale factor of the image variant to load. If ``0``, attempts to load the unscaled variant. |
| 118 | |
| 119 | Returns: |
| 120 | (str, wx.Image): Tuple of the filename that may have been loaded and the image at that location. The |
| 121 | filename will always be present, but the image may be ``None``. |
| 122 | """ |
| 123 | filename = "{0}@{1}x.png".format(name, scale) if scale > 0 else "{0}.png".format(name) |
| 124 | img = cls.loadImage(filename, location) |
| 125 | return filename, img |
| 126 | |
| 127 | @classmethod |
| 128 | def loadImage(cls, filename, location): |