#!/bin/python
import pygame, sys
import random
green = (0, 255, 0)
blue = (0, 0, 128)
red = (255, 0, 0)
pygame.init()
sc = pygame.display.set_mode((840, 700))
pygame.display.set_caption("Неполная рамка изображения")
myimage = pygame.image.load("image.png")
imagerect = myimage.get_rect()
while True:
sc.fill((125,125,125))
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
pygame.draw.rect(sc, blue, (50,0,imagerect[2],50))
pygame.draw.rect(sc, blue, (50,imagerect[3]+50,imagerect[2],50))
sc.blit(myimage,(50,50))
pygame.display.flip()
pygame.image.save(sc, "image1.png")
|