Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Drawing with Pascal

Posted on 2003-03-12
4
Medium Priority
?
5,037 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
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

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

Conducting a customer service survey used to be as straightforward as sending a template email out using checkboxes and numerical rating systems to measure satisfaction.
Herein one will find an aggregate of some of my experience building and deploying virtualization stacks both in standalone, clustered Hyper-V, clustered Hyper-V with a Scale-Out File Server (SOFS) backend, and Storage Spaces Direct (S2D).
Integration Management Part 2
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month13 days, 22 hours left to enroll

581 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