EasyManua.ls Logo

Sinclair QL - Page 215

Sinclair QL
422 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
graphics
It
is
important
to
realise that the
OL
screen has non square pixels and that changing
mode
will
change the shape of the pixels. Thus
if
the graphics procedures were simply
pixel based they would draw different shapes
in
the two modes. For example,
in
one
mode
we
would
have
a circle while the same figure
in
the
other mode would be an
ellipse.
The graphics procedures ensure that whatever screen mode
is
in
use,
consistent figures
are produced.
It
is
not possible
to
use a simple pixel count
to
indicate
sizes
of figures,
so
instead the graphics procedures use an arbitrary scale and coordinate
system
to
specify
sizes
and positions of figures.
The graphics procedures
use
the graphics co-ordinate system,
i.e.
draw relative
to
the
graphics origin
WhiCh
is
in
the bottom
left
hand corner of the specified or default window
Note that this
is
not the same
as
the pixel origin used
to
define the position of
Windows
and blocks,
etc.
The graphics origin allows a standard Cartesian coordinate
system
to
be used. A
graphiCS
cursor
is
updated after each graphics operation; subsequent
operations can either be relative
to
this cursor or can be absolute,
i.e.
relative
to
the
graphics origin.
100
Y
(0.0)
x
The
Graphics
Coordinate
System
24
The scaling factor
is
such that the
full
distance
in
the vertical direction
in
the specified
or default window has length 100 by default and can be changed with the SCALE
command. The scale
in
the x direction
is
equal
to
the scale
in
the y direction.
However,
the length of line which can be drawn
in
the x direction
is
dependent on the shape
of the window. Increasing the scale factor increases the maximum
size
of the figure which
can be drawn before the window
size
is
exceeded.
If
the graphics output
is
switched
to
a different
size
of window then the subsequent
size
of the output
is
adjusted
to
fit
the new window.
If
a figure exceeds
its
output window then the figure
is
clipped.
It
is
useful
to
consider the window
to
be a window onto a larger graphics space
in
which
the figures are drawn. The SCALE command allows the graphics origin to be set so
allOWing
the window
to
be moved around the graphics space.
The graphics procedures are output
to
the window attached
to
the specified or default
channel and the output
is
drawn
in
the INK colour
for
that channel.
Command
Function
CIRCLE
draw an ellipse or a circle
~
absolute
LINE
draw a line
ARC
draw an arc of a circle
POINT
plot a point
CIRCLE_R
draw an ellipse or a circle
~
relative
lINE_R
draw a line
ARC_R
draw an arc of a circle
POINT_R
plot a point
SCALE
set
scale and move origin
FILL
fill
in
a shape
CURSOR
position
text
graphics
fill
Figures drawn with the graphics and turtle graphics procedures can be optionally 1illed'
With
a specified stipple or colour,
If
FILL
is
selected then the figure
is
filled as
it
is
drawn.
The
FILL
algorithm stores a
list
of points to plot rather than actually plotting them. When
the figure closes there are
two points
on
the same
hOrizontal
line.
These two points are
12/84

Other manuals for Sinclair QL

Related product manuals