Skip to main content


Create Watermark Splash Screen in Real Time using Python Tkinter

WATCH THE TUTORIAL FIRST




Watermark App using Tk.py

# pip install Pillow

from tkinter import *
from PIL import ImageTk,Image


def size():     
     root = Tk()
     # Detect your screen width x height
     ws = root.winfo_screenwidth()
     hs = root.winfo_screenheight()
     print(ws,'x', hs) #1360 x 768

def img_size():
     im = Image.open('pyimageg.png')
     width, height = im.size
     print(im.size) #300 x 300

print('1920 x 1080')
print('1920 / 2 ='+str(1360 / 2))
print('1080 / 2 ='+str(768 / 2))
print()
print('300 x 300')
print('300 / 2 ='+str(300 / 2))
print()
print(int(1920 / 2) - int(300 / 2),int(1080 / 2) - int(300 / 2))

#####################################################################################################
def wd(text):
     return str(text)

def ht(text):
     return str(text)

def run(t_1,t_2):
     root = Tk()
     canvas = Canvas(root, width = 300, height =300, bg = 'white', highlightthickness = 0)  
     canvas.pack()
     canvas.master.overrideredirect(True)
     canvas.master.geometry('+'+wd(t_1)+'+'+ht(t_2)+'')
     canvas.master.wm_attributes("-transparentcolor","white")
     canvas.master.wm_attributes("-alpha",0.4)
     canvas.master.wm_attributes("-topmost",True)
     canvas.master.lift()
     img = ImageTk.PhotoImage(Image.open("pyimageg.png"))  
     canvas.create_image(10, 10, anchor=NW, image=img)
     root.mainloop()

def center():
     w = int(1920 / 2) - int(300 / 2)
     h = int(1080 / 2) - int(300 / 2)
     run(w,h)






Download Image Source

https://drive.google.com/file/d/1XSXTrCPPz4Vt7jQnvNWBanYHl9fHQxci/view?usp=sharing

Comments



🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍

Popular Posts

Python underline string, Python underline text, Underline python print

Python pip - Installing modules from IDLE (Pyton GUI) for python 3.7

Top 40 Python - String Processing in Python | Working with String in Python

Top 11 Essential Python Tips and Tricks

Python Program - When was I born? / Date of Birth / MY BIRTHDAY (using Python3+)





Subscribe to our Channel


Follow us on Facebook Page

Join our python facebook groups



Join us on Telegram