This is an old revision of the document!
You can do grabit DESIG PROJECT do grab the project. grabit cprog gtf0 is the command. Make sure to add it to your repository.
Once gtf0 has been grabbed: hg add gtf0 hg commit -m “MESSAGE HERE” to track what you have done hg push to push it into your repository
First, compile the program using the following command:
gcc -Wall –std=genu18 -o gtf0 gtf0.c -lgd
Once it's compiled, there is now an executable called gtf0. Do the following,
./gtf0
There will now be a gtf0.png file.
One way to view the image is to go to the folder through file explorer where you put the image and view it from there.
Another way to view the image is to place it in your public web space using /bin/cp -f gtf0.png ~/public_html chmod 0644 ~/public_html/gtf0.png , then viewing in a web browser: https://lab46.g7n.org/~username/gtf0.png
https://www.quackit.com/css/color/charts/web_safe_color_chart.cfm
Find a color you like. In this case, we'll be using #33FFCC and will be calling it cyan.
Declare cyan as a variable:
int cyan =0;
Then we can allocate the value for the variable.
cyan =gdImageColorAllocate (image, 0x33, 0xFF, 0xCC);
The command to draw a filled in rectangle is as follows,
gdImageFilledRectangle (image, x, y, x2, y2, color);