Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
JAYAKANTHARUN committed Dec 26, 2022
1 parent 34ec22b commit 2e3c769
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 21 deletions.
Binary file added iconphoto.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 31 additions & 21 deletions imageresize.py → imageresizeapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,16 @@ def save():
img2=cv2.resize(img,(newwidth,newheight),interpolation=cv2.INTER_AREA)
cv2.imwrite(fd,img2)
messagebox.showinfo("MESSAGE","IMAGE SAVED SUCCESSFULLY")

def close():
if messagebox.askyesno("CONFIRMATION","ARE YOU SURE THAT YOU WANT TO QUIT ?")==FALSE:
return FALSE
root.destroy()

root=Tk()

icon=PhotoImage(file="iconphoto.png")
root.iconphoto(False, icon)
root.title("IMAGE RESIZE APPLICATION")
root.geometry("1000x700")
root.configure(bg="light blue")
Expand All @@ -51,17 +58,17 @@ def save():
height=StringVar()
percentage=StringVar()

frame1 = LabelFrame(root,highlightbackground="royalblue", highlightthickness=10,text="Source File",font=('courier', 20,"bold"))
frame1.pack(fill="both",expand="yes",padx=20,pady=20)
frame1 = LabelFrame(root,highlightbackground="royalblue", highlightthickness=10,text="Source File",font=('comic sans ms', 20,"bold"))
frame1.pack(fill="both",expand="yes",padx=10,pady=10)

frame2 = LabelFrame(root,highlightbackground="royalblue", highlightthickness=10,text="Image Details",font=('courier', 20,"bold"))
frame2.pack(fill="both",expand="yes",padx=20,pady=20)
frame2 = LabelFrame(root,highlightbackground="royalblue", highlightthickness=10,text="Image Details",font=('comic sans ms', 20,"bold"))
frame2.pack(fill="both",expand="yes",padx=10,pady=10)

frame3 = LabelFrame(root,highlightbackground="royalblue", highlightthickness=10,text="Pixel Safe",font=('courier', 20,"bold"))
frame3.pack(fill="both",expand="yes",padx=20,pady=20)
frame3 = LabelFrame(root,highlightbackground="royalblue", highlightthickness=10,text="Pixel Safe",font=('comic sans ms', 20,"bold"))
frame3.pack(fill="both",expand="yes",padx=10,pady=10)

frame4 = LabelFrame(root,highlightbackground="royalblue", highlightthickness=10,text="Actions",font=('courier', 20,"bold"))
frame4.pack(fill="both",expand="yes",padx=20,pady=20)
frame4 = LabelFrame(root,highlightbackground="royalblue", highlightthickness=10,text="Actions",font=('comic sans ms', 20,"bold"))
frame4.pack(fill="both",expand="yes",padx=10,pady=10)

frame1.config(bg="skyblue")

Expand All @@ -71,43 +78,46 @@ def save():

frame4.config(bg="skyblue")

label1=Label(frame1,text="Source File :",bg="skyblue",font=('courier', 13))
label1=Label(frame1,text="Source File :",bg="skyblue",font=('comic sans ms', 13))
label1.pack(side=tk.LEFT,padx=10,pady=10)

entry1=Entry(frame1,textvariable=t1,font=('courier', 13), justify=CENTER)
entry1=Entry(frame1,textvariable=t1,font=('comic sans ms', 13), justify=CENTER)
entry1.pack(side=tk.LEFT,padx=10,pady=10)

button1=Button(frame1,text="Browse",command=imgbrowse,bg="steelblue2",font=('courier', 13))
button1=Button(frame1,text="Browse",command=imgbrowse,bg="steelblue2",font=('comic sans ms', 13),border=5)
button1.pack(side=tk.LEFT,padx=10,pady=10)

button2=Button(frame1,text="Preview",command=imgpreview,bg="steelblue2",font=('courier', 13))
button2=Button(frame1,text="Preview",command=imgpreview,bg="steelblue2",font=('comic sans ms', 13),border=5)
button2.pack(side=tk.LEFT,padx=10,pady=10)

label2=Label(frame2,text="Dimension (Width X Height) :",bg="skyblue",font=('courier', 13))
label2=Label(frame2,text="Dimension (Width X Height) :",bg="skyblue",font=('comic sans ms', 13))
label2.pack(side=tk.LEFT,padx=10,pady=10)

entry2=Entry(frame2,textvariable=width,font=('courier', 13), justify=CENTER)
entry2=Entry(frame2,textvariable=width,font=('comic sans ms', 13), justify=CENTER)
entry2.pack(side=tk.LEFT,padx=10,pady=10)

label3=Label(frame2,text="X",bg="skyblue",font=('courier', 13))
label3=Label(frame2,text="X",bg="skyblue",font=('comic sans ms', 13))
label3.pack(side=tk.LEFT,padx=10,pady=10)

entry3=Entry(frame2,textvariable=height,font=('courier', 13), justify=CENTER)
entry3=Entry(frame2,textvariable=height,font=('comic sans ms', 13), justify=CENTER)
entry3.pack(side=tk.LEFT,padx=10,pady=10)

label4=Label(frame3,text="Percentage :",bg="skyblue",font=('courier', 13))
label4=Label(frame3,text="Percentage :",bg="skyblue",font=('comic sans ms', 13))
label4.pack(side=tk.LEFT,padx=10,pady=10)

entry4=Entry(frame3,textvariable=percentage,font=('courier', 13), justify=CENTER)
entry4=Entry(frame3,textvariable=percentage,font=('comic sans ms', 13), justify=CENTER)
entry4.pack(side=tk.LEFT,padx=10,pady=10)

button3=Button(frame3,text="Recalculate Dimension",command=recalculate,bg="steelblue2",font=('courier', 13))
button3=Button(frame3,text="Recalculate Dimension",command=recalculate,bg="steelblue2",font=('comic sans ms', 13),border=5)
button3.pack(side=tk.LEFT,padx=10,pady=10)

button4=Button(frame4,text="Preview",command=img2preview,bg="steelblue2",font=('courier', 13))
button4=Button(frame4,text="Preview",command=img2preview,bg="steelblue2",font=('comic sans ms', 13),border=5)
button4.pack(side=tk.LEFT,padx=10,pady=10)

button5=Button(frame4,text="Save",command=save,bg="steelblue2",font=('courier', 13))
button5=Button(frame4,text="Save",command=save,bg="steelblue2",font=('comic sans ms', 13),border=5)
button5.pack(side=tk.LEFT,padx=10,pady=10)

button6=Button(root,text="Exit Application",command=close,bg="steelblue2",font=('comic sans ms', 13),border=5)
button6.pack(pady=10)

root.mainloop()

0 comments on commit 2e3c769

Please sign in to comment.