def test_blt(self): source = ImageRGBA(300, 200) dest = ImageRGBA(300, 200) sa, spitch = source.address_info() da, dpitch = dest.address_info() draw_rect(source, 120, 130, 10, 8, 130, 120, 150, 180) blt_rect(sa, 120, 130, 10, 8, spitch, da, 180, 190, dpitch, fliped=False) self._check_values(dest, 180, 190, 10, 8, 130, 120, 150, 180) blt_rect(sa, 120, 130, 10, 8, spitch, da, 50, 60, dpitch, fliped=False) self._check_values(dest, 50, 60, 10, 8, 130, 120, 150, 180)
def _windows_image_loader(fname): try: import imload width, height = imload.QueryImage(fname) im = ImageRGBA(width, height) addr, pitch = im.address_info() imload.GetImage(fname, addr, width, height) return im except ImportError: return None return None