পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Tuesday, April 4, 2017

Tk - Images

The image widget is used to create and manipulate images. The syntax for creating image is as follows −
image create type name options
In the above syntax type is photo or bitmap and name is the image identifier.

Options

The options available for image create are listed below in the following table −
S.No. Syntax & Description
1 -file fileName
The name of the image file name.
2 -height number
Used to set height for widget.
3 -width number
Sets the width for widget.
4 -data string
Image in base 64 encoded string.
A simple example for image widget is shown below −
#!/usr/bin/wish

image create photo imgobj -file "/Users/rajkumar/Desktop/F Drive/pictur/vb/Forests/
   680049.png" -width 400 -height 400 
pack [label .myLabel]
.myLabel configure -image imgobj 
When we run the above program, we will get the following output −
Image Example The available function for image are listed below in the following table −
S.No. Syntax & Description
1 image delete imageName
Deletes the image from memory and related widgets visually.
2 image height imageName
Returns the height for image.
3 image width imageName
Returns the width for image.
4 image type imageName
Returns the type for image.
5 image names
Returns the list of images live in memory.
A simple example for using the above image widget commands is shown below −
#!/usr/bin/wish

image create photo imgobj -file "/Users/rajkumar/images/680049.png"
   -width 400 -height 400 
pack [label .myLabel]
.myLabel configure -image imgobj
puts [image height imgobj]
puts [image width imgobj]
puts [image type imgobj]
puts [image names]
image delete imgobj
The image will be deleted visually and from memory once "image delete imgobj" command executes. In console, the output will be like the following −
400
400
photo
imgobj ::tk::icons::information ::tk::icons::error ::tk::icons::
warning ::tk::icons::question

No comments:

Post a Comment