Solved

i need to know

Posted on 1998-10-17
6
163 Views
Last Modified: 2010-04-16
how to use graphics in pascal. im learn pascal in school and the text book doesnt mention anything nor does my teacher know how to create grpahics. please email me.
stupidguy23@hotmail.com
0
Comment
Question by:stupidguy23
  • 3
  • 2
6 Comments
 
LVL 5

Accepted Solution

by:
scrapdog earned 50 total points
ID: 1215800
You didn't specify which version of pascal, so I am going to assume Turbo Pascal.

Since you are learning, the best thing to use for now is turtle graphics, because there is no red tape.

include this line in the beginning of your program:

uses graph3, crt;


Here are some commands of interest to you:

GraphColorMode;      turns on graphics mode
TextMode(c80);       restores to text mode
Forwd(xxx);          moves turtle forward xxx pixels
Back(xxx);           moves turtle back xxx pixels
TurnLeft(xxx);
TurnRight(xxx);      turns turtle xxx degrees
PenUp;
PenDown;             picks up or puts down turtles pen
Home;                returns turtle to home position
SetPenColor(x);      sets color to x
HideTurtle;
ShowTurtle;          hides or shows turtle

Check the help file for the graph3 unit for more commands.  Put your cursor over the "graph3" in your source code and press ctrl-f1 to get to it.

Demo program that draws a square:

program demo;

uses graph3, crt;

begin
  GraphColorMode;
  PenUp;
  Home;
  SetPenColor(1);
  PenDown;
  Forwd(100);
  TurnRight(90);
  Forwd(100);
  TurnRight(90)
  Forwd(100);
  TurnRight(90);
  Forwd(100);
  readln;
  TextMode(c80);
end.
 

For more advanced info on graphics, this site might help you:

http://magic.hurrah.com/~sabre/graphpro/


scrappy
0
 
LVL 1

Expert Comment

by:FuzzyLogic
ID: 1215801
Scrappy, I think it will help SG23 more if you will give him some information about graph.tpu unit (InitGraph() and all that stuff).
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 1215802
I was considering doing that, but you can't dive right into it like you can with graph3.  I think graph3 is better for learning if you have never programmed graphics before.

Stupid:  If you are interested in using the graph.tpu unit, check it out in the help file.  There is more help on it than there is on graph3, but it is more technical.
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:stupidguy23
ID: 1215803
Its think pascal and im sure the macs we use i kinda old (5 or more years at least). i'll be back with a version of think and the model of the mac.
0
 

Author Comment

by:stupidguy23
ID: 1215804
and give me a url or site or something for more explainations and something to give my teacher for better understanding.
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 1215805
I assumed you were using Turbo Pascal.  If you are using Think, I can't help you out, because I never used it!!  That URL I gave you will be of some help to you, as it covers some generic graphics concepts.  How you would implement this in Think, I don't know.  However, if I stumble across a site for using graphics w/ Think I will post it here or e-mail you.

scrappy

0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Encryption of Passwords for Delphi Xe2 1 747
Get pixel color of a jpg in a TImage 1 2,696
detect keyboard input monitoring 3 393
delphi prevent click fast 2 238
If you are looking at this article, you have most likely been hit by some version of ransomware and are trying to find out if there is anything you can do, or what way you should react - READ ON!
There's a lot of hype surrounding blockchain technology. Here's how it works and some of the novel ways it' s now being used - including for data protection.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question