For this lab assignment, complete the following:
To add the text message, use the addMessage () method of the Picture class. This method takes 3 parameters:
We want the text to be on the bottom left side of the picture. Let us put it 20 pixels over from the left edge of the the picture and 20 pixels above the bottom edge of the picture. The xpos value is simple, that will be 20. However, we must calculate the ypos value.
Fortunately, the Picture class has a method getWidth() method and a getHeight() method. Each of these return the distance in pixels across the width (which is the X direction) or the height (which is the Y direction) of the picture. The coordinate position of (0,0) is in the upper left corner of the picture.
Thus to calculate the value for the ypos for the addMessage() method, we need to subtract 20 from the height of the picture.
The message that you put in the picture can really be anything you want. If you can't think of anything interesting, just put "CS 101 - Lab 6" followed by your name. This sort of idea is normally used to add a caption to a picture or to add a copyright statement. Note: you should only be adding copyright statements to pictures that you took/created yourself.
The following is an example a before and after picture: