graph.tex 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  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. This document describes the \var{GRAPH} unit for Free Pascal, under \dos.
  25. The unit was first written for \dos by Florian kl\"ampfl.
  26. This chapter is divided in three sections.
  27. \begin{itemize}
  28. \item The first section gives an introduction to the graph unit.
  29. \item The second section lists the pre-defined constants, types and variables.
  30. \item The second section describes the functions which appear in the
  31. interface part of the \file{GRAPH} unit.
  32. \end{itemize}
  33. \section{Introduction}
  34. \label{se:Introduction}
  35. \subsection{Requirements}
  36. The unit Graph exports functions and procedures for graphical output.
  37. It requires at least a VESA compatible VGA-Card or a VGA-Card with software-driver
  38. (min. \textbf{512Kb} video memory).
  39. Before the graph unit can be used, be sure your graphics adapter supports
  40. the VESA-Standard. Otherwise in the most cases you can try to use a VESA-TSR
  41. to make your adapter VESA compatible (e.g. UNIVBE).
  42. \section{Constants, Types and Variables}
  43. \subsection{Types}
  44. \begin{verbatim}
  45. ArcCoordsType = record
  46. X,Y,Xstart,Ystart,Xend,Yend : Integer;
  47. end;
  48. FillPatternType = Array [1..8] of Byte;
  49. FillSettingsType = Record
  50. Pattern,Color : Word
  51. end;
  52. LineSettingsType = Record
  53. LineStyle,Pattern, Width : Word;
  54. end;
  55. PaletteType = Record
  56. Size : Byte;
  57. Colors : array[0..MAxColor] of shortint;
  58. end;
  59. PointType = Record
  60. X,Y : Integer;
  61. end;
  62. TextSettingsType = Record
  63. Font,Direction, CharSize, Horiz, Vert : Word
  64. end;
  65. ViewPortType = Record
  66. X1,Y1,X2,Y2 : Integer;
  67. Clip : Boolean
  68. end;
  69. \end{verbatim}
  70. \section{Functions and procedures}
  71. \procedure{Arc}{(X,Y : Integer; start,stop, radius : Word)}
  72. { \var{Arc} draws part of a circle with center at \var{(X,Y)}, radius
  73. \var{radius}, starting from angle \var{start}, stopping at angle \var{stop}.
  74. These angles are measured
  75. counterclockwise.}{None.}{\seep{Circle},\seep{Ellipse}
  76. \seep{GetArcCoords},\seep{PieSlice}, \seep{Sector}}
  77. \procedure{Bar}{(X1,Y1,X2,Y2 : Integer)}
  78. {Draws a rectangle with corners at \var{(X1,Y1)} and \var{(X2,Y2)}
  79. and fills it with the current color and fill-style.}{None.}{\seep{Bar3D},
  80. \seep{Rectangle}}
  81. \procedure{Bar3D}{(X1,Y1,X2,Y2 : Integer; depth : Word; Top : Boolean)}
  82. {Draws a 3-dimensional Bar with corners at \var{(X1,Y1)} and \var{(X2,Y2)}
  83. and fills it with the current color and fill-style.
  84. \var{Depth} specifies the number of pixels used to show the depth of the
  85. bar.
  86. If \var{Top} is true; then a 3-dimensional top is drawn.}
  87. {None.}{\seep{Bar}, \seep{Rectangle}}
  88. \procedure{Circle}{(X,Y : Integer; Radius : Word)}
  89. { \var{Circle} draws part of a circle with center at \var{(X,Y)}, radius
  90. \var{radius}.}{None.}{\seep{Ellipse},\seep{Arc}
  91. \seep{GetArcCoords},\seep{PieSlice}, \seep{Sector}}
  92. \procedure{ClearDevice}{}{Clears the graphical screen (with the current
  93. background color), and sets the pointer at \var{(0,0)}}{None.}
  94. {\seep{ClearViewPort}, \seep{SetBkColor}}
  95. \procedure{ClearViewPort}{}
  96. {Clears the current view-port. The current background color is used as filling
  97. color. The pointer is set at
  98. \var{(0,0)}}{None.}{\seep{ClearDevice},\seep{SetViewPort}, \seep{SetBkColor}}
  99. \procedure{CloseGraph}{}{Closes the graphical system, and restores the
  100. screen modus which was active before the graphical modus was
  101. activated.}{None.}{\seep{InitGraph}}
  102. \procedure{DetectGraph}{(Var Driver, Modus : Integer)}
  103. { Checks the hardware in the PC and determines the driver and screen-modus to
  104. be used. These are returned in \var{Driver} and \var{Modus}, and can be fed
  105. to \var{InitGraph}.
  106. See the \var{InitGraph} for a list of drivers and modi.}
  107. {None.}{\seep{InitGraph}}
  108. \procedure{DrawPoly}{(NumberOfPoints : Word; Var PolyPoints}{
  109. Draws a polygone with \var{NumberOfPoints} corner points, using the
  110. current color and line-style. PolyPoints is an array of type \var{PointType}.
  111. }{None.}{\seep{Bar}, seep{Bar3D}, \seep{Rectangle}}
  112. \procedure{Ellipse}{(X,Y : Integer; Start,Stop,XRadius,YRadius : Word)}
  113. { \var{Ellipse} draws part of an ellipse with center at \var{(X,Y)}.
  114. \var{XRadius} and \var{Yradius} are the horizontal and vertical radii of the
  115. ellipse. \var{Start} and \var{Stop} are the starting and stopping angles of
  116. the part of the ellipse.
  117. They are measured counterclockwise from the X-axis.}
  118. {None.}{\seep{Arc} \seep{Circle}, \seep{FillEllipse}}
  119. \procedure{FillEllipse}{(X,Y : Integer; Xradius,YRadius: Word)}
  120. { \var{Ellipse} draws an ellipse with center at \var{(X,Y)}.
  121. \var{XRadius} and \var{Yradius} are the horizontal and vertical radii of the
  122. ellipse. The ellipse is filled with the current color and fill-style.}
  123. {None.}{\seep{Arc} \seep{Circle},
  124. \seep{GetArcCoords},\seep{PieSlice}, \seep{Sector}}
  125. \procedure{FillPoly}{(NumberOfPoints : Word; Var PolyPoints)}{
  126. Draws a polygone with \var{NumberOfPoints} corner points and fills it
  127. using the current color and line-style.
  128. PolyPoints is an array of type \var{PointType}.
  129. }{None.}{\seep{Bar}, seep{Bar3D}, \seep{Rectangle}}
  130. \procedure{FloodFill}{(X,Y : Integer; BorderColor : Word)}{
  131. Fills the area containing the point \var{(X,Y)}, bounded by the color
  132. \var{BorderColor}.}{None}{\seep{SetColor}, \seep{SetBkColor}}
  133. \procedure{GetArcCoords}{(Var ArcCoords : ArcCoordsType)}
  134. {\var{GetArcCoords} returns the coordinates of the latest \var{Arc} or
  135. \var{Ellipse} call.}
  136. {None.}{\seep{Arc}, \seep{Ellipse}}
  137. \procedure{GetAspectRatio}{(Var Xasp,Yasp : Word)}
  138. {\var{GetAspectRatio} determines the effective resolution of the screen. The aspect ration can
  139. the be calculated as \var{Xasp/Yasp}.}{None.}{\seep{InitGraph},\seep{SetAspectRatio}}
  140. \Function{GetBkColor}{Word}{\var{GetBkColor} returns the current background color (the palette
  141. entry).}{None.}{\seef{GetColor},\seep{SetBkColor}}
  142. \Function{GetColor}{Word}{\var{GetColor} returns the current drawing color (the palette
  143. entry).}{None.}{\seef{GetColor},\seep{SetBkColor}}
  144. \procedure {GetDefaultPalette}{(Var Palette : PaletteType)}{Returns the
  145. current palette in \var{Palette}.}{None.}{\seef{GetColor}, \seef{GetBkColor}}
  146. \Function{GetDriverName}{String}{\var{GetDriverName} returns a string containing the name of the
  147. current driver.}{None.}{\seef{GetModeName}, \seep{InitGraph}}
  148. \procedure{GetFillPattern}{(Var FillPattern : FillPatternType)}
  149. {\var{GetFillPattern} returns an array with the current fill-pattern in \var{FillPattern}}
  150. {None}{\seep{SetFillPattern}}
  151. \procedure{GetFillSettings}{(Var FillInfo : FillSettingsType)}
  152. {\var{GetFillSettings} returns the current fill-settings in
  153. \var{FillInfo}}{None.}{\seep{SetFillPattern}}
  154. \Function{GetGraphMode}{Integer}{\var{GetGraphMode} returns the current graphical modus}
  155. {None.}{\seep{InitGraph}}
  156. \procedure{GetImage}{(X1,Y1,X2,Y2 : Integer, Var Bitmap}{\var{GetImage}
  157. Places a copy of the screen area \var{(X1,Y1)} to \var{X2,Y2} in \var{BitMap}}
  158. {Bitmap must have enough room to contain the image.}{\seef{ImageSize},
  159. \seep{PutImage}}
  160. \procedure{GetLineSettings}{(Var LineInfo : LineSettingsType)}
  161. {\var{GetLineSettings} returns the current Line settings in
  162. \var{LineInfo}}{None.}{\seep{SetLineStyle}}
  163. \Function{GetMaxColor}{Word}{\var{GetMaxColor} returns the maximum
  164. color-number which can be set with \var{SetColor}}{None.}{\seep{SetColor},
  165. \seef{GetPaletteSize}}
  166. \Function{GetMaxMode}{Word}{\var{GetMaxMode} returns the highest modus for
  167. the current driver.}{None.}{\seep{InitGraph}}
  168. \Function{GetMaxX}{Word}{\var{GetMaxX} returns the maximum horizontal screen
  169. length}{None.}{\seef{GetMaxY}}
  170. \Function{GetMaxY}{Word}{\var{GetMaxY} returns the maximum number of screen
  171. lines}{None.}{\seef{GetMaxY}}
  172. \function{GetModeName}{(Var modus : Integer)}{String}{
  173. Returns a string with the name of modus
  174. \var{Modus}}{None.}{\seef{GetDriverName}, \seep{InitGraph}}
  175. \procedure{GetModeRange}{(Driver : Integer; \\ LoModus, HiModus: Integer)}
  176. {\var{GetModeRange} returns the Lowest and Highest modus of the currently
  177. installed driver.}{None.}{\seep{InitGraph}}
  178. \procedure{GetPalette}{(Var Palette : PaletteType)}
  179. {\var{GetPalette} returns in \var{Palette} the current palette.}
  180. {None.}{\seef{GetPaletteSize}, \seep{SetPalette}}
  181. \Function{GetPaletteSize}{Word}{\var{GetPaletteSize} returns the maximum
  182. number of entries in the current palette.}{None.}{\seep{GetPalette},
  183. \seep{SetPalette}}
  184. \function{GetPixel}{(X,Y : Integer)}{Word}{\var{GetPixel} returns the color
  185. of the point at \var{(X,Y)} }{None.}{}
  186. \procedure{GetTextSettings}{(Var TextInfo : TextSettingsType)}
  187. {\var{GetTextSettings} returns the current text style settings : The font,
  188. direction, size and placement as set with \var{SetTextStyle} and
  189. \var{SetTextJustify}}{None.}{\seep{SetTextStyle}, \seep{SetTextJustify}}
  190. \procedure{GetViewSettings}{(Var ViewPort : ViewPortType)}
  191. {\var{GetViewSettings} returns the current view-port and clipping settings in
  192. \var{ViewPort}.}{None.}{\seep{SetViewPort}}
  193. \Function{GetX}{Integer}{\var{GetX} returns the X-coordinate of the current position of
  194. the graphical pointer}{None.}{\seef{GetY}}
  195. \Function{GetY}{Integer}{\var{GetY} returns the Y-coordinate of the current position of
  196. the graphical pointer}{None.}{\seef{GetX}}
  197. \Procedure{GraphDefaults}{\var{GraphDefaults} resets all settings for view-port, palette,
  198. foreground and background pattern, line-style and pattern, filling style,
  199. filling color and pattern, font, text-placement and
  200. text size.}{None.}{\seep{SetViewPort}, \seep{SetFillStyle}, \seep{SetColor},
  201. \seep{SetBkColor}, \seep{SetLineStyle}}
  202. \function{GraphErrorMsg}{(ErrorCode : Integer)}{String}{\var{GraphErrorMsg}
  203. returns a string describing the error \var{Errorcode}. This string can be
  204. used to let the user know what went wrong.}{None.}{\seef{GraphResult}}
  205. \Function{GraphResult}{Integer}{\var{GraphResult} returns an error-code for
  206. the last graphical operation. If the returned value is zero, all went well.
  207. A value different from zero means an error has occurred.
  208. Except for all operations which draw something on the screen,
  209. the following procedures also can produce a \var{GraphResult} different from
  210. zero:
  211. \begin{itemize}
  212. \item \seef{InstallUserFont}
  213. \item \seep{SetLineStyle}
  214. \item \seep{SetWriteMode}
  215. \item \seep{SetFillStyle}
  216. \item \seep{SetTextJustify}
  217. \item \seep{SetGraphMode}
  218. \item \seep{SetTextStyle}
  219. \end{itemize}
  220. }{None.}{\seef{GraphErrorMsg}}
  221. \function{ImageSize}{(X1,Y1,X2,Y2 : Integer)}{Word}{\var{ImageSize} returns
  222. the number of bytes needed to store the image in the rectangle defined by
  223. \var{(X1,Y1)} and \var{(X2,Y2)}.}{None.}{\seep{GetImage}}
  224. \procedure{InitGraph}{(var GraphDriver,GraphModus : integer;\\
  225. const PathToDriver : string)}{
  226. \var{InitGraph} initializes the \var{graph} package.
  227. \var{GraphDriver} has two valid values: \var{GraphDriver=0} which
  228. performs an auto detect and initializes the highest possible mode with the most
  229. colors. 1024x768x64K is the highest possible resolution supported by the
  230. driver, if you need a higher resolution, you must edit \file{MODES.PPI}.
  231. If you need another mode, then set \var{GraphDriver} to a value different
  232. from zero
  233. and \var{graphmode} to the mode you wish (VESA modes where 640x480x256
  234. is \var {101h} etc.).
  235. \var{PathToDriver} is only needed, if you use the BGI fonts from
  236. Borland.}{None.}{Introduction, (page \pageref{se:Introduction}),
  237. \seep{DetectGraph}, \seep{CloseGraph}, \seef{GraphResult}}
  238. Example:
  239. \begin{verbatim}
  240. var
  241. gd,gm : integer;
  242. PathToDriver : string;
  243. begin
  244. gd:=detect; { highest possible resolution }
  245. gm:=0; { not needed, auto detection }
  246. PathToDriver:='C:\PP\BGI'; { path to BGI fonts,
  247. drivers aren't needed }
  248. InitGraph(gd,gm,PathToDriver);
  249. if GraphResult<>grok then
  250. halt; ..... { whatever you need }
  251. CloseGraph; { restores the old graphics mode }
  252. end.
  253. \end{verbatim}
  254. \function{InstallUserDriver}{(DriverPath : String; \\AutoDetectPtr: Pointer)}
  255. {Integer}{\var{InstallUserDriver}
  256. adds the device-driver \var{DriverPath} to the list of .BGI
  257. drivers. \var{AutoDetectPtr} is a pointer to a possible auto-detect function.}
  258. {None.}{\seep{InitGraph}, \seef{InstallUserFont}}
  259. \function{InstallUserFont}{(FontPath : String)}{Integer}
  260. {\var{InstallUserFont} adds the font in \var{FontPath} to the list of fonts
  261. of the .BGI system.}
  262. {None.}{\seep{InitGraph}, \seef{InstallUserDriver}}
  263. \procedure{Line}{(X1,Y1,X2,Y2 : Integer)}{\var{Line} draws a line starting from
  264. \var{(X1,Y1} to \var{(X2,Y2)}, in the current line style and color. The
  265. current position is put to \var{(X2,Y2)}}{None.}
  266. {\seep{LineRel},\seep{LineTo}}
  267. \procedure{LineRel}{(DX,DY : Integer)}{\var{LineRel} draws a line starting from
  268. the current pointer position to the point\var{(DX,DY}, \textbf{relative} to the
  269. current position, in the current line style and color. The Current Position
  270. is set to the endpoint of the line.}{None.}
  271. {\seep{Line}, \seep{LineTo}}
  272. \procedure{LineTo}{(DX,DY : Integer)}{\var{LineTo} draws a line starting from
  273. the current pointer position to the point\var{(DX,DY}, \textbf{relative} to the
  274. current position, in the current line style and color. The Current position
  275. is set to the end of the line.}{None.}
  276. {\seep{LineRel},\seep{Line}}
  277. \procedure{MoveRel}{(DX,DY : Integer}{\var{MoveRel} moves the pointer to the
  278. point \var{(DX,DY)}, relative to the current pointer
  279. position}{None.}{\seep{MoveTo}}
  280. \procedure{MoveTo}{(X,Y : Integer}{\var{MoveTo} moves the pointer to the
  281. point \var{(X,Y)}.}{None.}{\seep{MoveRel}}
  282. \procedure{OutText}{(Const TextString : String)}
  283. {\var{OutText} puts \var{TextString} on the screen, at the current pointer
  284. position, using the current font and text settings. The current position is
  285. moved to the end of the text.}
  286. {None.}{\seep{OutTextXY}}
  287. \procedure{OutTextXY}{(X,Y : Integer; Const TextString : String)}
  288. {\var{OutText} puts \var{TextString} on the screen, at position \var{(X,Y)},
  289. using the current font and text settings. The current position is
  290. moved to the end of the text.}
  291. {None.}{\seep{OutText}}
  292. \procedure{PieSlice}{(X,Y : Integer; \\ Start,Stop,Radius : Word)}{\var{PieSlice}
  293. draws and fills a sector of a circle with center \var{(X,Y)} and radius
  294. \var{Radius}, starting at angle \var{Start} and ending at angle \var{Stop}.}
  295. {None.}{\seep{Arc}, \seep{Circle}, \seep{Sector}}
  296. \procedure{PutImage}{(X1,Y1 : Integer; Var Bitmap; How : word) }{\var{PutImage}
  297. Places the bitmap in \var{Bitmap} on the screen at \var{(X1,Y1)}. \var{How}
  298. determines how the bitmap will be placed on the screen. Possible values are :
  299. \begin{itemize}
  300. \item CopyPut
  301. \item XORPut
  302. \item ORPut
  303. \item AndPut
  304. \item NotPut
  305. \end{itemize}}
  306. {None}{\seef{ImageSize},\seep{GetImage}}
  307. \procedure{PutPixel}{(X,Y : Integer; Color : Word)}{Puts a point at
  308. \var{(X,Y)} using color \var{Color}}{None.}{\seef{GetPixel}}
  309. \procedure{Rectangle}{(X1,Y1,X2,Y2 : Integer)}{Draws a rectangle with
  310. corners at \var{(X1,Y1)} and \var{(X2,Y2)}, using the current color and
  311. style.}{None.}{\seep{Bar}, \seep{Bar3D}}
  312. \function{RegisterBGIDriver}{(Driver : Pointer)}{Integer}
  313. {Registers a user-defined BGI driver}{None.}{\seef{InstallUserDriver},
  314. \seef{RegisterBGIFont}}
  315. \function{RegisterBGIFont}{(Font : Pointer)}{Integer}
  316. {Registers a user-defined BGI driver}{None.}{\seef{InstallUserFont},
  317. \seef{RegisterBGIDriver}}
  318. \Procedure{RestoreCRTMode}{Restores the screen modus which was active before
  319. the graphical modus was started.}{None.}{\seep{InitGraph}}
  320. \procedure{Sector}{(X,Y : Integer; \\ Start,Stop,XRadius,YRadius : Word)}{\var{Sector}
  321. draws and fills a sector of an ellipse with center \var{(X,Y)} and radii
  322. \var{XRadius} and \var{YRadius}, starting at angle \var{Start} and ending at angle \var{Stop}.}
  323. {None.}{\seep{Arc}, \seep{Circle}, \seep{PieSlice}}
  324. \procedure{SetActivePage}{(Page : Word)}{Sets \var{Page} as the active page
  325. for all graphical output.}{None.}{}
  326. \procedure{SetAllPallette}{(Var Palette)}{Sets the current palette to
  327. \var{Palette}. \var{Palette} is an untyped variable, usually pointing to a
  328. record of type \var{PaletteType}}{None.}{\seep{GetPalette}}
  329. \procedure{SetAspectRatio}{(Xasp,Yasp : Word)}{Sets the aspect ratio of the
  330. current screen to \var{Xasp/Yasp}.}
  331. {None}{\seep{InitGraph}, \seep{GetAspectRatio}}
  332. \procedure{SetBkColor}{(Color : Word)}{Sets the background color to
  333. \var{Color}.}{None.}{\seef{GetBkColor}, \seep{SetColor}}
  334. \procedure{SetColor}{(Color : Word)}{Sets the foreground color to
  335. \var{Color}.}{None.}{\seef{GetColor}, \seep{SetBkColor}}
  336. \procedure{SetFillPattern}{(FillPattern : FillPatternType,\\ Color : Word)}
  337. {\var{SetFillPattern} sets the current fill-pattern to \var{FillPattern}, and
  338. the filling color to \var{Color}
  339. The pattern is an 8x8 raster, corresponding to the 64 bits in
  340. \var{FillPattern}.}{None}{\seep{GetFillPattern}, \seep{SetFillStyle}}
  341. \procedure{SetFillStyle}{(Pattern,Color : word)}
  342. {\var{SetFillStyle} sets the filling pattern and color to one of the
  343. predefined filling patterns. \var{Pattern} can be one of the following predefined
  344. constants :
  345. \begin{itemize}
  346. \item \var{EmptyFill } Uses backgroundcolor.
  347. \item \var{SolidFill } Uses filling color
  348. \item \var{LineFill } Fills with horizontal lines.
  349. \item \var{ltSlashFill} Fills with lines from left-under to top-right.
  350. \item \var{SlashFill } Idem as previous, thick lines.
  351. \item \var{BkSlashFill} Fills with thick lines from left-Top to bottom-right.
  352. \item \var{LtBkSlashFill} Idem as previous, normal lines.
  353. \item \var{HatchFill} Fills with a hatch-like pattern.
  354. \item \var{XHatchFill} Fills with a hatch pattern, rotated 45 degrees.
  355. \item \var{InterLeaveFill}
  356. \item \var{WideDotFill} Fills with dots, wide spacing.
  357. \item \var{CloseDotFill} Fills with dots, narrow spacing.
  358. \item \var{UserFill} Fills with a user-defined pattern.
  359. \end{itemize}
  360. }{None.}{\seep{SetFillPattern}}
  361. \procedure{SetGraphBufSize}{(BufSize : Word)}{\var{SetGraphBufSize}
  362. sets the graphical buffer size. The default size is 4Kb}{None.}{}
  363. \procedure{SetGraphMode}{(Mode : Integer)}{\var{SetGraphMode} sets the
  364. graphical mode and clears the screen.}{None.}{\seep{InitGraph}}
  365. \procedure{SetLineStyle}{(LineStyle,Pattern,Width :
  366. Word)}{\var{SetLineStyle}
  367. sets the drawing style for lines. You can specify a \var{LineStyle} which is
  368. one of the following pre-defined constants:
  369. \begin{itemize}
  370. \item \var{Solidln=0;} draws a solid line.
  371. \item \var{Dottedln=1;} Draws a dotted line.
  372. \item \var{Centerln=2;} draws a non-broken centered line.
  373. \item \var{Dashedln=3;} draws a dashed line.
  374. \item \var{UserBitln=4;} Draws a User-defined bit pattern.
  375. \end{itemize}
  376. If \var{UserBitln} is specified then \var{Pattern} contains the bit pattern.
  377. In all another cases, \var{Pattern} is ignored. The parameter \var{Width}
  378. indicates how thick the line should be. You can specify one of the following
  379. pre-defined constants:
  380. \begin{itemize}
  381. \item \var{NormWidth=1}
  382. \item \var{ThickWidth=3}
  383. \end{itemize}
  384. }{None.}{\seep{GetLineSettings}}
  385. \procedure{SetPalette}{(ColorNr : Word; NewColor : ShortInt)}
  386. {\var{SetPalette} changes the \var{ColorNr}-th entry in the palette to
  387. \var{NewColor}}{None.}{\seep{SetAllPallette},\seep{SetRGBPalette}}
  388. \procedure{SetRGBPalette}{(ColorNr,Red,Green,Blue : Integer)}
  389. {\var{SetRGBPalette} sets the \var{ColorNr}-th entry in the palette to the
  390. color with RGB-values \var{Red, Green Blue}.}{None.}{\seep{SetAllPallette},
  391. \seep{SetPalette}}
  392. \procedure{SetTextJustify}{(Horizontal,Vertical : Word)}
  393. {\var{SetTextJustify} controls the placement of new text, relative to the
  394. (graphical) cursor position. \var{Horizontal} controls horizontal placement, and can be
  395. one of the following pre-defined constants:
  396. \begin{itemize}
  397. \item \var{LeftText=0;} Text is set left of the pointer.
  398. \item \var{CenterText=1;} Text is set centered horizontally on the pointer.
  399. \item \var{RightText=2;} Text is set to the right of the pointer.
  400. \end{itemize}
  401. \var{Vertical} controls the vertical placement of the text, relative to the
  402. (graphical) cursor position. Its value can be one of the following
  403. pre-defined constants :
  404. \begin{itemize}
  405. \item \var{BottomText=0;} Text is placed under the pointer.
  406. \item \var{CenterText=1;} Text is placed centered vertically on the pointer.
  407. \item \var{TopText=2;}Text is placed above the pointer.
  408. \end{itemize}
  409. }{None.}{\seep{OutText}, \seep{OutTextXY}}
  410. \procedure{SetTextStyle}{(Font,Direction,Magnitude : Word)}
  411. {\var{SetTextStyle} controls the style of text to be put on the screen.
  412. pre-defined constants for \var{Font} are:
  413. \begin{itemize}
  414. \item \var{DefaultFont=0;}
  415. \item \var{TriplexFont=2;}
  416. \item \var{SmallFont=2;}
  417. \item \var{SansSerifFont=3;}
  418. \item \var{GothicFont=4;}
  419. \end{itemize}
  420. Pre-defined constants for \var{Direction} are :
  421. \begin{itemize}
  422. \item \var{HorizDir=0;}
  423. \item \var{VertDir=1;}
  424. \end{itemize}}{None.}{\seep{GetTextSettings}}
  425. \procedure{SetUserCharSize}{(Xasp1,Xasp2,Yasp1,Yasp2 : Word)}
  426. {Sets the width and height of vector-fonts. The horizontal size is given
  427. by \var{Xasp1/Xasp2}, and the vertical size by \var{Yasp1/Yasp2}.}{None.}
  428. {\seep{SetTextStyle}}
  429. \procedure{SetViewPort}{(X1,Y1,X2,Y2 : Integer; Clip : Boolean)}
  430. {Sets the current graphical view-port (window) to the rectangle defined by
  431. the top-left corner \var{(X1,Y1)} and the bottom-right corner \var{(X2,Y2)}.
  432. If \var{Clip} is true, anything drawn outside the view-port (window) will be
  433. clipped (i.e. not drawn). Coordinates specified after this call are relative
  434. to the top-left corner of the view-port.}{None.}{\seep{GetViewSettings}}
  435. \procedure{SetVisualPage}{(Page : Word)}
  436. {\var{SetVisualPage} sets the video page to page number \var{Page}. }
  437. {None}{\seep{SetActivePage}}
  438. \procedure{SetWriteMode}{(Mode : Integer)}
  439. {\var{SetWriteMode} controls the drawing of lines on the screen. It controls
  440. the binary operation used when drawing lines on the screen. \var{Mode} can
  441. be one of the following pre-defined constants:
  442. \begin{itemize}
  443. \item CopyPut=0;
  444. \item XORPut=1;
  445. \end{itemize}}{None.}{}
  446. \function{TextHeight}{(S : String)}{Word}
  447. {\var{TextHeight} returns the height (in pixels) of the string \var{S} in
  448. the current font and text-size.
  449. }{None.}{\seef{TextWidth}}
  450. \function{TextWidth}{(S : String)}{Word}
  451. {\var{TextHeight} returns the width (in pixels) of the string \var{S} in
  452. the current font and text-size.
  453. }{None.}{\seef{TextHeight}}