Answer the question
In order to leave comments, you need to log in
How to change window icon on taskbar in pygame?
How to change window icon on taskbar in pygame?
Wrote a small pygame program:
import pygame
import sys
import ctypes
FPS = 60
W = 700 # ширина экрана
H = 300 # высота экрана
WHITE = (255, 255, 255)
BLUE = (0, 70, 225)
sc = pygame.display.set_mode((W, H))
clock = pygame.time.Clock()
pygame.display.set_caption("circle!")
кув = pygame.image.load("C:\спрайти\кув.bmp")
pygame.display.set_icon(кув)
# координаты и радиус круга
x = W // 2
y = H // 2
r = 50
while 1:
for i in pygame.event.get():
if i.type == pygame.QUIT:
pygame.quit()
sys.exit()
sc.fill(WHITE)
pygame.draw.circle(sc, BLUE, (x, y), r)
pygame.display.update()
keys = pygame.key.get_pressed()
if keys[pygame.K_LEFT]:
if x <= 47 and W == 700:
pass
else:
x -= 3
elif keys[pygame.K_RIGHT]:
if x >= 647 and W == 700:
pass
else:
x += 3
if keys[pygame.K_DOWN]:
print(y)
if y >= 246 and H == 300:
pass
else:
y += 3
elif keys[pygame.K_UP]:
print(y)
if y <= 51 and H == 300:
pass
else:
y -= 3
clock.tick(FPS)
import ctypes
myappid = 'mycompany.myproduct.subproduct.version' # arbitrary string
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
But it only works with tkinter, not pygame. pygame.display.set_caption("Title", get_image_file("C:\спрайти\кув.bmp"))
Answer the question
In order to leave comments, you need to log in
import inspect, os.path
filename = inspect.getframeinfo(inspect.currentframe()).filename
path = os.path.dirname(os.path.abspath(filename))
icon_surf = pygame.image.load(path + '/android.png')
img = pygame.image.load(io.BytesIO(result))
screen.blit(img, (0, 0))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question