graph.tex 37 KB

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