?
Solved

Drawing with Pascal

Posted on 2003-03-12
4
Medium Priority
?
4,962 Views
Last Modified: 2010-10-05
Can someone tell me how to draw in pascal using Turbo Pascal For Windows 1.5???

Ive tried the following but it doesnt workwhat have I done wrong?

Program Rect;
Uses WinCrt, WinProcs, Wintypes, Strings;

Var
   dc         :Integer;
   i         :longint;

Begin
     dc:=GetActiveWindow;
     createsolidbrush(black_pen);
     createpen(ps_solid,1,black_pen);
     roundrect(dc,30,30,400,40,5,5);
     readkey;
End.

If you can help can you please give me the "Turbo Pascal For Windows" code as this is the program I must use.  I use freepascal and dev-pascal at home but this drawing function much work for TPW 1.5. as it is the one they use in school.

Thanks in advance
0
Comment
Question by:Pilo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Expert Comment

by:Beerkerel
ID: 8174060
You'll need the graph library...

Is long time ago for me, worked with dos but you need the BGI include...
0
 

Accepted Solution

by:
megamatrix earned 440 total points
ID: 8260732
if you have in your compiler , graph.tpu , it would be easier for you to draw in pascal , you have the luck , because i had worked in pascal during two year .

   all you have to do is only to know which instruction is uesd , for any problem for insrance , if you wanna make a circle
uses graph;
const center=40;
      ray=100;
var cd,modegraph : integer;
begin
{ init }
card:=cd;
initgraph(card, modegraph,'');      
circle(getmaxx div 2, getmaxy div 2, ray);
readln;
end.
 there many instructions like that , if you have any problem contact me in
megamatrix@engineer.com

and for windows you can use


uses graph;
var cd,modegraph : integer;
begin
{ init }
card:=cd;
initgraph(card, modegraph,'');      
bar(45,85,75,25);
readln;
end.
 good luck
0
 
LVL 7

Expert Comment

by:UrosVidojevic
ID: 8897501
This is example:

  procedure Init;
    var GraphDriver, GraphMode: Integer;
    begin
     GraphDriver := Detect;
     InitGraph(GraphDriver, GraphMode, 'c:/tp7/bgi');
     if GraphResult<> grOk then
      begin
       Halt(1);
       write('ERROR');
      end;

If your bgi files aren't in directory c:/tp7/bgi, then change
this string.  


0
 

Expert Comment

by:CleanupPing
ID: 9314363
Pilo:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Check out the latest tech news, community articles, and expert highlights in August's newsletter.
The Summer 2017 Scholarship Winners have been announced!
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

764 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