PHP:Flags with Rectangles Tutorial
You can use the GD php library at http://uk3.php.net/manual/en/ref.image.php for these questions.
- You may want to review: PHP:drawing and filling rectangles before tackling these questions.
- You might want to try PHP:coordinates exercises if you are not comfortable with x,y coordinates.
The flag of Libya is a simple green rectangle.
Try the program as it is given, then change it so that the green rectangle is 150 wide.
imagefilledrectangle will draw a filled rectangle
- $g is the graphics area
- ($x1,$y1) are the coordinates of the top left corner
- ($x2,$y2) are the coordinates of the bottom right corner
- $col is the color
The flag of Germany is black, red and yellow.
- The flag of Japan is a red circle on a white background.
- The rectangle is 150 by 100.
- The circle is in position 45,20, width and height are 60,60.
- The dark lines are NOT part of the flag. They are shown as guides only.