Monday, December 5, 2016

Reflection of class on Dec 1st
  Well, this chapter 6 is the last one that teach us how to promote our drawing application by attaching interesting functions to dedicated buttons and mouse movement, that is, like the basic pre-installed drawing tool in Windows system, we can make an image stamp to the canvas and use mouse to draw an image directly.
  It’s not easy to do that, the first problem I met was that I couldn’t place the image to the location of mouse clicking when I run the complete procedure after coding as examples in chapter, the image would automatically appear at the middle of bottom of canvas when I clicked image buttons. I knew I need to change the ‘x_coord’ and ‘y_coord’ in ‘canvas.create_image’ statement which reflected to the current coordinate of cursor when I hit the arrow keys to draw lines, but I really didn’t know how to adjust it to my thought to make it run well as the real stamping tool which could stamp images to anywhere I wonder on canvas.
  And the second problem was that I couldn’t understand the meaning of binding statement which attached relative function to mouse movement. What did the ‘<B1-Motion>’ and ‘<Button-1>’ use for? When should I add ‘event’ argument to ‘paint’ function and how to decided it?
  Though I could control the placement of image by using arrow keys to position it with the pen in the up position inspired by challenge 1, it would be a real hard work to place each image to the appointed position by hit arrow keys frequently.
  Actually, the complete procedure showed in this chapter is not a perfect program to achieve the function of stamping and mouse drawing, I want to find a better way to update it by implementing the idea of C programming in but get no reward. I’ll do it continually.


No comments:

Post a Comment