This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:cprog:spring2024:projects:gtf0 [2024/02/08 03:35] – [DRAWING AN ELLIPSE] hcopp1 | notes:cprog:spring2024:projects:gtf0 [2024/02/08 04:20] (current) – [VIEW THE IMAGE] hcopp1 | ||
---|---|---|---|
Line 8: | Line 8: | ||
=====REPOSITORY STEPS===== | =====REPOSITORY STEPS===== | ||
=====BUILD THE CODE===== | =====BUILD THE CODE===== | ||
+ | |||
+ | Edit the provided skeletal code from the grabit using a txt editor like nano. edit this code to fit the criteria for the project | ||
+ | |||
+ | | ||
+ | |||
+ | |||
=====RUN THE PROGRAM===== | =====RUN THE PROGRAM===== | ||
+ | |||
+ | To be able to run the gtf0.c file use the following command in the grabit file: | ||
+ | < | ||
+ | Issue the command '' | ||
+ | |||
+ | If you execute this command it should produce a .png image | ||
=====VIEW THE IMAGE===== | =====VIEW THE IMAGE===== | ||
+ | |||
+ | The image can either be viewed, if on a Pi, from the GUI file explorer | ||
+ | |||
+ | Or if in lab46: | ||
+ | 1. Copy the file to ~/ | ||
+ | |||
+ | < | ||
+ | |||
+ | 2. Change current directory to ~/ | ||
+ | |||
+ | < | ||
+ | |||
+ | 3. Change permissions to be able to be read by all | ||
+ | |||
+ | < | ||
+ | |||
+ | 4.view image from web browser | ||
+ | |||
+ | < | ||
=====LIBGD FUNCTIONALITY===== | =====LIBGD FUNCTIONALITY===== | ||
Line 19: | Line 50: | ||
< | < | ||
black = gdColorAllocate (image, 0x00, 0x00, 0x00);</ | black = gdColorAllocate (image, 0x00, 0x00, 0x00);</ | ||
+ | |||
+ | '' | ||
+ | |||
+ | so if <color # | ||
+ | |||
+ | and <color # | ||
+ | |||
+ | you will get <color # | ||
+ | |||
+ | |||
====DRAWING A LINE==== | ====DRAWING A LINE==== | ||
Line 57: | Line 98: | ||
< | < | ||
(could also be used for a circle) | (could also be used for a circle) | ||
+ | |||
Syntax for an Filled Ellipse | Syntax for an Filled Ellipse | ||
< | < |