copyInto and cropPicture functions in JES.
Cropping an image means to cut out a certain part of the image and discard the rest of it. Actually, rather than change the original picture, we will create a new picture that consists only of the desired section , leaving the original picture unchanged. Cropping is one of the essential functions in image processing/manipulation. Understanding picture dimensions (height and width) is an important part of cropping an image.
myPict in these exercises.
littlePic = cropPicture(myPict, 1, 1, 50, 50)
What does littlePic look like? Which part of
myPict is it?
littleBiggerPic = cropPicture(myPict, 1, 1,
getWidth(myPict)/2, getHeight(myPict)/2)
What does this do? Which part of myPict is it?
myPict in MediaTools -> Picture Tool. Find a
section to crop by moving the mouse around over the picture. The
x- and y- coordinates are displayed at the
top. Write down the statement you would use to crop this section and
save it in a variable.
canvas in
these exercises.
copyInto function to put
littlePic from the previous exercises in the upper-left
corner of canvas. Does this modify canvas?
myPict or
whatever you like. Use the duplicatePicture function to
duplicate your picture, and store it in canvas. Now repeat
your line to copy littlePic into the upper left corner of
canvas. Does canvas get modified this time?
Why or why not?
littleBiggerPic somewhere into the
middle of canvas. Which picture(s) get(s) changed? Why?
littlePic into
littleBiggerPic, and then littleBiggerPic
somewhere in to an empty canvas, so that ony the canvas gets modified.
What does your code look like? Write it down.