2. Graphics Standard Cont….
• Standard makes portability
• Rewriting Code is not required
• Following standards are available.
• GKS (Graphics Kernel System)
• PHIGS (Programmer’s Hierarchical Interactive
graphics standard.
3. GKS
• GKS- This system provides standard methods for developing
programs. It is used by various programming languages like
C, Fortran, Pascal, Basic etc. GKS was adopted as first
graphics software standard by ISO & by National standard
organization including ANSI.
• GKS was originally designed as a 2D graphics package.
• PHIGS was the extension of GKS which provides 3D graphics
package.
• GKS includes various types of methods, reserved words.
Advantages of GKS
• It provides improved algorithm
• It makes system portable.
• Rewriting of code is not required
4. PHIGS (Programmer’s Hierarchical Interactive
Graphics Standard)
• PHIGS was the extension of GKS which provides
3D graphics package.
• PHIGS includes additional functions for
• Object Modeling
• Color Specification
• Surface Rendering
• Picture Manipulation
• PHIGS+ is the advance version of PHIGS having
additional functionality.
7. Graphics Standard Cont….
• Polyline
• The GKS function for drawing line segments is called polyline. The polyline function
takes an array of X-Y coordinates and draws line segments connecting them. The
attributes that control the appearance of a polyline are:
• Linetype: which controls whether the polyline is drawn as a solid, dashed, dotted, or
dash-dotted line.
• Linewidth scale factor: which controls how thick the line is.
LW>1 thinner than standard line
LW<1, thicker than standard line.
• Polyline color index: which controls what color the line is.
Set polyline(N,X1,Y1) here
N is the number of points to be drawn.
X1 is X array
Y1 is Y array
X 0.0 2.0 4.0 6.0 8.0 10.0 12.0 14.0 16.4 17.0
Y 8.8 7.6 7.1 7.4 8.0 8.9 9.6 9.9 9.4 9.7
Set polylineindex(1……..4)
9. Graphics Standard Cont….
• Polymarkers
• The GKS polymarker function allows you to draw marker symbols centered at
coordinate points that you specify. The attributes that control the appearance of
polymarkers are:
• Marker: which specifies one of five standardized symmetric characters to be used for
the marker. The five characters are dot, plus, asterisk, circle, and cross.
1 - . (dot)
2 - + (plus)
3 - * (asterisk)
4 - o (circle)
5 - X (cross)
• Marker size scale factor: which controls how large each marker is (except for the dot
marker).
• Polymarker color index: which specifies what color the marker is.
• POLYMARKER(19, XDK, YDK)
X 15.7 17.0 17.7 17.3 15.3 13.0 11.0 9.0 7.0 4.7
Y 7.0 6.1 5.0 3.8 3.0 2.7 3.0 3.6 4.2 5.2
12. Graphics Standard Cont….
• Fill Area
• The GKS fill area function allows you to specify a polygonal shape of
an area to be filled with various interior styles. The attributes that
control the appearance of fill areas are:
• Fill area interior style: which specifies how the polygonal area
should be filled: with solid colors or various hatch patterns, or with
nothing, that is, a line is drawn to connect the points of the
polygon, so you get only a border.
• Fill area style index: If the fill area style is hatch, this index specifies
which hatch pattern is to be used: horizontal lines; vertical lines; left
slant lines; right slant lines; horizontal and vertical lines; or left slant
and right slant lines.
• Fill area color index, which specifies the color of the fill patterns or
solid areas.
15. Graphics Standard Cont….
• Text
• The GKS text function allows you to draw a text string at a specified
coordinate position. The attributes that control the appearance of
text are:
• Text font and precision: which specifies what text font should be
used for the characters and how precisely their representation
should adhere to the settings of the other text attributes.
• Character expansion factor: which controls the height-to-width
ratio of each plotted character.
• Character spacing: which specifies how much additional white
space should be inserted between characters in a string.
• Text color index: which specifies what color the text string should
be.
16. TEXT
• SET TEXT PATH(DOWN)
• SET TEXT PATH(UP)
• SET TEXT PATH(RIGHT)
• SET TEXT PATH(LEFT)
• TEXT(10, 17, 'GRAND HOTEL')