UNIT 2: Hardware - Kartik Patadiya

UNIT 2: Hardware - Kartik Patadiya
Shree C. O. Jani Institute of Technology, B.C.A. College
UNIT 2: Hardware
CG Unit: 2
[Marks: 14]
Topics covered in this material are as follow:
o Video Display Devices
o CRT Monitor
o Color CRT Monitor
o DVST (Direct View Storage Tubes)
o Flat Panel Displays
o Plasma Panels
o Thin-film Electroluminescent Display
o LED (Light Emitting Diode)
o LCD (Liquid Crystal Display)
o Input Devices
o Keyboard
o Mouse
o Trackball
o Spaceball
o Light pen
o Joystick
o Data glove
o Digitizers
o Image scanner
o Touch panels
o Voice system
o Hard-Copy Devices
o Printers
o Plotters
o Computer Graphics Card
o Computer Graphics Functions
Prepared By: Kartik Patadiya
Page 1
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
1. Cathode Ray Tubes (CRT)
Connector Pins
Deflection Plates
Coated Screen
Deflection Plates
Electron Beam
Mechanism of CRT Monitor
o A beam of electrons (cathode rays), emitted by an electron gun.
o Beam passes through focusing and deflection systems that direct the beam toward
specified positions on the phosphor-coated screen.
o The phosphor then emits a small spot of light at each position contacted by the electron
o Electric current is given to the CRT using connector pins.
o Electron gun is used to emit (generate) electron beams.
o Control grid is used to control the number of electrons to be generated.
o Focusing system will make electron to flow in line. (one by one).
o Accelerating anode will accelerate the speed of electron.
o Horizontal and vertical deflection plates used to change the direction of electrons leftright or top-bottom.
o Phosphor coated screen is used to display dot – called pixel.
o Persistence: How long the phosphor continues to emit light after the electron beam is
removed is known as persistence.
o Resolution: The maximum number of points that can be displayed without overlap on a
CRT is referred to as the resolution.
Color CRT Monitor
o A CRT monitor displays color pictures by using a combination of phosphors that emit
different-colored light.
o By combining the emitted light from the different phosphors, a range of colors can be
o The two basic techniques for producing color displays with a CRT are…
o Beam-penetration method and
o Shadow-mask method.
Prepared By: Kartik Patadiya
Page 2
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
o Beam-penetration method
o Beam-penetration method is used with random scan monitors.
o Two layers of phosphor, usually red and green, are coated onto the inside of the CRT
o The displayed color depends on how far the electron beam penetrates into the phosphor
o A beam of slow electrons excites only the outer red layer.
o A beam of very fast electrons penetrates through the red layer and excites the inner green
o At intermediate beam speeds, combinations of red and green light are emitted to show
two additional colors, orange and yellow.
o The speed of the electrons and hence the color at any point, is controlled by the beamacceleration voltage.
o Beam penetration has been an inexpensive way to produce color in random-scan
o Only four colors are possible (red, green, yellow, and orange), and the quality of pictures
is not as good as with other methods.
o Shadow-mask method
Prepared By: Kartik Patadiya
Page 3
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
Shadow-mask method is used in raster scan system (including color TV).
Provides wider range of colors than beam penetration method.
A shadow-mask CRT has three phosphor color dots at each pixel position.
One phosphor dot emits a red light, another emits a green light, and the third emits a blue
This type of CRT has three electron guns, one for each color dot, and a shadow-mask
grid just behind the phosphor-coated screen
Color CRTs in graphics systems are designed as RGB monitors.
These monitors use shadow-mask methods and take the intensity level for each electron
gun (red, green, and blue) directly from the computer.
High-quality raster-graphics systems have 24 bits per pixel in the frame buffer, allowing
256 voltage settings for each electron gun and nearly 17 million color choices for each
An RGB color system with 24 bits of storage per pixel is generally referred to as a fullcolor system or a true-color system.
2. Direct View Storage Tubes (DVST)
This is another approach of displaying picture.
Where picture information is stored just behind the phosphor coated screen.
2 electron guns are used in DVST.
The primary electron gun holds the picture information (pattern), and the second, the
flood gun, maintains picture display.
o DVST has both advantages and disadvantages compared to the CRT.
o Advantages of DVST
o No refreshing needed.
o Very complex picture can be displayed at high resolutions without flicker.
o Disadvantages of DVST
o The ordinarily do not display colors.
o Selected part of the picture cannot be erased.
o To eliminate a picture section, the entire screen must be erased and the modified picture
must be redrawn.
o For these reasons, DVST have been largely replaced by raster scan systems.
3. Flat Panel Display
o Flat panel displays are video devices that have reduced volume, weight, and power
requirements compared to a CRT.
o Thinner than CRT, We can hang them on the wall or wear them on the wrist.
o Current uses for flat-panel displays include small TV monitors, calculators, pocket
video games, laptop computers, etc.
o There are two types of flat panel display.
o 1. Emissive Display
o 2. Non Emissive Display
Prepared By: Kartik Patadiya
Page 4
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
o Emissive Display
o The emissive displays (or emitters) are devices that convert electrical energy into light.
o Plasma panels, thin-film electroluminescent displays, and Light-emitting diodes are
examples of emissive displays.
o Flat CRTs have also been devised as emissive displays but they have not proved to be
successful emissive displays.
o Non Emissive Displays
o Non emissive displays (or non emitters) use optical effects to convert sunlight or light
from some other source into graphics patterns.
o The most important example of a non emissive flat-panel display is a liquid-crystal
Plasma Panels
o Plasma panels are also called gas-discharge displays.
o They are constructed by filling the region between two glass plates with a mixture of
gases that usually includes neon.
o A series of vertical conducting ribbons is placed on one glass panel, and a set of
horizontal ribbons is built into the other glass panel.
o Firing voltages applied to a pair of horizontal and vertical conductors cause the gas at the
intersection of the two conductors to break down into a glowing plasma of electrons and
o Picture definition is stored in a refresh buffer, and the firing voltages are applied to
refresh the pixel positions 60 times per second.
o Alternating-current methods are used to provide faster application of the firing voltages,
and thus brighter displays.
o Separation between pixels is provided by the electric field of the conductors.
o One disadvantage of plasma panels has been that they were strictly monochromatic
devices, but systems have been developed that are now capable of displaying color and
Prepared By: Kartik Patadiya
Page 5
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
Thin-film Electroluminescent Display
o Similar in construction to a plasma panel displays.
o The region between glass panels are filled with phosphor such as zinc sulfide doped with
o A series of vertical conducting ribbons is placed on one glass panel, and a set of
horizontal ribbons is built into the other glass panel.
o When a sufficiently high voltage is applied to a pair of crossing electrodes, the phosphor
becomes a conductor in the area of the intersection of the two electrodes.
o Electrical energy is then absorbed by the manganese atoms, which then release the energy
as a spot of light similar to the glowing plasma effect in a plasma panel.
o Electroluminescent displays require more power than plasma panels and good color and
gray scale displays are hard to achieve.
LED (Light Emitting Diode)
Third type of emissive display is LED.
A matrix of diodes is arranged to form the pixel positions in the display.
Picture definition is stored in a refresh buffer.
As in scan-line refreshing of a CRT, information is read from the refresh buffer and
converted to voltage levels that are applied to the diodes to produce the light patterns in
the display.
LCD (Liquid Crystal Display)
o LCD is a type of non emissive display.
o LCD are normally used in small systems, such as calculators, laptop computers, etc.
o LCD produce picture by passing polarized light from surrounding or internal light source
through a liquid crystal material that can be aligned to either block or transmit the light.
o It contains two glass plates, each containing a light polarizer at right angles to the-other
plate, sandwich the liquid-crystal material.
Prepared By: Kartik Patadiya
Page 6
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
o Rows of horizontal transparent conductors are built into one glass plate, and columns of
vertical conductors are put into the other plate.
o The intersection of two conductors defines a pixel position.
o Picture definitions are stored in a refresh buffer, and the screen is refreshed at the rate of
60 frames per second, as in the emissive devices.
o There are two types of LCD
o Passive Matrix and
o Active Matrix
o Passive Matrix LCD
o When polarized light pass through the material is twisted so it will pass through
other polarizer and the light then will reflect back to the viewer, this type of flat
panel display is known as passive matrix LCD.
o Active Matrix LCD
o Another method for constructing LCD is to place a transistor at each pixel location, using
thin-film transistor technology.
o The transistors are used to control the voltage at pixel locations and to prevent charge
from gradually leaking out of the liquid-crystal cells.
o These devices are called active-matrix displays.
Input devices are used to provide input to the computer.
Many input devices are available to perform different kinds of input operations.
o Keyboard
o Mouse
o Trackball
o Spaceball
o Light pen
o Joystick
o Data glove
o Digitizers
o Image scanner
o Touch panels
o Voice system, etc.
1. Keyboard
o An alphanumeric keyboard on a graphics system is used primarily as a device for entering
text strings.
o The keyboard is an efficient device for inputting such non-graphic data as picture labels
associated with a graphics display.
o Keyboards can also be provided with features to facilitate entry of screen coordinates,
menu selections, or graphics functions.
o Cursor-control keys and function keys are common features on general purpose
Prepared By: Kartik Patadiya
Page 7
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
o Function keys allow users to enter frequently used operations in a single keystroke, and
cursor-control keys can be used to select displayed objects or coordinate positions by
positioning the screen cursor.
o Other types of cursor-positioning devices, such as a trackball or joystick, are included
on some keyboards.
o Additionally, a numeric keypad is often included on the keyboard for fast entry of
numeric data.
2. Mouse
o A mouse is small hand-held box used to position the screen cursor.
o Wheels or rollers on the bottom of the mouse can be used to record the amount and
direction of movement.
o Another method for detecting mouse motion is with an optical sensor.
o For these systems, the mouse is moved over a special mouse pad that has a grid of
horizontal and vertical lines.
o The optical sensor detects movement across the lines in the grid.
o One, two, or three buttons m usually included on the top of the mouse for signaling the
execution of some operation, such as recording cursor position or invoking a function.
o Most general-purpose graphics systems now include a mouse and a keyboard as the major
input devices.
3. Trackball
o As the name implies, a trackball is a ball that can be rotated with the fingers or palm of
the hand to produce screen-cursor movement.
o Potentiometers, attached to the ball, measure the amount and direction of rotation.
o Trackballs are often mounted on keyboards or other devices such as the Z mouse.
o Trackball is a two-dimensional positioning device.
4. Spaceball
o While a trackball is a two-dimensional positioning device, a spaceball provides six
degrees of freedom.
o Unlike the trackball, a spaceball does not actually move.
o Strain gauges measure the amount of pressure applied to the spaceball to provide input
for spatial positioning and orientation as the ball is pushed or pulled in various directions.
o Spaceballs are used for three-dimensional positioning and selection operations in virtualreality systems, modeling, animation, CAD, and other applications.
5. Joystick
o A joystick consists of a small, vertical lever (called the stick) mounted on a base that is
used to steer the screen cursor around.
o Most joysticks select screen positions with actual stick movement.
o Others respond to pressure on the stick.
o Some joysticks are mounted on a keyboard while others function as stand-alone units.
o There are two types of Joystick
o Moveable Joystick
o Pressure sensitive/Isometric Joystick
Prepared By: Kartik Patadiya
Page 8
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
o Moveable Joystick
o The distance that the stick is moved in any direction from its center position corresponds
to screen-cursor movement in that direction.
o Potentiometers mounted at the base of the joystick measure the amount of movement,
and springs return the stick to the center position when it is released.
o One or more buttons can be programmed to act as input switches to signal certain actions
once a screen position has been selected.
o In another type of movable joystick, the stick is used to activate switches that cause the
screen cursor to move at a constant rate in the direction selected.
o Eight switches, arranged in a circle, are sometimes provided, so that the stick can select
any one of eight directions for cursor movement.
o Pressure sensitive
o Pressure sensitive joysticks, also called isometric joysticks, have a non movable stick.
o Pressure on the stick is measured with strain gauges and converted to movement of the
cursor in the direction specified.
6. Data Glove
o Data glove can be used to grasp a "virtual" object.
o The glove is constructed with a series of sensors that detect hand and finger motions.
o Electromagnetic coupling between transmitting antennas and receiving antennas is used
to provide information about the position and orientation of the hand.
o Input from the glove can be used to position or manipulate objects in a virtual scene.
o A two-dimensional projection of the scene can be viewed on a video monitor, or a threedimensional projection can be viewed with a headset.
7. Digitizers
o A device which gives us a facility of drawing, painting and selecting coordinates of an
object is called digitizer.
o This device input coordinates of an object in three dimensional or two dimensional.
o Graphics tablet is one type of digitizer.
o It inputs two dimensional coordinates by hand cursor or stylus.
o Stylus is pencil shaped device which we have put on the tablet to find the position.
o Tablet size varies from 12 by 12 inches for desktop models to 44 by 60 inches or larger
for floor models.
o Graphics tablet consist of grid of wires stick in the tablet surface.
o Electromagnetic pulses are generated in the tablet and electric signal generated in the
active stylus or hand cursor to record tablet position.
o Acoustic graphics tablet use sound waves to find a stylus position.
o Stylus position is finding by calculating arrival time of sound at the different microphones
8. Image Scanner
o Drawings, graphs, color and black-and-white photos, or text can be stored for computer
processing with an image scanner by passing an optical scanning mechanism over the
information to be stored.
o The gradations of gray scale or color are then recorded and stored in an array.
Prepared By: Kartik Patadiya
Page 9
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
o Once we have the internal representation of a picture, we can apply transformations to
rotate, scale, or crop the picture to a particular screen area.
o We can also apply various image-processing methods to modify the array representation
of the picture.
o Some scanners are able to scan either graphical representations or text, and they come in a
variety of sizes and capabilities.
9. Touch Panels
o As the name implies, touch panels allow displayed objects or screen positions to be
selected with the touch of a finger.
o A typical touch panel shows graphical item to be selected.
o Some systems, such as the plasma panels are designed with touch screens.
o Other systems can be adapted for touch input by fitting a transparent device with a touch
sensing mechanism over the video monitor screen.
o Touch input can be recorded using optical, electrical, or acoustical methods.
o Optical Touch Panels
o Optical touch panels employ a line of infrared light-emitting diodes (LEDs) along one
vertical edge and along one horizontal edge of the frame.
o The opposite vertical and horizontal edges contain light detectors.
o These detectors are used to record which beams are interrupted when the panel is
o The two crossing beams that are interrupted identify the horizontal and vertical
coordinates of the screen position selected.
o Positions tin be selected with an accuracy of about ¼ inch with closely spaced LEDs, it is
possible to break down two horizontal or two vertical beams simultaneously.
o In this case, an average position between the two interrupted
o beams is recorded.
o The LEDs operate at infrared frequencies, so that the light is not visible to a user.
o Electrical Touch Panels
o An electrical touch panel is constructed with two transparent plates separated by a small
o One of the plates is coated with a conducting material, and the other plate is coated with a
resistive material.
o When the outer plate is touched, it is forced into contact with the inner plate.
o This contact creaks a voltage drop across the resistive plate that is converted to the
coordinate values of the selected screen position.
Acoustical Touch Panels
In acoustical touch panels, high-frequency sound waves are generated in
the horizontal and vertical directions across a glass plate.
Touching the screen causes part of each wave to be reflected from the finger to the
o The screen position at the point of contact is calculated from a measurement of the time
interval between the transmission of each wave and its reflection to the emitter.
Prepared By: Kartik Patadiya
Page 10
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
10. Light Pen
o Light pen is a pencil-shaped device that used to select screen positions by detecting the
light coming from points on the CRT screen.
o Other light sources, such as the background light in the room, are usually not detected by
a light pen.
o An activated light pen, pointed at a spot on the screen as the electron beam lights up that
spot, generates an electrical pulse that causes the coordinate position of the electron beam
to be recorded.
o As with cursor-positioning devices, recorded Light-pen coordinates can be used to
position an object or to select a processing option.
o Light pens have several disadvantages also.
o Light pens cannot detect positions inside black areas.
o Light pens sometimes give false readings due to background lighting in the room.
o Our hand also gets tired on long use of light pen.
11. Voice System
o Speech recognizers are used in some graphics workstations as input devices to accept
voice commands.
o The voice-system input can be used to initiate graphics operations or to enter data.
o These systems operate by matching an input against a predefined dictionary of words and
o A dictionary is set up for a particular operator by having, the operator speak the command
words to be used into the system.
o Each word is spoken several times, and the system analyzes the word and establishes a
frequency pattern for that word in the dictionary along with the corresponding function to
be performed.
o Later, when a voice command is given, the system searches the dictionary for a
frequency-pattern match.
o Voice input is typically spoken into a microphone mounted on a headset, The microphone
is designed to minimize input of other background sounds.
o If a different operator is to use the system, the dictionary must be reestablished with that
operator's voice patterns.
o We can obtain hard-copy output i.e. output on paper or as photograph, for our images and
text using the following devices.
o Printer
o Plotter
o The quality of the pictures obtained from a device depends on dot size and the number of
dots per inch, or Lines per inch, that can be displayed.
1. Printers
o Printers produce output by either impact or nonimpact methods.
o Impact printer press formed character faces against an inked ribbon onto the paper.
o A line printer is an example of an impact device, with the typefaces mounted on bands,
chains, drums, or wheels.
Prepared By: Kartik Patadiya
Page 11
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
o Nonimpact printers use laser techniques, ink-jet sprays, xerographic processes (as used
in photocopying machines), electrostatic methods, and electro thermal methods to get
images onto paper.
o Following types of printers are available.
o Dot-matrix Printer
o Ink-jet Printer
o Laser Printer
o Dot-matrix Printer
o Character impact printers often have a dot-matrix print head containing a rectangular
array of protruding wire pins, with the number of pins depending on the quality of the
o Individual characters or graphics patterns are obtained by retracting certain pins so that
the remaining pins form the pattern to be printed.
o Ink-jet Printer
o Ink-jet methods produce output by squirting (spraying) ink in horizontal rows across a
roll of paper wrapped on a drum.
o The electrically charged ink stream is deflected by an electric field to produce dot-matrix
o Laser Printer
o In a laser device, a laser beam creates a charge distribution on a rotating drum coated with
a photoelectric material, such as selenium.
o Toner is applied to the drum and then transferred to paper.
2. Plotters
o A plotter is a special output device used to produce hardcopies of graphs and designs on
the paper.
o A plotter is typically used to print large-format graphs or maps such as construction maps
or engineering drawings.
o Plotters differ from printers in that they draw lines using a pen.
o As a result, they can produce continuous lines, whereas printers can only simulate lines
by printing a closely spaced series of dots.
o There are two types of plotters.
o Pen Plotter
฀ Drum Plotter
฀ Flatbed Plotter
o Electrostatic Plotter
Pen Plotter
Drafting layouts and other drawings are typically generated with pen plotters.
A pen plotter has one or more pens mounted on the crossbar, that spans a sheet of paper.
Pens with varying colors and widths are used to produce a variety of shadings and line
o Wet-ink, ball-point, are all possible choices for use with a pen plotter.
o Plotter paper can lie flat or be rolled onto a drum or belt.
Prepared By: Kartik Patadiya
Page 12
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
o Crossbars can be either moveable or stationary, while the pen moves back and forth along
the bar.
Drum - Pen Plotter
This plotter uses drum on which paper is maintained.
The paper is fixed on the drum by the pins present in the drum.
The pins are used to prevent paper from slipping.
As a command plotting is given the drum start rotating along with the paper and the pen
which is fixed perpendicular to the drum starts writing on the paper.
o The paper drum can rotate forward and backward.
Flatbed – Pen Plotter
This type of plotter moves in X and Y direction on the paper fixed on the flat surface.
The pen is positioned at the start of line(0,0) and moves lower down to the paper.
Paper is fixed on the table and is held down by the plotter.
Size available from 12 to 18 inches up to 10 fit or larger depending upon the requirement.
o Electrostatic Plotter
o An electrostatic device present on the plotter places negative charge on the paper, one
complete row at a time along the length of the paper.
o Then the paper is exposed to a toner.
o The toner present in the plotter contains positive charge.
o The toner is positively charged and so is attracted to the negatively charged areas, where
it holds to produce the specified output.
o Graphics card is an expansion card which generates a feed of output images to a display.
o Computer graphics card also known as video card, display card, display adaptor or
graphics adaptor.
o Most graphics cards offer various functions such as accelerated rendering of 3D scenes
and 2D graphics, MPEG-2/MPEG-4 decoding, TV output, or the ability to connect
multiple monitors.
o Video hardware can be integrated into the motherboard or the CPU, but all modern
motherboards provide expansion ports to which a video card can be attached.
o In this configuration it is sometimes referred to as a video controller or graphics
o Some graphics card includes graphics chipset.
o This graphics chip usually has a small quantity of embedded memory and takes some of
the system's main RAM, reducing the total RAM available, is called integrated graphics
or on-board graphics, and is usually low in performance and undesirable for those
wishing to run 3D applications.
o A dedicated graphics card on the other hand has its own Random Access Memory or
RAM and Processor specifically for processing video images.
o A Graphics card’s job is very complex.
Prepared By: Kartik Patadiya
Page 13
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
o How Graphics card works?
o The CPU, working in conjunction with software applications, sends information about the
image to the graphics card.
o The graphics card decides how to use the pixels on the screen to create the image.
o It then sends that information to the monitor through a cable.
o Creating an image out of binary data is a demanding process.
o To make a 3D image, the graphics card first creates a wire frame out of straight lines.
o Then it feels the remaining image using raster scan system.
o It also adds lighting, texture and color.
o For fast-paced games, the computer has to go through this process about sixty times per
o Without a graphics card to perform the necessary calculations, the workload would be too
much for the computer to handle.
o Components of Graphics Card
o Components/Requirements of Graphics Card is as follows:
o Graphics Processing Unit
o Heat Sink
o Video BIOS
o Video Memory
o Outputs
o Motherboard interface
o Power Demand
o Graphics Processing Unit
o A GPU is a dedicated processor optimized for accelerating graphics.
o The processor is designed specifically to perform floating-point calculations, which are
fundamental to 3D graphics rendering and 2D picture drawing.
o The main attributes of the GPU are the core clock frequency, which typically ranges from
250 MHz to 4 GHz and the number of pipelines (vertex and fragment shaders), which
translate a 3D image characterized by vertices and lines into a 2D image formed by
o Heat Sink
o A Heat Sink Is mounted on high performance graphics cards.
o A heat sink spreads out the heat produced by the graphics processing unit evenly
throughout the heat sink and unit itself.
o The heat sink commonly has a fan mounted as well to cool the heat sink and the graphics
processing unit.
o Video BIOS
o The video BIOS or firmware contains the basic program, which is usually hidden, that
governs the video card's operations and provides the instructions that allow the computer
and software to interact with the card.
o It may contain information of the memory timing, operating speeds and voltages of the
graphics processor, RAM, and other information.
Prepared By: Kartik Patadiya
Page 14
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
o Video Memory
o The memory capacity of most modern video cards ranges from 128 MB to 8 GB, Since
video memory needs to be accessed by the GPU and the display circuitry.
o It often uses special high-speed or multi-port memory, such as VRAM, WRAM,
SGRAM, etc.
o Around 2003, the video memory was typically based on DDR technology.
o During and after that year, manufacturers moved towards DDR2, GDDR3, GDDR4 and
o The effective memory clock rate in modern cards is generally between 400 MHz and
3.8 GHz
o Video memory may be used for storing other data as well as the screen image.
o The RAMDAC, or Random Access Memory Digital-to-Analog Converter, converts
digital signals to analog signals for use by a computer display that uses analog inputs such
as Cathode ray tube (CRT) displays.
o The RAMDAC is a kind of RAM chip that regulates the functioning of the graphics card.
There are certain devices that helps in generating output from computer graphics cards
Video Graphics Array (VGA)
Digital Visual Interface (DVI)
Video in Video out (VIVO) for composite video
High-definition Multimedia Interface (HDMI)
Display Port
Connection systems
o Motherboard interface
o Bus is used to connect graphics card with motherboard.
o Power Demand
o As the processing power of video cards has increased, so has their demand for electrical
o Current high-performance video cards tend to consume a great deal of power.
o While CPU and power supply makers have recently moved toward higher efficiency,
power demands of GPUs have continued to rise, so the video card may be the biggest
electricity user in a computer.
1. line(x1, y1, x2, y2)
o Used to draw line.
o Accepts starting point (x1,y1) and ending point (x2,y2) of line.
o Ex: line(100, 100, 300, 300);
2. rectangle(tlx, tly, brx, bry)
o Used to draw rectangle.
o Accepts coordinate for top left corner (tlx, tly) and bottom right corner (brx, bry).
o Ex: rectangle(100, 100, 300, 300);
Prepared By: Kartik Patadiya
Page 15
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
3. circle(cx, cy, r)
o Used to draw circle
o Accepts coordinate for center point (cx, cy) and radius (r).
o Ex: circle(320,240,100);
4. arc(cx, xy, sAngle, eAngle, r)
o Used to draw arc.
o Accepts coordinate for center point (cx, cy), starting angle (sAngle) and ending angle
(eAngle) of arc and radius (r) of arc.
o Ex: arc(320, 240, 0, 90, 150);
5. ellipse(cx, cy, sAngle, eAngle, xr, yr)
o Used to draw ellipse
o Accepts coordinate for center point (cx, cy), starting angle (sAngle) and ending angle
(eAngle) for ellipse and horizontal radius (xr) and vertical radius (yr).
o Ex: ellipse(320,240,0,360,100,200);
6. outtext(char *str)
Used to display text at current coordinate position.
Accepts string (char *str) as an argument.
Ex: outtext(“hello”);
Ex: outtext(str);
7. outtextxy(x, y, char *str)
o Used to display text at particular position.
o Accepts coordinate to display text at particular position (x, y) and string (char *str) to
be displayed.
o Ex: outtextxy(320, 240, ”hello”);
o Ex: outtextxy(320, 240, str);
8. setcolor(c)
Used to set drawing color.
Accepts color (c) as argument, which can be color code or color name.
Range of color code is 0 to 15.
Ex: setcolor(15);
Ex: setcolor(WHITE);
Color name
Light gray
Prepared By: Kartik Patadiya
Color name
Dark gray
Light blue
Light green
Light cyan
Light red
Light magenta
Page 16
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
9. setbkcolor(c)
Used to set background color of a screen.
Accepts color (c) as argument, which can be color code or color name.
Range of color code is 0 to 15.
Ex: setbkcolor(0);
Ex: setbkcolor(BLACK);
10. getmaxx( )
o Returns maximum of X coordinate.
o Ex: cout<<getmaxx();
11. getmaxy( )
o Returns maximum of Y coordinate.
o Ex: cout<<getmaxy();
12. getcolor( )
o Returns current drawing color.
o Ex: cout<<getcolor();
13. getbkcolor( )
o Returns current background color.
o Ex: cout<<getbkcolor();
14. cleardevice( )
o Used to clear all graphics and move the current position to left top corner.
o Ex: cleardevice();
15. closegraph( )
o Used to shut down the graphics system.
o Ex: closegraph();
16. getx( )
o Returns the X coordinate value of current position.
o Ex: cout<<getx();
17. gety( )
o Returns the Y coordinate value of current position.
o Ex: cout<<gety();
18. getmaxcolor( )
o Used to get the maximum number of color supported by graphics system.
o Ex: cout<<getmaxcolor();
19. delay(n)
o Used to suspend the operation for n millisecond.
o Available in dos.h header file.
Prepared By: Kartik Patadiya
Page 17
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
o Ex: delay(1000);
20. putpixel(x, y, c)
o Used to draw a pixel.
o Accepts coordinate (x, y) to draw a pixel on the specific position and color (c).
o Ex: putpixel(320, 240, 15);
21. lineto(x, y)
o Used to draw line from the current position.
o Accepts the ending point (x, y) and draw line from current coordinate to the ending
o Ex: lineto(100,100);
22. moveto(x, y)
o Used to move the current position to (x, y).
o Ex: moveto(100,100);
23. getpixel(x, y)
o Returns the color of the pixel located on (x, y) coordinate.
o Ex: cout<<getpixel(100, 100);
24. sector(cx, cy, sAngle, eAngle, xr, yr)
o Used to draw filled elliptical shape.
o Accepts center point (cx, cy), starting angle (sAngle) and ending angle (eAngle),
horizontal radius (xr) and vertical radius (yr).
o Ex: sector(320, 240, 0, 90, 100, 50);
25. linerel(x, y)
o Used to draw a line to relative distance.
o For ex. If current position is on (100,100), then linerel(200,200) will draw a line from
(100,100) to (300,300).
26. moverel(x, y)
o Used to move current position to relative distance.
o For ex. If the current position is on (100,100), then moverel(200,200) will move the
current position to (300,300);
27. bar(tlx, tly, brx, bry)
o Used to draw a bar that is used in bar-chart.
o Accepts coordinate for top left corner (tlx, tly) and bottom right corner (brx, bry).
o Ex: bar(100,100,400,200);
28. bar3d(tlx, tly, brx, bry, depth, topflag)
o Used to draw a 3D bar used in bar-chart.
o Accepts coordinate for top left corner (tlx, tly), bottom right corner (brx, bry), depth
of bar, and topflag.
o Value of topflag can be 0 or 1.
o Ex: bar3d(100,100,200,400,5,1);
Prepared By: Kartik Patadiya
Page 18
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
29. settextjustify(horizontal, vertical)
o Used to set the text justify.
o For horizontal justification
o 0 => left-text
o 1 => center-text
o 2 => bottom-text
o For vertical justification
o 0 => bottom-text
o 1 => center-text
o 2 => top-text
o Ex: settextjustify(1,1);
30. setlinestyle(style, upat, thickness)
o Used to set the line style.
o For style attribute
o 0 => solid line
o 1 => dotted line
o 2 => center line
o 3 => dashed line
o Value of upat will be 1.
o Thickness is the number of pixel that is used to define the thickness of line.
o If invalid values are passed to setlinestyle(), it will draw a line of default style.
o Setlinestyle() will affect all the line drawing functions like lineto(), linerel(),
drawpoly(), etc.
o Ex: setlinestyle(1,1,3);
31. fillellipse(cx, cy, xr, yr)
Used to draw filled ellipse.
Accept center point (cx, cy) and horizontal radius (xr) and vertical radius (yr).
It will draw and fill the ellipse with the current fill style.
Ex: fillellipse(320,240,100,50);
32.settextstyle(font, direction, size)
o Used to set the font, direction and size of text to be displayed.
o Font will accept the value starting from 0 to 10.
o For direction
o 0 => Horizontal direction (left to right)
o 1 => Vertical direction (bottom to top)
o Size can be starting from 0 to ten times the normal font size.
o Ex: settextstlyle(3,1,3);
33. initgraph(int *graphics_driver, int *graphics_mode, char *pathtodriver)
o Initgraph() initialize the graphics system by loading a graphics driver from disk than
putting the system into graphics mode.
o This function is available on graphics.h header file.
o Ex: initgraph(&gd, &gm, “C:\\TC\\BGI”);
Prepared By: Kartik Patadiya
Page 19
Shree C. O. Jani Institute of Technology, B.C.A. College
CG Unit: 2
Graphics Driver:
It is used to define graphics driver.
You can define graphics driver by value.
But usually we use DETECT value for automatically set the graphics driver.
o Graphics Mode:
o Integer that specified the initial graphics mode.
o If graphics driver =DETECT, initgraph() sets *graphics mode to the highest resolution
available for the detected driver.
o Path to driver:
o It specifies the directory path where graphics drivers are store.
o If they are not there, initgraph() looks in the current directory.
34. kbhit( )
It checks if the keystroke is currently available or not.
If keystroke is not available it will return 0 otherwise 1.
This function is available in conio.h header file.
Ex: while(!kbhit())
35. textheight(char *str)
o It returns the height of a string.
o Ex: cout<<textheight(“hello”);
36. textwidth(char *str)
o It returns the width of a string.
o Ex: cout<<textwidth(“hello”);
37. drawpoly(n+1, poly)
o Used to draw a polygon.
o Accept n+1 which determines the number of edges+1.
o Poly is an array that will contain the coordinate values for starting and ending of each
o The size of array will be (n+1) * 2.
o Ex: int poly[10]={100,100,400,100,400,400,100,400,100,100};
o drawpoly(5, poly);
o Above example will draw a rectangle.
38. fillpoly(n+1, poly)
o Used to fill the polygon, drawn using drawpoly.
o Syntax is same as that of drawpoly().
o Ex: fillpoly(5, poly);
Prepared By: Kartik Patadiya
Page 20
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF