Category : Pascal Source Code
Archive   : PASS_ALL.ZIP
Filename : TI424.ASC

 
Output of file : TI424.ASC contained in archive : PASS_ALL.ZIP







PRODUCT : TURBO PASCAL NUMBER : 424
VERSION : 4.0
OS : MS-DOS, PC-DOS
DATE : APRIL 1, 1988 PAGE : 1/2

TITLE : MODIFYING THE ASPECT RATIO IN THE GRAPH UNIT




{****************************************************************
The .BGI files supplied with the Graph unit declare an Aspect
Ratio constant which is used to draw circles and arc segments.
For some applications it is necessary to alter the aspect ratio.
One such application results when trying to perform a screen dump
to the printer. In quad-density graphics printing, it is useful
to redefine the aspect ratio so the displayed results will be
circular instead of ellipsoid.

The following program demonstrates how a programmer can alter the
predefined Xasp element of the aspect ratio and to obtain the
current value. Note that the Graph unit already has the
procedure for GetAspectRatio.
****************************************************************}



program ChangeAspectRatio;

uses
Crt, Graph;

function GetAspectX : word;
{ Return the current aspect ratio element Xasp }
begin
GetAspectX := word(Ptr(Seg(GraphFreeMemPtr),
Ofs(GraphFreeMemPtr)+277)^);
end;

procedure SetAspectRatio(NewAspect : word);
{ Set the current aspect ratio element Xasp }
begin
word(Ptr(Seg(GraphFreeMemPtr),
Ofs(GraphFreeMemPtr)+277)^) := NewAspect;
end;

var
GraphDriver, GraphMode : integer;
Ch : char;
S : String;

begin
DirectVideo := false;













PRODUCT : TURBO PASCAL NUMBER : 424
VERSION : 4.0
OS : MS-DOS, PC-DOS
DATE : APRIL 1, 1988 PAGE : 2/2

TITLE : MODIFYING THE ASPECT RATIO IN THE GRAPH UNIT




GraphDriver := Detect;
InitGraph(GraphDriver, GraphMode, '');
Str(GetAspectX, S);
S := 'The initial aspect ratio was ' + S;
OutTextXY(1,1, S);
Circle((GetMaxX Div 2), (GetMaxY Div 4), (GetMaxY div 4));
SetAspectRatio(5000);
Circle((GetMaxX Div 2), 3*(GetMaxY Div 4), (GetMaxY div 4));
Str(GetAspectX, S);
S := 'Now the aspect ratio is ' + S;
OutTextXY(1,(GetMaxY - 10), S);
Ch := ReadKey;
CloseGraph;
end.





































  3 Responses to “Category : Pascal Source Code
Archive   : PASS_ALL.ZIP
Filename : TI424.ASC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/