from gpanel import * # bild = getImage("programs/tigerjython/zahl.png") # Die "untere" Zeile kann durch die obige (noch auskommentierte) Zeile ersetzt werden, # wenn dort der richtige Pfad zu einem existierenden Bild angegeben ist. # Vielleicht ist auch kein Pfad nötig, wenn das Bild im selben Verzeichnis # wie dieses Programm liegt. bild = getImage("_sprites/colorfrog.png") breite = bild.getWidth() hoehe = bild.getHeight() anzahl = 3 makeGPanel(Size(breite * anzahl, hoehe * anzahl)) window(0, breite * anzahl, 0, hoehe * anzahl) title("Key 'Esc': escape") for x in range(anzahl): for y in range(anzahl): image(bild, x * breite, y * hoehe) fillRectangle(0,0, 20, 20) bm = GBitmap(breite * anzahl, hoehe * anzahl) for x in range(breite * anzahl): for y in range(hoehe * anzahl): color = getPixelColor(x,y) bm.setPixelColor(x, hoehe * anzahl - 1 - y, color) save(bm, "viele-kopien.png", "png")