home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
VRAC
/
MS_ARCAD.ZIP
/
ARC6_4.CHP
< prev
next >
Wrap
Text File
|
1993-06-15
|
4KB
|
98 lines
%
#EF
#T15,1,Chapter 6 The Borland Graphics Interface Pg. 13
#HS,1,4,80,25,11,1
#C4,R5
~W~IDrawing With The BGI~Y~I
There are too many drawing functions in the BGI for us to cover them all
here. However, a brief summary of the functions we will use most is
presented in Figure 6.2, beginning on the next page. We should note that
all of the drawing functions include the ability to clip against a viewport
if we have turned clipping on. This is a very handy thing when drawing 3D
scenes.
#WN
The drawing functions include routines that draw lines, circles, ellipses,
and arbitrarily shaped polygons. We can manipulate the screen pixel by
pixel, or in groups of pixels. The foreground and background colors can be
set, and we can manipulate the EGA and VGA palette registers.
#WN
There are really quite a few tools for our use. I recommend that you be as
lazy as possible and make the BGI do as much of your work as you can.
#WP
%
#EF
#T15,1,Chapter 6 The Borland Graphics Interface Pg. 14
#HS,1,4,80,25,11,1
#C2,R5
~W~IFigure 6.2~Y~I
Summary Of The BGI
Drawing And Animation Functions
╔═══════════════════════════════════════════════════════════════════════════╗
║ ~W~IName Purpose ~Y~I ║
╙───────────────────────────────────────────────────────────────────────────╜
arc() Draws an arc.
bar() Draws a filled rectangle. Can also be used to
blank out an area on the screen.
bar3d() Draws a 3D bar.
circle() Draws a circle. The parameters x and y specify the
center of the circle. Only the circle's outline is
drawn. The inside of the circle is not filled. The
circle will look like a circle no matter what
monitor is being used. The BGI automatically
adjusts it based on the aspect ratio.
#C28,R23
~C~IContinued On Next Page~Y~I
#WP
%
#EF
#T15,1,Chapter 6 The Borland Graphics Interface Pg. 15
#HS,1,4,80,25,11,1
#C2,R5
~W~IFigure 6.2 (cont)~Y~I
Summary Of The BGI
Drawing And Animation Functions
╔═══════════════════════════════════════════════════════════════════════════╗
║ ~W~IName Purpose ~Y~I ║
╙───────────────────────────────────────────────────────────────────────────╜
cleardevice() Clears the screen and sets the graphics cursor
(also called the current position) to 0,0.
drawpoly() Draws an outline of a polygon of nearly any shape.
ellipse() Draws an unfilled ellipse.
fillpoly() Draws a filled polygon of nearly any shape.
floodfill() Fills an area of the screen. Stops when it
encounters the specified border color.
getimage() Stores a bitmap into memory. Useful for doing
bitblts.
#C28,R23
~C~IContinued On Next Page~Y~I
#WP
%
#EF
#T15,1,Chapter 6 The Borland Graphics Interface Pg. 16
#HS,1,4,80,25,11,1
#C2,R5
~W~IFigure 6.2 (cont)~Y~I
Summary Of The BGI
Drawing And Animation Functions
╔═══════════════════════════════════════════════════════════════════════════╗
║ ~W~IName Purpose ~Y~I ║
╙───────────────────────────────────────────────────────────────────────────╜
imagesize() Returns the number of bytes needed to store a
bitmap. Used when dynamically allocating space to
store a bitmap into.
line() I'll give you one guess what this one does.
putimage() Puts a bitmap to the screen. The bitmap should
have been saved to memory using getimage(). This
function is also needed for bitblts.
rectangle() Draws an unfilled rectangle.
#WP
#X