User Tools

Site Tools


notes:c4eng:fall2024:projects:gtf0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:c4eng:fall2024:projects:gtf0 [2024/09/10 22:29] – [RUN THE PROGRAM] ehoad1notes:c4eng:fall2024:projects:gtf0 [2024/09/11 23:38] (current) – [DRAWING AN ELLIPSE] dnayo
Line 14: Line 14:
 In order to build the code you first need to follow the steps above labeled "grabit" in order to get the gtf0 project file into your repository. After retreiving the gtf0 project file, you should enter the file using the command "cd gtf0". This command will change where you are in your repository to the gtf0 project file. Then if you use the command "ls", you will see that there are two files inside of the gtf0 directory. The files are "Makefile" and "gtf0.c". The "gtf0.c" file is the file that contains the code in which you will be editing and changing in order to complete the project. In order to access the file and to edit the code you use the command "vim gtf0.c" or "nano gtf0.c" depending on which text editor you would like to edit inside of. In order to build the code you first need to follow the steps above labeled "grabit" in order to get the gtf0 project file into your repository. After retreiving the gtf0 project file, you should enter the file using the command "cd gtf0". This command will change where you are in your repository to the gtf0 project file. Then if you use the command "ls", you will see that there are two files inside of the gtf0 directory. The files are "Makefile" and "gtf0.c". The "gtf0.c" file is the file that contains the code in which you will be editing and changing in order to complete the project. In order to access the file and to edit the code you use the command "vim gtf0.c" or "nano gtf0.c" depending on which text editor you would like to edit inside of.
 =====RUN THE PROGRAM===== =====RUN THE PROGRAM=====
-In order to run the program we will run the command "make" while inside of the gtf0 directory. After using the make command use "./gtf0" and this command will create a png file for the gtf0.c code inside of the gtf0.c file which can then be moved and viewed.+In order to run the program we will run the command "make" while inside of the gtf0 directory. After using the "makecommand use "./gtf0" and this command will create a png file for the gtf0.c code inside of the gtf0.c file which can then be moved and viewed.
 =====VIEW THE IMAGE===== =====VIEW THE IMAGE=====
 <WRAP>in Lab46, ensure you are in the directory where you executed " **gtf0** ". Run the " **ls** " command, you should see " **gtf0.png** " in your current directory </WRAP> <WRAP>in Lab46, ensure you are in the directory where you executed " **gtf0** ". Run the " **ls** " command, you should see " **gtf0.png** " in your current directory </WRAP>
Line 28: Line 28:
 ====MIXING A COLOR==== ====MIXING A COLOR====
 ====DRAWING A LINE==== ====DRAWING A LINE====
 +Use Function "gdImageLine (image, starting-X, starting-Y, terminating-X, terminating-Y, color);"
  
 ====DRAWING A RECTANGLE==== ====DRAWING A RECTANGLE====
 +Use function "gdImageRectangle (image, top left-X, top left-Y, bottom right-X, bottom right-Y, outline color);"
 ====FILLING AN ENCLOSED SPACE==== ====FILLING AN ENCLOSED SPACE====
 +Use code, "gdImageFill (image, x-coordinate, y-coordinate, color to fill);"
 ====DRAWING A FILLED RECTANGLE==== ====DRAWING A FILLED RECTANGLE====
 +Use code, "gdImageFilledRectangle (image, x-coordinate, y-coordinate, final x-coordinate, final y-coordinate, color);"
 ====DRAWING A CIRCLE==== ====DRAWING A CIRCLE====
 +Use code, "gdImageArc (image, center x-coordinate, center y-coordinate, diameter x, diameter y, start angle, end angle, color of the outline);"
 ====DRAWING AN ELLIPSE==== ====DRAWING AN ELLIPSE====
 +Use code "gdImageArc (image, center x-coordinate, center y-coordinate, diameter x, diameter y, start angle, end angle, color);" (make sure the x and y diameters do not match - you WILL end up with a circle)
  
notes/c4eng/fall2024/projects/gtf0.1726007381.txt.gz · Last modified: 2024/09/10 22:29 by ehoad1