This commit is contained in:
admin 2024-01-25 19:41:39 +01:00
parent a8210a13d0
commit a4a87f9239
5 changed files with 17 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 540 KiB

View file

@ -174,7 +174,7 @@ def run_installer(download_folder_tmp):
# Create a container frame for widgets
container = CTkFrame(app)
container.pack(side="right") # Place the container on the right side
container.pack(ipadx="100") # Place the container on the right side
# Display the StarField initially
display_star_field(container)

View file

@ -1,6 +1,7 @@
import math
from tkinter import Canvas
from random import randrange # Add this import statement
from random import randrange
from PIL import Image, ImageTk # Import Image and ImageTk from PIL
class Star:
__slots__ = ['x', 'y', 'z', 'id', 'radius', 'fill']
@ -25,10 +26,19 @@ class StarField:
self.max_depth = depth
self.center_x = width / 2
self.center_y = height / 2
self.circular_mask_radius = min(self.center_x, self.center_y)
self.circular_mask_radius = min(self.center_x, self.center_y) *0.95
self.canvas = Canvas(master, width=width, height=height, bg="#000000")
self.canvas.pack()
# Load the image and resize it
original_image = Image.open("./assets/logo.png") # Specify the path to your image
image_size = self.height if self.width > self.height else self.width
resized_image = original_image.resize((image_size, image_size), resample=Image.LANCZOS)
self.image = ImageTk.PhotoImage(resized_image)
self.image_item = self.canvas.create_image(self.center_x, self.center_y, anchor='center', image=self.image)
for x in range(num_stars):
star = Star(x=randrange(-self.width, self.width),
y=randrange(-self.height, self.height),
@ -65,4 +75,7 @@ class StarField:
self.canvas.coords(star.id, x - star.radius, y - star.radius, x + star.radius, y + star.radius)
self.canvas.itemconfig(star.id, fill='#%02x%02x%02x' % (star.fill, star.fill, star.fill))
# Move the image to the front
self.canvas.tag_raise(self.image_item)
self.canvas.after(30, self.draw)