graph.tex 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491
  1. %
  2. % $Id$
  3. % This file is part of the FPC documentation.
  4. % Copyright (C) 1997, by Michael Van Canneyt
  5. %
  6. % The FPC documentation is free text; you can redistribute it and/or
  7. % modify it under the terms of the GNU Library General Public License as
  8. % published by the Free Software Foundation; either version 2 of the
  9. % License, or (at your option) any later version.
  10. %
  11. % The FPC Documentation is distributed in the hope that it will be useful,
  12. % but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. % Library General Public License for more details.
  15. %
  16. % You should have received a copy of the GNU Library General Public
  17. % License along with the FPC documentation; see the file COPYING.LIB. If not,
  18. % write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19. % Boston, MA 02111-1307, USA.
  20. %
  21. % Documentation for the 'Graph' unit of Free Pascal.
  22. % Michael Van Canneyt, July 1997
  23. \chapter{The GRAPH unit.}
  24. \FPCexampledir{graphex}
  25. This document describes the \var{GRAPH} unit for Free Pascal, for all
  26. platforms. The unit was first written for \dos by Florian kl\"ampfl, but was
  27. later completely rewritten by Carl-Eric Codere to be completely portable.
  28. This chapter is divided in 4 sections.
  29. \begin{itemize}
  30. \item The first section gives an introduction to the graph unit.
  31. \item The second section lists the pre-defined constants, types and variables.
  32. \item The second section describes the functions which appear in the
  33. interface part of the \file{GRAPH} unit.
  34. \item The last part describes some system-specific issues.
  35. \end{itemize}
  36. \section{Introduction}
  37. \label{se:Introduction}
  38. \subsection{Requirements}
  39. The unit Graph exports functions and procedures for graphical output.
  40. It requires at least a VGA-compatible Card or a VGA-Card with software-driver
  41. (min. \textbf{512Kb} video memory).
  42. \subsection{A word about mode selection}
  43. The graph unit was implemented for compatibility with the old \tp graph
  44. unit. For this reason, the mode constants as they were defined in the
  45. \tp graph unit are retained.
  46. However, since
  47. \begin{enumerate}
  48. \item Video cards have evolved very much
  49. \item Free Pascal runs on multiple platforms
  50. \end{enumerate}
  51. it was decided to implement new mode and graphic driver constants,
  52. which are more independent of the specific platform the program runs on.
  53. In this section we give a short explanation of the new mode system. the
  54. following drivers were defined:
  55. \begin{verbatim}
  56. D1bit = 11;
  57. D2bit = 12;
  58. D4bit = 13;
  59. D6bit = 14; { 64 colors Half-brite mode - Amiga }
  60. D8bit = 15;
  61. D12bit = 16; { 4096 color modes HAM mode - Amiga }
  62. D15bit = 17;
  63. D16bit = 18;
  64. D24bit = 19; { not yet supported }
  65. D32bit = 20; { not yet supported }
  66. D64bit = 21; { not yet supported }
  67. lowNewDriver = 11;
  68. highNewDriver = 21;
  69. \end{verbatim}
  70. Each of these drivers specifies a desired color-depth.
  71. The following modes have been defined:
  72. \begin{verbatim}
  73. detectMode = 30000;
  74. m320x200 = 30001;
  75. m320x256 = 30002; { amiga resolution (PAL) }
  76. m320x400 = 30003; { amiga/atari resolution }
  77. m512x384 = 30004; { mac resolution }
  78. m640x200 = 30005; { vga resolution }
  79. m640x256 = 30006; { amiga resolution (PAL) }
  80. m640x350 = 30007; { vga resolution }
  81. m640x400 = 30008;
  82. m640x480 = 30009;
  83. m800x600 = 30010;
  84. m832x624 = 30011; { mac resolution }
  85. m1024x768 = 30012;
  86. m1280x1024 = 30013;
  87. m1600x1200 = 30014;
  88. m2048x1536 = 30015;
  89. lowNewMode = 30001;
  90. highNewMode = 30015;
  91. \end{verbatim}
  92. These modes start at 30000 because Borland specified that the mode number
  93. should be ascending with increasing X resolution, and the new constants
  94. shouldn't interfere with the old ones.
  95. The above constants can be used to set a certain color depth and resultion,
  96. as demonstrated in the following example:
  97. \FPCexample{inigraph1}
  98. If other modes than the ones above are supported by the graphics card,
  99. you will not be able to select them with this mechanism.
  100. For this reason, there is also a 'dynamic' mode number, which is assigned at
  101. run-time. This number increases with increasing X resolution. It can be
  102. queried with the \var{getmoderange} call. This call will return the range
  103. of modes which are valid for a certain graphics driver. The numbers are
  104. guaranteed to be consecutive, and can be used to search for a certain
  105. resolution, as in the following example:
  106. \FPCexample{inigraph2}
  107. Thus, the \var{getmoderange} function can be used to detect all available
  108. modes and drivers, as in the following example:
  109. \FPCexample{modrange}
  110. \section{Constants, Types and Variables}
  111. \subsection{Types}
  112. \begin{verbatim}
  113. ArcCoordsType = record
  114. X,Y,Xstart,Ystart,Xend,Yend : Integer;
  115. end;
  116. FillPatternType = Array [1..8] of Byte;
  117. FillSettingsType = Record
  118. Pattern,Color : Word
  119. end;
  120. LineSettingsType = Record
  121. LineStyle,Pattern, Width : Word;
  122. end;
  123. PaletteType = Record
  124. Size : Byte;
  125. Colors : array[0..MAxColor] of shortint;
  126. end;
  127. PointType = Record
  128. X,Y : Integer;
  129. end;
  130. TextSettingsType = Record
  131. Font,Direction, CharSize, Horiz, Vert : Word
  132. end;
  133. ViewPortType = Record
  134. X1,Y1,X2,Y2 : Integer;
  135. Clip : Boolean
  136. end;
  137. \end{verbatim}
  138. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  139. % Functions and procedures by category
  140. \section{Function list by category}
  141. What follows is a listing of the available functions, grouped by category.
  142. For each function there is a reference to the page where you can find the
  143. function.
  144. \subsection{Initialization}
  145. Initialization of the graphics screen.
  146. \begin{funclist}
  147. \procref{ClearDevice}{Empty the graphics screen}
  148. \procref{CloseGraph}{Finish drawing session, return to text mode}
  149. \procref{DetectGraph}{Detect graphical modes}
  150. \procref{GetAspectRatio}{Get aspect ratio of screen}
  151. \procref{GetModeRange}{Get range of valid modes for current driver}
  152. \procref{GraphDefaults}{Set defaults}
  153. \funcref{GetDriverName}{Return name of graphical driver}
  154. \funcref{GetGraphMode}{Return current or last used graphics mode}
  155. \funcref{GetMaxMode}{Get maximum mode for current driver}
  156. \funcref{GetModeName}{Get name of current mode}
  157. \funcref{GraphErrorMsg}{String representation of graphical error}
  158. \funcref{GraphResult}{Result of last drawing operation}
  159. \procref{InitGraph}{Initialize graphics drivers}
  160. \funcref{InstallUserDriver}{Install a new driver}
  161. \funcref{RegisterBGIDriver}{Register a new driver}
  162. \procref{RestoreCRTMode}{Go back to text mode}
  163. \procref{SetGraphBufSize}{Set buffer size for graphical operations}
  164. \procref{SetGraphMode}{Set graphical mode}
  165. \end{funclist}
  166. \subsection{screen management}
  167. General drawing screen management functions.
  168. \begin{funclist}
  169. \procref{ClearViewPort}{Clear the current viewport}
  170. \procref{GetImage}{Copy image from screen to memory}
  171. \funcref{GetMaxX}{Get maximum X coordinate}
  172. \funcref{GetMaxY}{Get maximum Y coordinate}
  173. \funcref{GetX}{Get current X position}
  174. \funcref{GetY}{Get current Y position}
  175. \funcref{ImageSize}{Get size of selected image}
  176. \procref{GetViewSettings}{Get current viewport settings}
  177. \procref{PutImage}{Copy image from memory to screen}
  178. \procref{SetActivePage}{Set active video page}
  179. \procref{SetAspectRatio}{Set aspect ratio for drawing routines}
  180. \procref{SetViewPort}{Set current viewport}
  181. \procref{SetVisualPage}{Set visual page}
  182. \procref{SetWriteMode}{Set write mode for screen operations}
  183. \end{funclist}
  184. \subsection{Color management}
  185. All functions related to color management.
  186. \begin{funclist}
  187. \funcref{GetBkColor}{Get current background color}
  188. \funcref{GetColor}{Get current foreground color}
  189. \procref{GetDefaultPalette}{Get default palette entries}
  190. \funcref{GetMaxColor}{Get maximum valid color}
  191. \funcref{GetPaletteSize}{Get size of palette for current mode}
  192. \funcref{GetPixel}{Get color of selected pixel}
  193. \procref{GetPalette}{Get palette entry}
  194. \procref{SetAllPallette}{Set all colors in palette}
  195. \procref{SetBkColor}{Set background color}
  196. \procref{SetColor}{Set foreground color}
  197. \procref{SetPalette}{Set palette entry}
  198. \procref{SetRGBPalette}{Set palette entry with RGB values}
  199. \end{funclist}
  200. \subsection{Drawing primitives}
  201. Functions for simple drawing.
  202. \begin{funclist}
  203. \procref{Arc}{Draw an arc}
  204. \procref{Circle}{Draw a complete circle}
  205. \procref{DrawPoly}{Draw a polygone with N points}
  206. \procref{Ellipse}{Draw an ellipse}
  207. \procref{GetArcCoords}{Get arc coordinates}
  208. \procref{GetLineSettings}{Get current line drawing settings}
  209. \procref{Line}{Draw line between 2 points}
  210. \procref{LineRel}{Draw line relative to current position}
  211. \procref{LineTo}{Draw line from current position to absolute position}
  212. \procref{MoveRel}{Move cursor relative to current position}
  213. \procref{MoveTo}{Move cursor to absolute position}
  214. \procref{PieSlice}{Draw a pie slice}
  215. \procref{PutPixel}{Draw 1 pixel}
  216. \procref{Rectangle}{Draw a non-filled rectangle}
  217. \procref{Sector}{Draw a sector}
  218. \procref{SetLineStyle}{Set current line drawing style}
  219. \end{funclist}
  220. \subsection{Filled drawings}
  221. Functions for drawing filled regions.
  222. \begin{funclist}
  223. \procref{Bar3D}{Draw a filled 3D-style bar}
  224. \procref{Bar}{Draw a filled rectangle}
  225. \procref{FloodFill}{Fill starting from coordinate}
  226. \procref{FillEllipse}{Draw a filled ellipse}
  227. \procref{FillPoly}{Draw a filled polygone}
  228. \procref{GetFillPattern}{Get current fill pattern}
  229. \procref{GetFillSettings}{Get current fill settings}
  230. \procref{SetFillPattern}{Set current fill pattern}
  231. \procref{SetFillStyle}{Set current fill settings}
  232. \end{funclist}
  233. \subsection{Text and font handling}
  234. Functions to set texts on the screen.
  235. \begin{funclist}
  236. \procref{GetTextSettings}{Get current text settings}
  237. \funcref{InstallUserFont}{Install a new font}
  238. \procref{OutText}{Write text at current cursor position}
  239. \procref{OutTextXY}{Write text at coordinates X,Y}
  240. \funcref{RegisterBGIFont}{Register a new font}
  241. \procref{SetTextJustify}{Set text justification}
  242. \procref{SetTextStyle}{Set text style}
  243. \procref{SetUserCharSize}{Set text size}
  244. \funcref{TextHeight}{Calculate height of text}
  245. \funcref{TextWidth}{Calculate width of text}
  246. \end{funclist}
  247. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  248. % Functions and procedures
  249. \section{Functions and procedures}
  250. \begin{procedure}{Arc}
  251. \Declaration
  252. Procedure Arc (X,Y : Integer; start,stop, radius : Word);
  253. \Description
  254. \var{Arc} draws part of a circle with center at \var{(X,Y)}, radius
  255. \var{radius}, starting from angle \var{start}, stopping at angle \var{stop}.
  256. These angles are measured
  257. counterclockwise.
  258. \Errors
  259. None.
  260. \SeeAlso
  261. \seep{Circle},\seep{Ellipse}
  262. \seep{GetArcCoords},\seep{PieSlice}, \seep{Sector}
  263. \end{procedure}
  264. \begin{procedure}{Bar}
  265. \Declaration
  266. Procedure Bar (X1,Y1,X2,Y2 : Integer);
  267. \Description
  268. Draws a rectangle with corners at \var{(X1,Y1)} and \var{(X2,Y2)}
  269. and fills it with the current color and fill-style.
  270. \Errors
  271. None.
  272. \SeeAlso
  273. \seep{Bar3D},
  274. \seep{Rectangle}
  275. \end{procedure}
  276. \begin{procedure}{Bar3D}
  277. \Declaration
  278. Procedure Bar3D (X1,Y1,X2,Y2 : Integer; depth : Word; Top : Boolean);
  279. \Description
  280. Draws a 3-dimensional Bar with corners at \var{(X1,Y1)} and \var{(X2,Y2)}
  281. and fills it with the current color and fill-style.
  282. \var{Depth} specifies the number of pixels used to show the depth of the
  283. bar.
  284. If \var{Top} is true; then a 3-dimensional top is drawn.
  285. \Errors
  286. None.
  287. \SeeAlso
  288. \seep{Bar}, \seep{Rectangle}
  289. \end{procedure}
  290. \begin{procedure}{Circle}
  291. \Declaration
  292. Procedure Circle (X,Y : Integer; Radius : Word);
  293. \Description
  294. \var{Circle} draws part of a circle with center at \var{(X,Y)}, radius
  295. \var{radius}.
  296. \Errors
  297. None.
  298. \SeeAlso
  299. \seep{Ellipse},\seep{Arc}
  300. \seep{GetArcCoords},\seep{PieSlice}, \seep{Sector}
  301. \end{procedure}
  302. \begin{procedure}{ClearDevice}
  303. \Declaration
  304. Procedure ClearDevice ;
  305. \Description
  306. Clears the graphical screen (with the current
  307. background color), and sets the pointer at \var{(0,0)}
  308. \Errors
  309. None.
  310. \SeeAlso
  311. \seep{ClearViewPort}, \seep{SetBkColor}
  312. \end{procedure}
  313. \begin{procedure}{ClearViewPort}
  314. \Declaration
  315. Procedure ClearViewPort ;
  316. \Description
  317. Clears the current viewport. The current background color is used as filling
  318. color. The pointer is set at
  319. \var{(0,0)}
  320. \Errors
  321. None.
  322. \SeeAlso
  323. \seep{ClearDevice},\seep{SetViewPort}, \seep{SetBkColor}
  324. \end{procedure}
  325. \begin{procedure}{CloseGraph}
  326. \Declaration
  327. Procedure CloseGraph ;
  328. \Description
  329. Closes the graphical system, and restores the
  330. screen modus which was active before the graphical modus was
  331. activated.
  332. \Errors
  333. None.
  334. \SeeAlso
  335. \seep{InitGraph}
  336. \end{procedure}
  337. \begin{procedure}{DetectGraph}
  338. \Declaration
  339. Procedure DetectGraph (Var Driver, Modus : Integer);
  340. \Description
  341. Checks the hardware in the PC and determines the driver and screen-modus to
  342. be used. These are returned in \var{Driver} and \var{Modus}, and can be fed
  343. to \var{InitGraph}.
  344. See the \var{InitGraph} for a list of drivers and modi.
  345. \Errors
  346. None.
  347. \SeeAlso
  348. \seep{InitGraph}
  349. \end{procedure}
  350. \begin{procedure}{DrawPoly}
  351. \Declaration
  352. Procedure DrawPoly (NumberOfPoints : Word; Var PolyPoints;
  353. \Description
  354. Draws a polygone with \var{NumberOfPoints} corner points, using the
  355. current color and line-style. PolyPoints is an array of type \var{PointType}.
  356. \Errors
  357. None.
  358. \SeeAlso
  359. \seep{Bar}, seep{Bar3D}, \seep{Rectangle}
  360. \end{procedure}
  361. \begin{procedure}{Ellipse}
  362. \Declaration
  363. Procedure Ellipse (X,Y : Integer; Start,Stop,XRadius,YRadius : Word);
  364. \Description
  365. \var{Ellipse} draws part of an ellipse with center at \var{(X,Y)}.
  366. \var{XRadius} and \var{Yradius} are the horizontal and vertical radii of the
  367. ellipse. \var{Start} and \var{Stop} are the starting and stopping angles of
  368. the part of the ellipse. They are measured counterclockwise from the X-axis
  369. (3 o'clock is equal to 0 degrees). Only positive angles can be specified.
  370. \Errors
  371. None.
  372. \SeeAlso
  373. \seep{Arc} \seep{Circle}, \seep{FillEllipse}
  374. \end{procedure}
  375. \begin{procedure}{FillEllipse}
  376. \Declaration
  377. Procedure FillEllipse (X,Y : Integer; Xradius,YRadius: Word);
  378. \Description
  379. \var{Ellipse} draws an ellipse with center at \var{(X,Y)}.
  380. \var{XRadius} and \var{Yradius} are the horizontal and vertical radii of the
  381. ellipse. The ellipse is filled with the current color and fill-style.
  382. \Errors
  383. None.
  384. \SeeAlso
  385. \seep{Arc} \seep{Circle},
  386. \seep{GetArcCoords},\seep{PieSlice}, \seep{Sector}
  387. \end{procedure}
  388. \begin{procedure}{FillPoly}
  389. \Declaration
  390. Procedure FillPoly (NumberOfPoints : Word; Var PolyPoints);
  391. \Description
  392. Draws a polygone with \var{NumberOfPoints} corner points and fills it
  393. using the current color and line-style.
  394. PolyPoints is an array of type \var{PointType}.
  395. \Errors
  396. None.
  397. \SeeAlso
  398. \seep{Bar}, seep{Bar3D}, \seep{Rectangle}
  399. \end{procedure}
  400. \begin{procedure}{FloodFill}
  401. \Declaration
  402. Procedure FloodFill (X,Y : Integer; BorderColor : Word);
  403. \Description
  404. Fills the area containing the point \var{(X,Y)}, bounded by the color
  405. \var{BorderColor}.
  406. \Errors
  407. None
  408. \SeeAlso
  409. \seep{SetColor}, \seep{SetBkColor}
  410. \end{procedure}
  411. \begin{procedure}{GetArcCoords}
  412. \Declaration
  413. Procedure GetArcCoords (Var ArcCoords : ArcCoordsType);
  414. \Description
  415. \var{GetArcCoords} returns the coordinates of the latest \var{Arc} or
  416. \var{Ellipse} call.
  417. \Errors
  418. None.
  419. \SeeAlso
  420. \seep{Arc}, \seep{Ellipse}
  421. \end{procedure}
  422. \begin{procedure}{GetAspectRatio}
  423. \Declaration
  424. Procedure GetAspectRatio (Var Xasp,Yasp : Word);
  425. \Description
  426. \var{GetAspectRatio} determines the effective resolution of the screen. The aspect ration can
  427. the be calculated as \var{Xasp/Yasp}.
  428. \Errors
  429. None.
  430. \SeeAlso
  431. \seep{InitGraph},\seep{SetAspectRatio}
  432. \end{procedure}
  433. \begin{function}{GetBkColor}
  434. \Declaration
  435. Function GetBkColor : Word;
  436. \Description
  437. \var{GetBkColor} returns the current background color (the palette
  438. entry).
  439. \Errors
  440. None.
  441. \SeeAlso
  442. \seef{GetColor},\seep{SetBkColor}
  443. \end{function}
  444. \begin{function}{GetColor}
  445. \Declaration
  446. Function GetColor : Word;
  447. \Description
  448. \var{GetColor} returns the current drawing color (the palette
  449. entry).
  450. \Errors
  451. None.
  452. \SeeAlso
  453. \seef{GetColor},\seep{SetBkColor}
  454. \end{function}
  455. \begin{procedure}{GetDefaultPalette}
  456. \Declaration
  457. Procedure GetDefaultPalette (Var Palette : PaletteType);
  458. \Description
  459. Returns the
  460. current palette in \var{Palette}.
  461. \Errors
  462. None.
  463. \SeeAlso
  464. \seef{GetColor}, \seef{GetBkColor}
  465. \end{procedure}
  466. \begin{function}{GetDriverName}
  467. \Declaration
  468. Function GetDriverName : String;
  469. \Description
  470. \var{GetDriverName} returns a string containing the name of the
  471. current driver.
  472. \Errors
  473. None.
  474. \SeeAlso
  475. \seef{GetModeName}, \seep{InitGraph}
  476. \end{function}
  477. \begin{procedure}{GetFillPattern}
  478. \Declaration
  479. Procedure GetFillPattern (Var FillPattern : FillPatternType);
  480. \Description
  481. \var{GetFillPattern} returns an array with the current fill-pattern in \var{FillPattern}
  482. \Errors
  483. None
  484. \SeeAlso
  485. \seep{SetFillPattern}
  486. \end{procedure}
  487. \begin{procedure}{GetFillSettings}
  488. \Declaration
  489. Procedure GetFillSettings (Var FillInfo : FillSettingsType);
  490. \Description
  491. \var{GetFillSettings} returns the current fill-settings in
  492. \var{FillInfo}
  493. \Errors
  494. None.
  495. \SeeAlso
  496. \seep{SetFillPattern}
  497. \end{procedure}
  498. \begin{function}{GetGraphMode}
  499. \Declaration
  500. Function GetGraphMode : Integer;
  501. \Description
  502. \var{GetGraphMode} returns the current graphical modus
  503. \Errors
  504. None.
  505. \SeeAlso
  506. \seep{InitGraph}
  507. \end{function}
  508. \begin{procedure}{GetImage}
  509. \Declaration
  510. Procedure GetImage (X1,Y1,X2,Y2 : Integer, Var Bitmap;
  511. \Description
  512. \var{GetImage}
  513. Places a copy of the screen area \var{(X1,Y1)} to \var{X2,Y2} in \var{BitMap}
  514. \Errors
  515. Bitmap must have enough room to contain the image.
  516. \SeeAlso
  517. \seef{ImageSize},
  518. \seep{PutImage}
  519. \end{procedure}
  520. \begin{procedure}{GetLineSettings}
  521. \Declaration
  522. Procedure GetLineSettings (Var LineInfo : LineSettingsType);
  523. \Description
  524. \var{GetLineSettings} returns the current Line settings in
  525. \var{LineInfo}
  526. \Errors
  527. None.
  528. \SeeAlso
  529. \seep{SetLineStyle}
  530. \end{procedure}
  531. \begin{function}{GetMaxColor}
  532. \Declaration
  533. Function GetMaxColor : Word;
  534. \Description
  535. \var{GetMaxColor} returns the maximum color-number which can be
  536. set with \var{SetColor}. Contrary to \tp, this color isn't always
  537. guaranteed to be white (for instance in 256+ color modes).
  538. \Errors
  539. None.
  540. \SeeAlso
  541. \seep{SetColor},
  542. \seef{GetPaletteSize}
  543. \end{function}
  544. \begin{function}{GetMaxMode}
  545. \Declaration
  546. Function GetMaxMode : Word;
  547. \Description
  548. \var{GetMaxMode} returns the highest modus for
  549. the current driver.
  550. \Errors
  551. None.
  552. \SeeAlso
  553. \seep{InitGraph}
  554. \end{function}
  555. \begin{function}{GetMaxX}
  556. \Declaration
  557. Function GetMaxX : Word;
  558. \Description
  559. \var{GetMaxX} returns the maximum horizontal screen
  560. length
  561. \Errors
  562. None.
  563. \SeeAlso
  564. \seef{GetMaxY}
  565. \end{function}
  566. \begin{function}{GetMaxY}
  567. \Declaration
  568. Function GetMaxY : Word;
  569. \Description
  570. \var{GetMaxY} returns the maximum number of screen
  571. lines
  572. \Errors
  573. None.
  574. \SeeAlso
  575. \seef{GetMaxY}
  576. \end{function}
  577. \begin{function}{GetModeName}
  578. \Declaration
  579. Function GetModeName (Var modus : Integer) : String;
  580. \Description
  581. Returns a string with the name of modus
  582. \var{Modus}
  583. \Errors
  584. None.
  585. \SeeAlso
  586. \seef{GetDriverName}, \seep{InitGraph}
  587. \end{function}
  588. \begin{procedure}{GetModeRange}
  589. \Declaration
  590. Procedure GetModeRange (Driver : Integer; \\ LoModus, HiModus: Integer);
  591. \Description
  592. \var{GetModeRange} returns the Lowest and Highest modus of the currently
  593. installed driver. If no modes are supported for this driver, HiModus
  594. will be -1.
  595. \Errors
  596. None.
  597. \SeeAlso
  598. \seep{InitGraph}
  599. \end{procedure}
  600. \begin{procedure}{GetPalette}
  601. \Declaration
  602. Procedure GetPalette (Var Palette : PaletteType);
  603. \Description
  604. \var{GetPalette} returns in \var{Palette} the current palette.
  605. \Errors
  606. None.
  607. \SeeAlso
  608. \seef{GetPaletteSize}, \seep{SetPalette}
  609. \end{procedure}
  610. \begin{function}{GetPaletteSize}
  611. \Declaration
  612. Function GetPaletteSize : Word;
  613. \Description
  614. \var{GetPaletteSize} returns the maximum
  615. number of entries in the current palette.
  616. \Errors
  617. None.
  618. \SeeAlso
  619. \seep{GetPalette},
  620. \seep{SetPalette}
  621. \end{function}
  622. \begin{function}{GetPixel}
  623. \Declaration
  624. Function GetPixel (X,Y : Integer) : Word;
  625. \Description
  626. \var{GetPixel} returns the color
  627. of the point at \var{(X,Y)}
  628. \Errors
  629. None.
  630. \SeeAlso
  631. \end{function}
  632. \begin{procedure}{GetTextSettings}
  633. \Declaration
  634. Procedure GetTextSettings (Var TextInfo : TextSettingsType);
  635. \Description
  636. \var{GetTextSettings} returns the current text style settings : The font,
  637. direction, size and placement as set with \var{SetTextStyle} and
  638. \var{SetTextJustify}
  639. \Errors
  640. None.
  641. \SeeAlso
  642. \seep{SetTextStyle}, \seep{SetTextJustify}
  643. \end{procedure}
  644. \begin{procedure}{GetViewSettings}
  645. \Declaration
  646. Procedure GetViewSettings (Var ViewPort : ViewPortType);
  647. \Description
  648. \var{GetViewSettings} returns the current viewport and clipping settings in
  649. \var{ViewPort}.
  650. \Errors
  651. None.
  652. \SeeAlso
  653. \seep{SetViewPort}
  654. \end{procedure}
  655. \begin{function}{GetX}
  656. \Declaration
  657. Function GetX : Integer;
  658. \Description
  659. \var{GetX} returns the X-coordinate of the current position of
  660. the graphical pointer
  661. \Errors
  662. None.
  663. \SeeAlso
  664. \seef{GetY}
  665. \end{function}
  666. \begin{function}{GetY}
  667. \Declaration
  668. Function GetY : Integer;
  669. \Description
  670. \var{GetY} returns the Y-coordinate of the current position of
  671. the graphical pointer
  672. \Errors
  673. None.
  674. \SeeAlso
  675. \seef{GetX}
  676. \end{function}
  677. \begin{procedure}{GraphDefaults}
  678. \Declaration
  679. Procedure GraphDefaults ;
  680. \Description
  681. \var{GraphDefaults} resets all settings for viewport, palette,
  682. foreground and background pattern, line-style and pattern, filling style,
  683. filling color and pattern, font, text-placement and
  684. text size.
  685. \Errors
  686. None.
  687. \SeeAlso
  688. \seep{SetViewPort}, \seep{SetFillStyle}, \seep{SetColor},
  689. \seep{SetBkColor}, \seep{SetLineStyle}
  690. \end{procedure}
  691. \begin{function}{GraphErrorMsg}
  692. \Declaration
  693. Function GraphErrorMsg (ErrorCode : Integer) : String;
  694. \Description
  695. \var{GraphErrorMsg}
  696. returns a string describing the error \var{Errorcode}. This string can be
  697. used to let the user know what went wrong.
  698. \Errors
  699. None.
  700. \SeeAlso
  701. \seef{GraphResult}
  702. \end{function}
  703. \begin{function}{GraphResult}
  704. \Declaration
  705. Function GraphResult : Integer;
  706. \Description
  707. \var{GraphResult} returns an error-code for
  708. the last graphical operation. If the returned value is zero, all went well.
  709. A value different from zero means an error has occurred.
  710. besides all operations which draw something on the screen,
  711. the following procedures also can produce a \var{GraphResult} different from
  712. zero:
  713. \begin{itemize}
  714. \item \seef{InstallUserFont}
  715. \item \seep{SetLineStyle}
  716. \item \seep{SetWriteMode}
  717. \item \seep{SetFillStyle}
  718. \item \seep{SetTextJustify}
  719. \item \seep{SetGraphMode}
  720. \item \seep{SetTextStyle}
  721. \end{itemize}
  722. \Errors
  723. None.
  724. \SeeAlso
  725. \seef{GraphErrorMsg}
  726. \end{function}
  727. \begin{function}{ImageSize}
  728. \Declaration
  729. Function ImageSize (X1,Y1,X2,Y2 : Integer) : Word;
  730. \Description
  731. \var{ImageSize} returns
  732. the number of bytes needed to store the image in the rectangle defined by
  733. \var{(X1,Y1)} and \var{(X2,Y2)}.
  734. \Errors
  735. None.
  736. \SeeAlso
  737. \seep{GetImage}
  738. \end{function}
  739. \begin{procedure}{InitGraph}
  740. \Declaration
  741. Procedure InitGraph (var GraphDriver,GraphModus : integer;\\
  742. const PathToDriver : string);
  743. \Description
  744. \var{InitGraph} initializes the \var{graph} package.
  745. \var{GraphDriver} has two valid values: \var{GraphDriver=0} which
  746. performs an auto detect and initializes the highest possible mode with the most
  747. colors. 1024x768x64K is the highest possible resolution supported by the
  748. driver, if you need a higher resolution, you must edit \file{MODES.PPI}.
  749. If you need another mode, then set \var{GraphDriver} to a value different
  750. from zero
  751. and \var{graphmode} to the mode you wish (VESA modes where 640x480x256
  752. is \var {101h} etc.).
  753. \var{PathToDriver} is only needed, if you use the BGI fonts from
  754. Borland.
  755. \Errors
  756. None.
  757. \SeeAlso
  758. Introduction, (page \pageref{se:Introduction}),
  759. \seep{DetectGraph}, \seep{CloseGraph}, \seef{GraphResult}
  760. \end{procedure}
  761. Example:
  762. \begin{verbatim}
  763. var
  764. gd,gm : integer;
  765. PathToDriver : string;
  766. begin
  767. gd:=detect; { highest possible resolution }
  768. gm:=0; { not needed, auto detection }
  769. PathToDriver:='C:\PP\BGI'; { path to BGI fonts,
  770. drivers aren't needed }
  771. InitGraph(gd,gm,PathToDriver);
  772. if GraphResult<>grok then
  773. halt; ..... { whatever you need }
  774. CloseGraph; { restores the old graphics mode }
  775. end.
  776. \end{verbatim}
  777. \begin{function}{InstallUserDriver}
  778. \Declaration
  779. Function InstallUserDriver (DriverPath : String; \\AutoDetectPtr: Pointer) : Integer;
  780. \Description
  781. \var{InstallUserDriver}
  782. adds the device-driver \var{DriverPath} to the list of .BGI
  783. drivers. \var{AutoDetectPtr} is a pointer to a possible auto-detect function.
  784. \Errors
  785. None.
  786. \SeeAlso
  787. \seep{InitGraph}, \seef{InstallUserFont}
  788. \end{function}
  789. \begin{function}{InstallUserFont}
  790. \Declaration
  791. Function InstallUserFont (FontPath : String) : Integer;
  792. \Description
  793. \var{InstallUserFont} adds the font in \var{FontPath} to the list of fonts
  794. of the .BGI system.
  795. \Errors
  796. None.
  797. \SeeAlso
  798. \seep{InitGraph}, \seef{InstallUserDriver}
  799. \end{function}
  800. \begin{procedure}{Line}
  801. \Declaration
  802. Procedure Line (X1,Y1,X2,Y2 : Integer);
  803. \Description
  804. \var{Line} draws a line starting from
  805. \var{(X1,Y1} to \var{(X2,Y2)}, in the current line style and color. The
  806. current position is put to \var{(X2,Y2)}
  807. \Errors
  808. None.
  809. \SeeAlso
  810. \seep{LineRel},\seep{LineTo}
  811. \end{procedure}
  812. \begin{procedure}{LineRel}
  813. \Declaration
  814. Procedure LineRel (DX,DY : Integer);
  815. \Description
  816. \var{LineRel} draws a line starting from
  817. the current pointer position to the point\var{(DX,DY}, \textbf{relative} to the
  818. current position, in the current line style and color. The Current Position
  819. is set to the endpoint of the line.
  820. \Errors
  821. None.
  822. \SeeAlso
  823. \seep{Line}, \seep{LineTo}
  824. \end{procedure}
  825. \begin{procedure}{LineTo}
  826. \Declaration
  827. Procedure LineTo (DX,DY : Integer);
  828. \Description
  829. \var{LineTo} draws a line starting from
  830. the current pointer position to the point\var{(DX,DY}, \textbf{relative} to the
  831. current position, in the current line style and color. The Current position
  832. is set to the end of the line.
  833. \Errors
  834. None.
  835. \SeeAlso
  836. \seep{LineRel},\seep{Line}
  837. \end{procedure}
  838. \begin{procedure}{MoveRel}
  839. \Declaration
  840. Procedure MoveRel (DX,DY : Integer;
  841. \Description
  842. \var{MoveRel} moves the pointer to the
  843. point \var{(DX,DY)}, relative to the current pointer
  844. position
  845. \Errors
  846. None.
  847. \SeeAlso
  848. \seep{MoveTo}
  849. \end{procedure}
  850. \begin{procedure}{MoveTo}
  851. \Declaration
  852. Procedure MoveTo (X,Y : Integer;
  853. \Description
  854. \var{MoveTo} moves the pointer to the
  855. point \var{(X,Y)}.
  856. \Errors
  857. None.
  858. \SeeAlso
  859. \seep{MoveRel}
  860. \end{procedure}
  861. \begin{procedure}{OutText}
  862. \Declaration
  863. Procedure OutText (Const TextString : String);
  864. \Description
  865. \var{OutText} puts \var{TextString} on the screen, at the current pointer
  866. position, using the current font and text settings. The current position is
  867. moved to the end of the text.
  868. \Errors
  869. None.
  870. \SeeAlso
  871. \seep{OutTextXY}
  872. \end{procedure}
  873. \begin{procedure}{OutTextXY}
  874. \Declaration
  875. Procedure OutTextXY (X,Y : Integer; Const TextString : String);
  876. \Description
  877. \var{OutText} puts \var{TextString} on the screen, at position \var{(X,Y)},
  878. using the current font and text settings. The current position is
  879. moved to the end of the text.
  880. \Errors
  881. None.
  882. \SeeAlso
  883. \seep{OutText}
  884. \end{procedure}
  885. \begin{procedure}{PieSlice}
  886. \Declaration
  887. Procedure PieSlice (X,Y : Integer; \\ Start,Stop,Radius : Word);
  888. \Description
  889. \var{PieSlice}
  890. draws and fills a sector of a circle with center \var{(X,Y)} and radius
  891. \var{Radius}, starting at angle \var{Start} and ending at angle \var{Stop}.
  892. \Errors
  893. None.
  894. \SeeAlso
  895. \seep{Arc}, \seep{Circle}, \seep{Sector}
  896. \end{procedure}
  897. \begin{procedure}{PutImage}
  898. \Declaration
  899. Procedure PutImage (X1,Y1 : Integer; Var Bitmap; How : word) ;
  900. \Description
  901. \var{PutImage}
  902. Places the bitmap in \var{Bitmap} on the screen at \var{(X1,Y1)}. \var{How}
  903. determines how the bitmap will be placed on the screen. Possible values are :
  904. \begin{itemize}
  905. \item CopyPut
  906. \item XORPut
  907. \item ORPut
  908. \item AndPut
  909. \item NotPut
  910. \end{itemize}
  911. \Errors
  912. None
  913. \SeeAlso
  914. \seef{ImageSize},\seep{GetImage}
  915. \end{procedure}
  916. \begin{procedure}{PutPixel}
  917. \Declaration
  918. Procedure PutPixel (X,Y : Integer; Color : Word);
  919. \Description
  920. Puts a point at
  921. \var{(X,Y)} using color \var{Color}
  922. \Errors
  923. None.
  924. \SeeAlso
  925. \seef{GetPixel}
  926. \end{procedure}
  927. \begin{procedure}{Rectangle}
  928. \Declaration
  929. Procedure Rectangle (X1,Y1,X2,Y2 : Integer);
  930. \Description
  931. Draws a rectangle with
  932. corners at \var{(X1,Y1)} and \var{(X2,Y2)}, using the current color and
  933. style.
  934. \Errors
  935. None.
  936. \SeeAlso
  937. \seep{Bar}, \seep{Bar3D}
  938. \end{procedure}
  939. \begin{function}{RegisterBGIDriver}
  940. \Declaration
  941. Function RegisterBGIDriver (Driver : Pointer) : Integer;
  942. \Description
  943. Registers a user-defined BGI driver
  944. \Errors
  945. None.
  946. \SeeAlso
  947. \seef{InstallUserDriver},
  948. \seef{RegisterBGIFont}
  949. \end{function}
  950. \begin{function}{RegisterBGIFont}
  951. \Declaration
  952. Function RegisterBGIFont (Font : Pointer) : Integer;
  953. \Description
  954. Registers a user-defined BGI driver
  955. \Errors
  956. None.
  957. \SeeAlso
  958. \seef{InstallUserFont},
  959. \seef{RegisterBGIDriver}
  960. \end{function}
  961. \begin{procedure}{RestoreCRTMode}
  962. \Declaration
  963. Procedure RestoreCRTMode ;
  964. \Description
  965. Restores the screen modus which was active before
  966. the graphical modus was started.
  967. To get back to the graph mode you were last in, you can use
  968. \var{SetGraphMode(GetGraphMode)}
  969. \Errors
  970. None.
  971. \SeeAlso
  972. \seep{InitGraph}
  973. \end{procedure}
  974. \begin{procedure}{Sector}
  975. \Declaration
  976. Procedure Sector (X,Y : Integer; \\ Start,Stop,XRadius,YRadius : Word);
  977. \Description
  978. \var{Sector}
  979. draws and fills a sector of an ellipse with center \var{(X,Y)} and radii
  980. \var{XRadius} and \var{YRadius}, starting at angle \var{Start} and ending at angle \var{Stop}.
  981. \Errors
  982. None.
  983. \SeeAlso
  984. \seep{Arc}, \seep{Circle}, \seep{PieSlice}
  985. \end{procedure}
  986. \begin{procedure}{SetActivePage}
  987. \Declaration
  988. Procedure SetActivePage (Page : Word);
  989. \Description
  990. Sets \var{Page} as the active page
  991. for all graphical output.
  992. \Errors
  993. None.
  994. \SeeAlso
  995. \end{procedure}
  996. \begin{procedure}{SetAllPallette}
  997. \Declaration
  998. Procedure SetAllPallette (Var Palette);
  999. \Description
  1000. Sets the current palette to
  1001. \var{Palette}. \var{Palette} is an untyped variable, usually pointing to a
  1002. record of type \var{PaletteType}
  1003. \Errors
  1004. None.
  1005. \SeeAlso
  1006. \seep{GetPalette}
  1007. \end{procedure}
  1008. \begin{procedure}{SetAspectRatio}
  1009. \Declaration
  1010. Procedure SetAspectRatio (Xasp,Yasp : Word);
  1011. \Description
  1012. Sets the aspect ratio of the
  1013. current screen to \var{Xasp/Yasp}.
  1014. \Errors
  1015. None
  1016. \SeeAlso
  1017. \seep{InitGraph}, \seep{GetAspectRatio}
  1018. \end{procedure}
  1019. \begin{procedure}{SetBkColor}
  1020. \Declaration
  1021. Procedure SetBkColor (Color : Word);
  1022. \Description
  1023. Sets the background color to
  1024. \var{Color}.
  1025. \Errors
  1026. None.
  1027. \SeeAlso
  1028. \seef{GetBkColor}, \seep{SetColor}
  1029. \end{procedure}
  1030. \begin{procedure}{SetColor}
  1031. \Declaration
  1032. Procedure SetColor (Color : Word);
  1033. \Description
  1034. Sets the foreground color to
  1035. \var{Color}.
  1036. \Errors
  1037. None.
  1038. \SeeAlso
  1039. \seef{GetColor}, \seep{SetBkColor}
  1040. \end{procedure}
  1041. \begin{procedure}{SetFillPattern}
  1042. \Declaration
  1043. Procedure SetFillPattern (FillPattern : FillPatternType,\\ Color : Word);
  1044. \Description
  1045. \var{SetFillPattern} sets the current fill-pattern to \var{FillPattern}, and
  1046. the filling color to \var{Color}
  1047. The pattern is an 8x8 raster, corresponding to the 64 bits in
  1048. \var{FillPattern}.
  1049. \Errors
  1050. None
  1051. \SeeAlso
  1052. \seep{GetFillPattern}, \seep{SetFillStyle}
  1053. \end{procedure}
  1054. \begin{procedure}{SetFillStyle}
  1055. \Declaration
  1056. Procedure SetFillStyle (Pattern,Color : word);
  1057. \Description
  1058. \var{SetFillStyle} sets the filling pattern and color to one of the
  1059. predefined filling patterns. \var{Pattern} can be one of the following predefined
  1060. constants :
  1061. \begin{itemize}
  1062. \item \var{EmptyFill } Uses backgroundcolor.
  1063. \item \var{SolidFill } Uses filling color
  1064. \item \var{LineFill } Fills with horizontal lines.
  1065. \item \var{ltSlashFill} Fills with lines from left-under to top-right.
  1066. \item \var{SlashFill } Idem as previous, thick lines.
  1067. \item \var{BkSlashFill} Fills with thick lines from left-Top to bottom-right.
  1068. \item \var{LtBkSlashFill} Idem as previous, normal lines.
  1069. \item \var{HatchFill} Fills with a hatch-like pattern.
  1070. \item \var{XHatchFill} Fills with a hatch pattern, rotated 45 degrees.
  1071. \item \var{InterLeaveFill}
  1072. \item \var{WideDotFill} Fills with dots, wide spacing.
  1073. \item \var{CloseDotFill} Fills with dots, narrow spacing.
  1074. \item \var{UserFill} Fills with a user-defined pattern.
  1075. \end{itemize}
  1076. \Errors
  1077. None.
  1078. \SeeAlso
  1079. \seep{SetFillPattern}
  1080. \end{procedure}
  1081. \begin{procedure}{SetGraphBufSize}
  1082. \Declaration
  1083. Procedure SetGraphBufSize (BufSize : Word);
  1084. \Description
  1085. \var{SetGraphBufSize} is a dummy function which does not do
  1086. anything; it is no longer needed.
  1087. \Errors
  1088. None.
  1089. \SeeAlso
  1090. \end{procedure}
  1091. \begin{procedure}{SetGraphMode}
  1092. \Declaration
  1093. Procedure SetGraphMode (Mode : Integer);
  1094. \Description
  1095. \var{SetGraphMode} sets the graphical mode and clears the screen.
  1096. \Errors
  1097. None.
  1098. \SeeAlso
  1099. \seep{InitGraph}
  1100. \end{procedure}
  1101. \begin{procedure}{SetLineStyle}
  1102. \Declaration
  1103. Procedure SetLineStyle (LineStyle,Pattern,Width :
  1104. Word);
  1105. \Description
  1106. \var{SetLineStyle}
  1107. sets the drawing style for lines. You can specify a \var{LineStyle} which is
  1108. one of the following pre-defined constants:
  1109. \begin{itemize}
  1110. \item \var{Solidln=0;} draws a solid line.
  1111. \item \var{Dottedln=1;} Draws a dotted line.
  1112. \item \var{Centerln=2;} draws a non-broken centered line.
  1113. \item \var{Dashedln=3;} draws a dashed line.
  1114. \item \var{UserBitln=4;} Draws a User-defined bit pattern.
  1115. \end{itemize}
  1116. If \var{UserBitln} is specified then \var{Pattern} contains the bit pattern.
  1117. In all another cases, \var{Pattern} is ignored. The parameter \var{Width}
  1118. indicates how thick the line should be. You can specify one of the following
  1119. pre-defined constants:
  1120. \begin{itemize}
  1121. \item \var{NormWidth=1}
  1122. \item \var{ThickWidth=3}
  1123. \end{itemize}
  1124. \Errors
  1125. None.
  1126. \SeeAlso
  1127. \seep{GetLineSettings}
  1128. \end{procedure}
  1129. \begin{procedure}{SetPalette}
  1130. \Declaration
  1131. Procedure SetPalette (ColorNr : Word; NewColor : ShortInt);
  1132. \Description
  1133. \var{SetPalette} changes the \var{ColorNr}-th entry in the palette to
  1134. \var{NewColor}
  1135. \Errors
  1136. None.
  1137. \SeeAlso
  1138. \seep{SetAllPallette},\seep{SetRGBPalette}
  1139. \end{procedure}
  1140. \begin{procedure}{SetRGBPalette}
  1141. \Declaration
  1142. Procedure SetRGBPalette (ColorNr,Red,Green,Blue : Integer);
  1143. \Description
  1144. \var{SetRGBPalette} sets the \var{ColorNr}-th entry in the palette to the
  1145. color with RGB-values \var{Red, Green Blue}.
  1146. \Errors
  1147. None.
  1148. \SeeAlso
  1149. \seep{SetAllPallette},
  1150. \seep{SetPalette}
  1151. \end{procedure}
  1152. \begin{procedure}{SetTextJustify}
  1153. \Declaration
  1154. Procedure SetTextJustify (Horizontal,Vertical : Word);
  1155. \Description
  1156. \var{SetTextJustify} controls the placement of new text, relative to the
  1157. (graphical) cursor position. \var{Horizontal} controls horizontal placement, and can be
  1158. one of the following pre-defined constants:
  1159. \begin{itemize}
  1160. \item \var{LeftText=0;} Text is set left of the pointer.
  1161. \item \var{CenterText=1;} Text is set centered horizontally on the pointer.
  1162. \item \var{RightText=2;} Text is set to the right of the pointer.
  1163. \end{itemize}
  1164. \var{Vertical} controls the vertical placement of the text, relative to the
  1165. (graphical) cursor position. Its value can be one of the following
  1166. pre-defined constants :
  1167. \begin{itemize}
  1168. \item \var{BottomText=0;} Text is placed under the pointer.
  1169. \item \var{CenterText=1;} Text is placed centered vertically on the pointer.
  1170. \item \var{TopText=2;}Text is placed above the pointer.
  1171. \end{itemize}
  1172. \Errors
  1173. None.
  1174. \SeeAlso
  1175. \seep{OutText}, \seep{OutTextXY}
  1176. \end{procedure}
  1177. \begin{procedure}{SetTextStyle}
  1178. \Declaration
  1179. Procedure SetTextStyle (Font,Direction,Magnitude : Word);
  1180. \Description
  1181. \var{SetTextStyle} controls the style of text to be put on the screen.
  1182. pre-defined constants for \var{Font} are:
  1183. \begin{itemize}
  1184. \item \var{DefaultFont=0;}
  1185. \item \var{TriplexFont=2;}
  1186. \item \var{SmallFont=2;}
  1187. \item \var{SansSerifFont=3;}
  1188. \item \var{GothicFont=4;}
  1189. \end{itemize}
  1190. Pre-defined constants for \var{Direction} are :
  1191. \begin{itemize}
  1192. \item \var{HorizDir=0;}
  1193. \item \var{VertDir=1;}
  1194. \end{itemize}
  1195. \Errors
  1196. None.
  1197. \SeeAlso
  1198. \seep{GetTextSettings}
  1199. \end{procedure}
  1200. \begin{procedure}{SetUserCharSize}
  1201. \Declaration
  1202. Procedure SetUserCharSize (Xasp1,Xasp2,Yasp1,Yasp2 : Word);
  1203. \Description
  1204. Sets the width and height of vector-fonts. The horizontal size is given
  1205. by \var{Xasp1/Xasp2}, and the vertical size by \var{Yasp1/Yasp2}.
  1206. \Errors
  1207. None.
  1208. \SeeAlso
  1209. \seep{SetTextStyle}
  1210. \end{procedure}
  1211. \begin{procedure}{SetViewPort}
  1212. \Declaration
  1213. Procedure SetViewPort (X1,Y1,X2,Y2 : Integer; Clip : Boolean);
  1214. \Description
  1215. Sets the current graphical viewport (window) to the rectangle defined by
  1216. the top-left corner \var{(X1,Y1)} and the bottom-right corner \var{(X2,Y2)}.
  1217. If \var{Clip} is true, anything drawn outside the viewport (window) will be
  1218. clipped (i.e. not drawn). Coordinates specified after this call are relative
  1219. to the top-left corner of the viewport.
  1220. \Errors
  1221. None.
  1222. \SeeAlso
  1223. \seep{GetViewSettings}
  1224. \end{procedure}
  1225. \begin{procedure}{SetVisualPage}
  1226. \Declaration
  1227. Procedure SetVisualPage (Page : Word);
  1228. \Description
  1229. \var{SetVisualPage} sets the video page to page number \var{Page}.
  1230. \Errors
  1231. None
  1232. \SeeAlso
  1233. \seep{SetActivePage}
  1234. \end{procedure}
  1235. \begin{procedure}{SetWriteMode}
  1236. \Declaration
  1237. Procedure SetWriteMode (Mode : Integer);
  1238. \Description
  1239. \var{SetWriteMode} controls the drawing of lines on the screen. It controls
  1240. the binary operation used when drawing lines on the screen. \var{Mode} can
  1241. be one of the following pre-defined constants:
  1242. \begin{itemize}
  1243. \item CopyPut=0;
  1244. \item XORPut=1;
  1245. \end{itemize}
  1246. \Errors
  1247. None.
  1248. \SeeAlso
  1249. \end{procedure}
  1250. \begin{function}{TextHeight}
  1251. \Declaration
  1252. Function TextHeight (S : String) : Word;
  1253. \Description
  1254. \var{TextHeight} returns the height (in pixels) of the string \var{S} in
  1255. the current font and text-size.
  1256. \Errors
  1257. None.
  1258. \SeeAlso
  1259. \seef{TextWidth}
  1260. \end{function}
  1261. \begin{function}{TextWidth}
  1262. \Declaration
  1263. Function TextWidth (S : String) : Word;
  1264. \Description
  1265. \var{TextHeight} returns the width (in pixels) of the string \var{S} in
  1266. the current font and text-size.
  1267. \Errors
  1268. None.
  1269. \SeeAlso
  1270. \seef{TextHeight}
  1271. \end{function}
  1272. % Target specific issues.
  1273. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1274. \section{Target specific issues}
  1275. In what follows we describe some things that are different on the various
  1276. platforms:
  1277. \subsection{\dos}
  1278. \subsection{\windows}
  1279. \subsection{\linux}