mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-18 14:11:16 +02:00
recenter linux icon
This commit is contained in:
580
data/icon.cpp
580
data/icon.cpp
File diff suppressed because one or more lines are too long
@@ -20,4 +20,3 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
extern const unsigned char app_icon[];
|
extern const unsigned char app_icon[];
|
||||||
extern const unsigned char app_icon_bitmap[];
|
|
||||||
|
@@ -1,7 +1,16 @@
|
|||||||
import sys
|
import sys
|
||||||
|
from PIL import Image
|
||||||
|
image = Image.open(sys.argv[1])
|
||||||
|
|
||||||
with open(sys.argv[1], "rb") as icon:
|
output = ""
|
||||||
|
formatted = []
|
||||||
|
for pixel in image.getdata():
|
||||||
|
formatted.extend("0x{0:02X}".format(byte) for byte in pixel)
|
||||||
|
for i in range(len(formatted)/16 + 1):
|
||||||
|
print(", ".join(formatted[i*16:(i+1)*16]) + ",")
|
||||||
|
|
||||||
|
"""with open(sys.argv[1], "rb") as icon:
|
||||||
icondata = icon.read()
|
icondata = icon.read()
|
||||||
output = ["0x{0:02X}".format(ord(byte)) for byte in icondata]
|
output = ["0x{0:02X}".format(ord(byte)) for byte in icondata]
|
||||||
for line in range(len(output)/16+1):
|
for line in range(len(output)/16+1):
|
||||||
print(", ".join(output[line*16:(line+1)*16])+",")
|
print(", ".join(output[line*16:(line+1)*16])+",")"""
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -188,7 +188,7 @@ int SDLOpen()
|
|||||||
//SDL_SetWindowResizable(sdl_window, SDL_TRUE);
|
//SDL_SetWindowResizable(sdl_window, SDL_TRUE);
|
||||||
|
|
||||||
#ifdef LIN
|
#ifdef LIN
|
||||||
SDL_Surface *icon = SDL_CreateRGBSurfaceFrom((void*)app_icon, 48, 48, 24, 144, 0x00FF0000, 0x0000FF00, 0x000000FF, 0);
|
SDL_Surface *icon = SDL_CreateRGBSurfaceFrom((void*)app_icon, 48, 48, 32, 192, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);
|
||||||
SDL_SetWindowIcon(sdl_window, icon);
|
SDL_SetWindowIcon(sdl_window, icon);
|
||||||
SDL_FreeSurface(icon);
|
SDL_FreeSurface(icon);
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user