Friday 12 August 2016

CTCPS LAB@HOME 10 ~ gniithelp

CTCPS LAB@HOME


CLICK HERE TO DOWNLOAD

Read More »

CTCPS LAB@HOME 9 ~ gniithelp

CTCPS LAB@HOME


CLICK HERE TO DOWNLOAD

Read More »

CTCPS LAB@HOME 8 ~ gniithelp

CTCPS LAB@HOME


CLICK HERE TO DOWNLOAD

Read More »

CTCPS LAB@HOME 7 ~ gniithelp

CTCPS LAB@HOME


CLICK HERE TO DOWNLOAD

Read More »

CTCPS LAB@HOME 6 ~ gniithelp

CTCPS LAB@HOME


CLICK HERE TO DOWNLOAD

Read More »

CTCPS LAB@HOME 5 ~ gniithelp

CTCPS LAB@HOME


CLICK HERE TO DOWNLOAD

Read More »

CTCPS LAB@HOME 4 ~gniithelp

CTCPS LAB@HOME


CLICK HERE TO DOWNLOAD

Read More »

CTCPS LAB@HOME 3 ~ gniithelp

CTCPS LAB@HOME


CLICK HERE TO DOWNLOAD

Read More »

CTCPS LAB@HOME 2 ~ gniithelp

CTCPS LAB@HOME


CLICK HERE TO DOWNLOAD

Read More »

CTCPS LAB@HOME 1 ~ gniithelp

CTCPS LAB@HOME


CLICK HERE TO DOWNLOAD

Read More »

WSMOI LAB@HOME 8 ~ gniithelp

WSMOI LAB@HOME


CLICK HERE TO DOWNLOAD

Read More »

WSMOI LAB@HOME 7 ~ gniithelp

WSMOI LAB@HOME


CLICK HERE TO DOWNLOAD

Read More »

WSMOI LAB@HOME 6 ~ gniithelp

WSMOI LAB@HOME


CLICK HERE TO DOWNLOAD

Read More »

WSMOI LAB@HOME 5 ~ gniithelp

WSMOI LAB@HOME


CLICK HERE TO DOWNLOAD

Read More »

WSMOI LAB@HOME 4 ~ gniithelp

WSMOI LAB@HOME


CLICK HERE TO DOWNLOAD

Read More »

WSMOI LAB@HOME 3 ~ gniithelp

WSMOI LAB@HOME


CLICK HERE TO DOWNLOAD

Read More »

WSMOI LAB@HOME 2 ~ gniithelp

WSMOI LAB@HOME


CLICK HERE TO DOWNLOAD

Read More »

WSMOI LAB@HOME 1 ~ gniithelp

WSMOI LAB@HOME


CLICK HERE TO DOWNLOAD

Read More »

SOFTWARE ENGINEERING SAMPLE TEST ~ gniithelp

SOFTWARE ENGINEERING SAMPLE TEST


CLICK HERE TO DOWNLOAD

Read More »

Tips and Tricks ~ gniithelp

HOW TO PLAY HIDDEN SNAKE GAME ON YOUTUBE

We all visit youtube and watch videos but how many of us are aware of youtube.

hidden Snake game. 

I believe only a few people know about this hidden snake.

game You can play this game on youtube while streaming any video.

 Snake game is one of the most interesting and traditional game in the world of gaming. 

In this tutorial I will show you how you can 

play this game on youtube.


i). Go to youtube and open any video for streaming

ii). When the video is streaming
 Hold Left button of mouse + Left arrow on keyboard + Top arrow on keyboard.

iii). Now you will see that the streaming circle starting to move like a snake.


iv). You can control the movements of the snake using arrow keys of your keyboard.

v). Try to play this game on youtube with videos having some dark background to increase
      visibility.

Read More »

Graphics and Multimedia Subject Code: BSIT-51 ~ gniithelp

Question1-: Define computer Graphics? With illustration give meaning to the term “Interactive” in computer Graphics.

Answer-: Computer Graphics can be defined as “use of computer to define, store, manipulate, interrogate and present pictorial output of the data”. The term “interactive graphics” refers to devices and systems that facilitate the man-made graphics communication, in a way, which is more convenient than the writing convention. For example, to draw a straight line between two points, one has to input the coordinates of the end points. In interactive graphics with the help of graphical input technique by indicating two end points on the display screen draws the line.

Question2-: With illustrative example, explain how Operating System, Programming Language, and Hardware support the Computer Graphics.

Answer-: MS-DOS has improved graphical interface in the form of MS-DOS shell. The shell allows one to manage programs and switch between them, view the directory structure of any disk, view the contents of several directories and navigate through files and directories quickly.
 Windows 3.x has a variety of factors: easy-to-use GUI, Multitasking, capability to access a large amount of memory, integrated application environment, networking, extensive hardware support, device independence, and DOS compatibility. These factors are significant for users and developers.
UNIX has adopted to the new hardware architecture and application requirement by incorporating new functionalities like distributed file system, X11 based GUIs, Multithreading, distributability etc.
 PASCAL and C are structured language, rich in expressive power and applicable to a wide variety of users. Because of the rich set of graphical functions available in these languages help in design of graphical applications .The code is small, fast, portable and flexible. C has become a choice for today’s professional, developers and also for Graphic programming.
 Mouse is a small handled box used to position the screen cursor. It has two wheels at right angles to each other. Each of these wheels is connected to the shaft encode. For every incremental rotation of the wheel, an electrical signal is produced by the shaft encode.
  Track Ball Two orthogonal wheels controlling the potentiometers are given b y the tracker ball. If the ball is moved at right angles to the direction of the wheels then that wheel is not affected.

Question3-: With the help of example the working principle of Cathode Ray Tube.

Answer-:   Cathode ray tube is based on the simple concept that an electronic beam, when hit a phosphorescent surface, produces a beam of light .Further, the beam of light itself can be focused to any point on the screen by using suitable electronic/magnetic fields. The direction and intensity of the fields will allow one to determine the extent of the deflection of the beam. Further these electronic/magnetic fields can be easily manipulated by using suitable electric fields with this background. The electron gun produces a stream of electrons. The beam itself can be switched on/off easily by switching on/off the heating system. The beam itself is focused towards the phosphor-coated screen. The point where the beam hits the screen becomes phosphorescent and produces a speck of light.
 

Question4-: Differentiate Raster and Random Scanning Technique.

Answer-:  In Raster scan display, the electron bam is swept across the screen, one row at a time from top to bottom. The picture definition is stored in a memory area called refresh buffer or frame buffer. In random scan display unit, a CRT has the electron beam directed only to the parts of the screen where a picture is to be drawn. It draws a picture one line at a time and so it is referred to as vector displays.



Question5-: List the different built in graphics function available in “C” programming language along with the syntax of each function.

Answer-:            Function                                     Syntax
                        setpalatte()                 setpalatte(int index,int color)
                        putpixel ()                   putpixel(int x,y,int color)
                        getpixel()                    getpixel(int x,int y)
                        moveto()                     moveto(int x, y)
lineto()                       lineto(int x,int y)
line()                         lineto(int x1,int y1,int x2,inty2)
circle()                       circle(int x, int y,radius)
setcolor()                    setcolor(int color)

Question6-:   Write a “C” program to stimulate the Kite movement.

Answer-:            #include<std.h>
                        #include<conc.h>
                        #include<math.h>
                        #include<graphics.h>
                        void main()
                        {
                        int gd,gm;
                        char *buf;
                        gd=DETECT;
                        gm=4;
                        init graph(&gd,&gm, “c:\\tc\\bgi”);
                        cleardevice();
                        rectangle(320,20,320,160);
                        line(320,20,320,160);
                        setfillstyle(SOLID_FILL,LIGHTRED);
                        floodfill(280,90,getmaxcolor());
                        setfillstyle(SOLID_FILL,BLUE);
                        floodfill(360,90,getmaxcolor());
                        setcolor(WHITE);
                        circle(320,90,20);
                        setfillstyle(SOLID_FILL,YELLOW);
                        floodfill(360,90,getmaxcolor());
                        restorecrtmode();
                        getch();
                        }

Question7-:   Write a “C” program to stimulate the movement of car.

Answer-:
                        #include<std.h>
                        #include<conc.h>
                        #include<math.h>
                        #include<graphics.h>
                        void main()
                        {
                        int gd,gm;
                        char *buf;
                        gd=DETECT;
                        gm=4;
                        init graph(&gd,&gm, “c:\\tc\\bgi”);
                        cleardevice();
                        rectangle(80,50,160,100);
                        gotoxy(50,150);
                        lineto(80,100);
                        gotoxy(200,150);
                        lineto(160,100);
                        circle(60,150,30);
                        circle(100,150,30);
                        restorecrtmode();
                        getch();
                        }
-----------------------------------------------------------------
Solutions to Chapter One Questions

8. What is the need for computer graphics?
Ans.
Graphical communication is an old and more popular method of exchanging information than verbal communication and is more convenient when computers are utilized for this purpose.
As the volume of information increases, problem of storage arises. Also, in the 21st century people do not have time to read huge number of pages. This problem was solved by computer graphics. This can be clearly understood with the help of an example where twe want to present the performance of a factory since 1980. For this,we require a number of pages to render this large volume of information related with financial, numerical and statistical information. It will take a lot of time to analyze such a long report. We can easily represent this data in a pictorial form thus making it simple to understand. Pictures can represent a huge database in the form of bar charts, pie charts, and so on.
Two other prominent applications of graphics are in the field of Computer Aided Design (CAD) and Computer Aided Manufacturing (CAM).  In CAD, graphics techniques are used to produce the drawings of certain parts of a machine from any viewing angle. In CAM computer graphics techniques, one may display the manufacturing layout for a given part and trace the path taken by machine tools for a given manufacturing process.


9. Define computer graphics and Interactive computer graphics?
Ans.
Computer graphics can be defined as the use of computers to define, store, manipulate, interrogate, and present pictorial output of the data.
Interactive computer graphics refers to devices and systems that facilitate the man-machine graphic communication.

10. Briefly, narrate the history of graphics hardware technology?
Ans.
In early days, the high cost of the hardware for computer graphics remained the obstacle, which prevented their widespread use. Computers have been getting progressively more inexpensive and it has become a household article these days. The microelectronics revolution and the subsequent reduction in the price of the digital hardware have completely changed the situation. Due to this price reduction, it is now realistic to expect that all computers with graphic display hardware capability will be making extensive use of computer graphics.
The announcement of the IBM personal computer using 16-bit Intel 8088 microprocessor on August 12, 1981, can be regarded as a historic event, which had a profound effect in the world of computers. These computers significantly improved the state of display technology in the world of computers.
The next major change in PC display technology was announced by Apple Company in 1984, when it introduced the Macintosh PC. It was the first PC that did not include a text-based display but provided only a graphic display. The application programs developed for the Macintosh advocated WYSIWYG (What You See Is What You Get) style of interface. This concept has become a basic requirement in the area of desktop publishing (DTP). The PowerPC's from IBM, Apple, and other vendors created a new standard for DTP computers. With such a development, computer graphics and multimedia has become a necessity for all types of users.

11. How to make graphics processing faster?
Ans.
Video/Graphic processing can be made faster in two ways: by using a graphic co-processor and a graphic accelerator. The graphic co-processor boosts video performance by assuming tasks normally handled by the CPU. An accelerator takes control of graphic task, which are otherwise performed by the CPU. However, an accelerator is not programmable. It is a functioned processor, which caries out specific tasks hard-coded into the chip.

12. What is graphics processor? Why it is needed?
Ans.
Graphics processor helps in managing the screen faster with an equivalent software algorithm executed on the CPU. Through the use of these processors certain amount of parallelism can be achieved for executing graphic commands. Several manufacturers of personal computers use a proprietary graphics processor.

13. Name some graphics processors?
Ans.
Some graphics processors are:
n  Intel 82786
n  Texas Instruments 43010


14. Justify the statement "Windows OS is so popular"?
Ans.
The Windows OS is popular because it supports a graphical user interface (GUI), in which users can perform operations with the help of graphical objects such as windows and buttons. Apart from an intuitive GUI, it supports various other features such as support for integrated application environment, multitasking, multimedia, and networking.

15. What are the strengths of UNIX operating system?
Ans.
The Unix operating system has been known and popular as a simple, small, portable, powerful, time-sharing operating system. However, now it has also gained commercial strength. It is still the most portable and configurable of all operating systems. Unix has adopted to the new hardware architecture and application requirements by incorporating new functionalities such as distributed file system, X11 base GUIs, Multi threading, distributability and so on. Unix became quite popular within Bell Labs.

16. What is a pixel?
Ans.
Pixel may be defined as the smallest size object or color spot that can be displayed and addressed on a monitor.

17. Give the different applications of Computer Graphics?
Ans.
Computer graphics is used in every field. Some of the major application areas are:
a.     Building design and construction
b.     Electronic Design
c.     Mechanical Design
d.     Entertainment and Animation
e.     Aerospace industry
f.     Medical Technology
g.     Cartography
h.     Art and Commerce.

18. Name the Computer languages that support Computer Graphics?
Ans.
Some languages that support computer graphics are:
a.     FORTRAN
b.     BASIC
c.     PASCAL
d.     C


19. Why C language is popular for graphics programming?
Ans.
C has become a choice for today's professionals, developers for graphics programming. C is a structured language and is rich in expressive power and applicable to a wide variety of users. Because of the rich set of graphical functions available, this language helps in designing for graphical applications. The C code is small, fast, portable, and flexible.

FAQ
20. What are real time computer graphics?
Ans:
Real time graphics deal with producing images in real time. An example of real time graphics is creating scenes for video games. They are used in simulating real life actions. For this reason they are used extensively in the entertainment industry.

21. What is Computer-Generated Imagery (CGI)?
Ans:
CGI is the application of computer graphics for creating special effects. A common use of CGI is in creating action effects or crowd in movie shoots.

22. Give some of the features of Windows OS?
Ans:
Some of the features of Windows OS are:
n  Easy-to-use GUI
n  Multitasking
n  Integrated application environment
n  Extensive hardware support
n  Networking
n  Device independence
n  DOS compatibility
 23What is meant by CGM?
Ans:
The mechanism called CGM (Computer Graphics Metafiles) provides for the exchange of pictures between applications. It supports bitmap facility for the creation and manipulation of graphics images.
------------------------------------------------------------------------------------------------------------
Solutions to Chapter Two Questions
24. Compare the merits and demerits of raster and random scanning system?
Ans.
1.       In raster scan display, the electron beam is swept across the screen, one row at a time from top to bottom.
Random scan monitors draw a picture one line at a time and so they are also referred to as vector displays.
2.       Refreshing on raster scan display is carried out at the rate of 60 to 80- frames per second. Refresh rate on a random scan system depends on the number of lines to be displayed.
3.       The picture definition is stored in a memory area called refresh buffer or frame buffer in case of a raster scan display. In case of random scan display, picture definition is stored as a set of line-drawing commands in an area of memory referred to as the refresh display file. Refresh display file is also called the display list, display program, or the refresh buffer.

25. Define pixel, resolution, and aspect ratio?
Ans.
Pixel can be defined as the smallest size object or color spot that can be displayed and addressed on a monitor.
Image resolution refers to pixel spacing that is the distance from one pixel to the next pixel.
The aspect ratio of the image is the ratio of the number of X pixels to the number of Y pixels. The standard aspect ratio for PC’s is 4:3 and some use 5:4.


26. Explain the principle of drawing pictures on CRT?
Ans.
In CRT, an electron gun produces a stream of electrons. This electron beam can be switched on/off through a heating system. The electron beam is focused towards the phosphor coated screen. The point where the beam hits the screen becomes phosphorent and produces a speck of light. A pair of focusing grids,  focus the beam to a particular point on the screen. The grid controls the focusing with the help of magnetic/electric fields. In this way a whole picture can be drawn by illuminating the points on the screen.

27. Explain briefly the working principle of Shadow mask CRT?
Ans.
The Shadow Mask CRT is based on the principle of combining the basic colors - red, green and blue. The shadow mask CRT, instead of using one electron gun, uses three different guns placed adjacent to each other to form a triangle or a "Delta". Each pixel point on the screen is made up of three types of phosphors to produce red, blue, and green colors. Just in front of the phosphor screen, is a metal screen, called a "shadow mask". This plate has holes placed strategically, so that the beams from the three electron guns are focused on particular color- producing pixel only.
Now, unlike the beam penetration CRT’s, the acceleration of the electron beam was being monitored, one can manipulate the intensity of the three beams simultaneously. If the red beam is made more intense, we get more of red color in the final combination etc. Since fine-tuning of the beam intensities is comparatively simple, we can get much more combination of colors than the beam penetration case.

28. Explain the principle of DVST system?
Ans.
The Direct View Storage Tube (DVST) behaves like a CRT with highly persistent phosphor. Pictures drawn on this screen will be seen for several minutes (40-50 minutes) before fading. It is similar to a CRT as far as the electronic gun and phosphor-coated mechanisms are concerned. However, instead of the electron beam directly writing the pictures on the phosphor coated CRT screen, the writing is done with the help of a fine-mesh wire grid. The grid made of very thin, high quality wire is located with a dielectric and is mounted just before the screen on the path of the electron beam from the gun. A pattern of positive charges is deposited on the grid and this pattern is transferred to the phosphor coated CRT by a continuous flood of electrons. This flood of electrons is mounted by a "flood gun", which is  separate from the electron gun that produces the main electron beam.

29. What are the different graphical input interactive techniques?
Ans.
Following are the various graphical input interactive techniques:
a.     Positioning
b.     Constraints
c.     Grids
d.     Gravity Field
e.     Rubber band methods
f.     Dragging


30. Why refreshing is required in CRT?
Ans.
When an electron beam strikes a dot of phosphor material, it glows for a fraction of a second and then fades. As brightness of the dots begins to reduce, the screen image becomes unstable and gradually fades out. In order to maintain a stable image, the electron beam must sweep the entire surface of the screen and return to redraw it number of times per second. That is, the screen must be refreshed multiple times in a second.

31. Name the different positioning devices?
Ans.
The various positioning devices are:
n  Mouse
n  Tablet
n  Joystick
n  Digitizer
n  Light pen
n  Track ball

32. What are pointing devices? Give examples?
Ans.
A pointing device is a hardware peripheral that allows user to point to objects on the screen and perform operations on them, such as selecting, clicking, moving, and dragging. Mouse is an example of pointing device.

33. Explain the working principle of Mouse?
Ans.
A mouse is a small handled box used to position the screen cursor. It has two wheels at right angles to each other. Each of these wheels is connected to the shaft encode. For every incremental rotation of the wheel, an electrical signal is produced by the shaft encode. As the device is moved on a flat surface, the movement is coded in the x and y directions by counting the number of pulses received from the shaft encoder. These values are held in separate registers and the computer can sample them at a suitable rate. The device can, therefore, be used for a moving cursor around the display screen.

34. Explain the working of Light pen along with a diagram.
Ans.
Light pen has a very simple working. Every pixel on the screen that is a part of the picture emits light. All that the light pen does is to make use of this light signal to indicate the position. A small aperture is held against the portion of the picture to be modified and the light from the pixels falls on a photocell, after passing through the aperture. This photocell converts the light signal received from the screen to an electrical pulse to be sent as a signal sent to the computer. Since the electrical signal is rather weak, an amplifier amplifies it before being sent to the computer.
A "tracking software" keeps track of the position of the light pen always. Through the use of the tracking software, a signal received by the light pen at any point indicates the portion of the picture that needs to be modified.
Note that, when the pen is being moved to its position, to the position where the modification is required,, it will encounter various other light sources on the way. These light sources should not trigger the computer to accept the signal. So the aperture of the light pen is normally kept closed till the final position is reached, and then it can be opened by a switch.


35. If we use 3 bits for primary colors how many different colors are possible?
Ans.
8 colors are possible.
36. How many different choices are possible if we use 24 bits per pixel?
Ans.
16.7 million (224) colors.

FAQ
37. Some portable computers have high quality, evenly colored, perfectly flat displays. Are these LCD displays?
Ans:
These could be flat panel displays called Gas Plasma displays, which use neon bulbs.

38. What is SVG?
Ans:
Scalable Vector Graphics (SVG)is an XML based language for describing 2D vector graphics. It is being viewed as the standard for describing vector graphics on the web in the future. However, currently many browsers do not support it.

39. Should the resolution of an image be changed as per the monitor resolution?
Ans:
When you create images you can set their resolution. The resolution of an image should ideally be between 72 and 96 ppi. However, the exact value should be decided based on the monitor resolution. For example, for a 14 inches monitor with 800 X 600 resolution an image resolution of 76-78 is acceptable. However, for a 21 inches monitor with 1280 X 960 resolution, an image resolution of around 96 is acceptable.

40. What is an appropriate refresh rate, when multiple refresh rates are available for a given resolution?
Ans:
The most appropriate refresh rate is considered to be 72 and 85 Hz.
-----------------------------------------------------------------------------------------------------------
Solutions to Chapter Three Questions
41. Compare the features of text and graphics mode?
Ans.
The following table compares the text and graphics modes:
Text mode
Graphics mode
You can only handle text.
You can display, capture, and animate figures.
You can display in 16 colors on a color monitor.
You can display various colors.
Text mode display is in two forms, 25 rows of 40 columns or 25 rows of 80 columns.
The resolution of the graphics mode depends on the adapter.

42. With the help of an illustration, explain how initgraph() function works.
Ans.
The initgraph() function is used to initialize the graphics system to load appropriate graphics drive and video mode used by the graphics functions. The syntax of this function is:
initgraph(int *driver, int *mode, char *path)
As its parameters, you must specify the graphics mode such as EGA, or VGA (depends on the graphics adapter being used), the graphics driver (a program that interfaced between the hardware and your C program), and path of the graphics driver.
For example, to initialize graphics mode in CGA high resolution mode:
int gdriver = 1, gmode=4;
initgraph(&gdriver, &gmode, "d:\\tc\\bgi");
For example, to select the best driver and mode  possible on a computer:
int gdriver = DETECT, gmode;
initgraph(&gdriver, &gmode, "d:\\tc\\bgi");

43. Use graphics function to draw concentric circles?
Ans.
#include<conio.h>
#include<graphics.h>
# include<stdio.h>
main() {
        int gdriver = DETECT, gmode;
        /* initialize graphics mode */
        initgraph(&gdriver, &gmode, "d:\\tc\\bgi");
        circle(100,100,90);
        circle(100,100,50);
        circle(100,100,30);
        getch();
        restorecrtmode();
}
Inform the students that the path “d:\\tc\\bgi” should be changed according to the machine settings. The code given here has been tested on Turbo C 3.0.

44. Develop a C program to draw a structure of a fish and give animation.
Ans.
#include<graphics.h>
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<dos.h>
void main() {
        int gdriver=DETECT,gmode;
        int i;
        initgraph(&gdriver,&gmode,"e:\\tc\\bgi");
        int max_y=getmaxy()/2;
        i=0;
        setcolor(BLUE);
        while(!kbhit()) {
                        line(0+i,max_y+30,0+i,max_y-30);  /*triangle*/
                        line(0+i,max_y+30,30+i,max_y);
                        line(0+i,max_y-30,30+i,max_y);
                        ellipse(90+i,max_y,0,360,60,35);
                        circle(120+i,max_y-5,5);
                        i=i+3;
                        if(i>=635)
                        i=0;
                        delay(100);
                        cleardevice();
        }
        getch();
        closegraph();
}
Inform the students that the path “e:\\tc\\bgi” should be changed according to the machine settings. The code given here has been tested on Turbo C 3.0.


45. Develop a C program to draw a car shape and move the car using animation functions.
Ans.
#include<graphics.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>
void car_wheel(int x,int y) {
        setcolor(WHITE);
        setfillstyle(SOLID_FILL,WHITE);
        circle(x,y,10);
        floodfill(x,y,WHITE);
        circle(x,y,25);
}
void car_body() {
        car_wheel(50,200);
        car_wheel(200,200);
        setcolor(RED);
        line(25,200,0,210);
        line(40,160,70,130);
        bar(105,110,125,130);
        line(0,160,40,160);
        line(70,130,170,130);
        line(170,130,200,160);
        line(175,200,75,200);
        line(200,160,260,160);
        line(260,160,260,200);
        line(260,200,225,200);
        arc(50,200,0,180,25);
        arc(200,200,0,180,25);
        setfillstyle(SOLID_FILL,RED);
        floodfill(150,170,RED);
}
void main() {
        int gdriver = DETECT,gmode;
        int i;
        void *buff;
        initgraph(&gdriver,&gmode,"e:\\tc\\bgi ");
        car_body();
        buff=malloc(imagesize(0,100,270,230));
        getimage(0,100,270,230,buff);
        putimage(0,100,buff,XOR_PUT);
        i=0;
        while(!kbhit()) {
                        if(i>500) i=0;
                        putimage(i,100,buff,OR_PUT);
                        delay(75);
                        putimage(i,100,buff,XOR_PUT);
                        putimage(i+5,100,buff,OR_PUT);
                        delay(75);
                        putimage(i+5,100,buff,XOR_PUT);
                        i =i+10
        }
        closegraph();
        restorecrtmode();
        getch();
}
Inform the students that the path “d:\\tc\\bgi” should be changed according to the machine settings. The code given here has been tested on Turbo C 3.0.

46. List the different graphics functions along with example?
Ans.
C supports various graphics functions, such as:
n  line(int x1, int y1, int x2, int y2): This draws a line from position (x1, y1) to (x2, y2)
Example: line(10,50,10,100);
n  bar(int x1, int y1, int x2, int y2): This draws a filled rectangle with diagonal from (x1, y1) to (x2,y2)
bar(10,25,100,75)
n  circle(int x, int y, int r): This draws a circle with center at (x, y) and radius of r.
Example: circle(50,50,10)
n  arc(int x, int y, int start, int end, int r): This draws an arc of circle with the center at (x,y), radius r and start and end specified in degrees to mention the portion of the circle that forms the arc.
Example: arc(100,100,0,90,20) draws the first quarter of the circle, arc with center (100,100) and radius 20.

47. What is the use of malloc() function in C?
Ans.
The malloc() function allocates memory for an object. The number of bytes of memory to be allocated is specified as its parameter.


48. Explain the use of getimage() and putimage() with examples?
Ans.
The getimage() function captures the image inside the rectangle whose diagonal is defined by (x1, y1), and (x2,y2),where x1, y1, x2, and y2 are the first four parameters of getimage(). The captured image is stored in an array, which is specified as the last parameter of getimage().
For example, to capture a rectangle whose diagonal is defined by (10, 50) and (50, 125), you can use the getimage() function as:
int area =  imagesize(10,50,50,125);
unsigned char * buf = malloc(arear);
getimage(10,50,50,125, buf);
The putimage() function copies the image captured using getimage(),  starting at location (x, y), where x and y are the first two parameters of this function. The image to be captured is specified as the third parameter. The fourth parameter of this function specifies how the image has to be copied and takes any of the following values:
n  COPY_PUT or 0, which copies the image as it is
n  XOR_PUT or 1, which performs an exclusive OR between the background pixels and the image pixels
n  OR_PUT or 2, which performs an inclusive OR between the background pixels and the image pixels
n  AND_PUT or 3, which performs an AND between the background pixels and the image pixels
n  NOT_PUT or 4, which inverts the pixels of the image.
For example, animate a rectangle as it is you can use the COPY_PUT option in putimage:
putimage(10,50, buf, COPY_PUT);

FAQ
49. What are the various fill patterns in C?
Ans:
The various fill patterns include:
Pattern Constant
Value
Description
EMPTY_FILL
0
Background color fill
SOLID_FILL
1
Solid fill
LINE_FILL
2
-------
LTSLASH_FILL
3
/////
SLASH_FILL
4
///// (thick lines)
BKSLASH_FILL
5
\\\\ (thick lines)
LTBKSLASH_FILL
6
\\\\
HATACH_FILL
7
Hatch fill (light)
XHATCH_FILL
8
Cross hatch fill (heavy)
INTERLEAVE_FILL
9
Interleaving line fill
WIDE_DOT_FILL
10
Dot fill (widely spaced)
CLOSE_DOT_FILL
11
Dot fill (closely spaced)
USER_FILL
12
User-defined fill pattern

50. How can you create user-defined fill patterns?
Ans:
A pattern is stored as a sequence of 8 bytes, with each byte corresponding to a set of 8 pixels. The value of a pixel is set in the current color, if the value of the corresponding bit is 1. For example, you can define a pattern as:
char pattern[] = {0xCC, 0xAA, 0x33, 0x28,0xAB,0x10,0x17,0xFF};
You use setfillstyle() for predefined patterns. For user-defined patterns, such as the one given above, you can use setfillpattern(char * pattern, int color).

51. C supports a graphics mode and a text mode. Does that mean that you cannot output graphics in graphics mode?
Ans:
You can print graphics in the graphics mode as well. The various text functions available in the graphics mode are:
n  outtextxy(int x,int y, char * text), which displays the text specified as its third parameter at position specified by the first and second parameters, in current font, size and direction.
n  settextstyle(int font, int direction, int charsize), which allows you to set the font, size, and direction of the text. Fonts can be any of the 11(value 0 - 10) predefined fonts, direction can be HORIZ_DIR or VERT_DIR, and size can be 0 or any non-zero value positive value. The size manipulation involves various other functions also such as textheight(), textwidth(), and setusercharsize(). For more information you can refer to www.cs.colorado.edu/~main/bgi/doc/settextstyle.html.
n  settextjustify(int horiz_justi, int vert_justi), allows you to justify and align text. The possible values for the parameters are, LEFT_TEXT (only horiz_justi), CENTER_TEXT (both horiz_justi and vert_justi), RIGHT_TEXT (only horiz_justi), BOTTOM_TEXT (only vert_justi), TOP_TEXT (only vert_justi).

52. How can you make an object animate infinitely till you press the Enter key to exit?
Ans:
You can make an object animate till you hit a key using the kbhit() function. When this function is called it returns true if an input character is available in the read buffer for reading. If there is nothing to be read, it returns false.  You can use this function as:
int continue =1;
while(continue) {
        if(kbhit()) {
                        ch = getch();
                        if(ch ==27)
                        break;
        }
        else {
        //animation code
        }
}

53. It is easy to draw lines or plot points in relation to the screen coordinate system. How can you move the cursor by a position relative to another point on the screen?
Ans:
You can do this using the moverel(int x, int y) function. It moves the cursor x pixels in the X direction and y pixels in Y direction from the current position. Note that it does not draw any line while doing so. To draw a line from a point to a relative point use the linerel(int x, int y) function.
------------------------------------------------------------------------------------------------------------
Solutions to Chapter Four Questions
54. What is multimedia?
Ans.
Multimedia can be defined as presentation of information with integration of multiple media elements that can be used on and manipulated by computer. This media includes graphic software, video, audio, animation software, and computer hardware such as CD players, scanners and cameras.

55. What are the main components of Multimedia?
Ans.
The components of Multimedia are as follows:
n  Text
n  Graphics
n  Sound
n  Animation
n  Video

56. With illustration briefly narrate the origin and development of multimedia technology?
Ans.
Multimedia is an effective medium to express information in a more attractive way. It makes use of text, pictures, audio, animation, and video. It was started more then 25 years ago. However, it only became popular with the advent of desktop computers.
Audio was the first multimedia data incorporated into desktop computing, with the introduction of soundboards built around the tone-synthesis chips. In addition, video could also be captured, displayed and stored on a computer disk with the help of digital overlay and capture boards installed on any ordinary computer.
However, the use of audio and video on desktop computers was limited due to their large size and high computing power requirements. These limitations were overcome through the introduction of compression/decompression engines for reducing the sizes of these files. As the demand increased for multi standard compression on the same system, several manufacturers introduced a new generation of compression chips that supported software programming. These chips contained hardware engines for operations requiring high computing power and also integrated processors that can be programmed to control data flow within the chip. Such technologies made audio and video boards capable of transferring data to computer systems efficiently, in some cases, in real time.
The advent of RISC technology, parallel processing architecture, high speed hard disk, optical disk drives and a variety of interfacing devices made it possible to design computer systems that have multimedia features as standards.
The latest breakthrough in the field of multimedia was the advent of the Internet and other high-speed networking technologies. These have presented new opportunities such as video conferencing, medical imaging, and scientific visualization.


57. Give different applications for multimedia?
Ans.
Multimedia finds application in the field of entrainment, marketing, broadcasting, advertising, publication, telecommunications, training, collaborative engineering, and design manufacturing process because of its user-friendly operation.

58. What are sound cards?
Ans.
Sound card is the hardware for sound input and output. It is used with speakers, headphones, and microphones to record and play sound. Some sound cards also include MIDI, .Wav, and MP3.

59. How do graphics help in digital imaging?
Ans.
In digital imaging, film less camera may capture an image electronically, or an image may be traditionally created and scanned, or it may be created directly on the computer using graphics packages. The last option is where graphics help digital imaging. Direct graphics can be created on a computer in sophisticated, feature-rich packages such as Photoshop. These graphics editing packages allow creation of realistic digital images for use in multimedia applications.
In addition, graphics packages also help to edit digital images, which have been scanned or captured in digital cameras.

60. What are the different choices for digital imaging?
Ans.
There are three different choices for digital imaging:
n  A film less camera may capture an image electronically
n  The image may be created within the computer using various paints and illustration programs
n  The image may be created traditionally and than scanned into digital form

61. What are the different kinds of film less cameras available in the market?
Ans.
There are five different types of film less cameras suitable for digital imaging available in the market:
n  Video floppy disk Cameras
n  Digital Cameras
n  PCMCIA Cameras
n  Filmless Camera backs
n  Still Video Cameras

62. Explain how an artist can make use of multimedia software for his work.
Ans.
An artist can create illustrations using illustration software such as Adobe Illustrator. He can also apply special effects to existing and new images through filters such as those in Photoshop and Illustrator. In addition, he can scan hand-drawn illustrations and apply effects to or edit them. He can also create animation and add sound to his artwork using such software.


63. Explain how moving images are recorded on the hard disk.
Ans.
Moving images can be captured or copied on the hard disk with the help of a capture board.
Digital cameras RF or audio and video ports are connected to the corresponding RF of Audio video ports available in the capture board. With the help of any Video studio software live images can be captured and stored on the hard disk.

64. Explain how sound helps in multimedia. What are the major types of sound files?
Ans.
Sound in multimedia can include speech, special effect sounds, and music. Sound is an essential component of a multimedia production, such as video or animation, and presentations. It helps to make a multimedia application, entertaining,  easy to understand, and more presentable. For example, a presentation used for computer-based training can be more effective for students, if the text is also read out as it is displayed.
The major types of sound file formats include Wave files and MIDI files.

65. What is sampling?
Ans.
The process of transfer of information from analog to digital is called sampling.

66. What is animation? Explain different types of animation techniques.
Ans.
Animation is the process in which each frame of a film or movie is produced individually and viewed in rapid succession to give an illusion of continuous movement. On PCs the two main types of animation techniques are as follows:
n  Object animation: Is the moment of unchanged text and object around the screen
n  Cell animation/Frame animation: Is made of different frames on screen where they are rapidly displayed to simulate motion.

67. Explain the meaning of the following terms: Morphing, Rendering, Wrapping.
Ans.
n  Morphing: It is the process of transformation of one image to another by the transformation and distortion of corresponding points in both the images. The best example will be Kawasaki advertisement where the motorbike changes into a cheetah.
n  Rendering: The process of converting your designed objects with texturing and animation into an image or a series of images is called rendering.
n  Wrapping: It is the process where certain parts of the image could be marked for a change and made to change to different one for example legs of cheetah to be morphed with the wheels and head with head lights. Head can alone be marked and wrapped.

68. What is the meaning of file format?
Ans.
The method by which software organizes the data in the saved file is called the file format. The file name extension or suffixes indicate the format or usage of the file. Several different types of file formats are used by various kinds of software. For example: the GIF file format used for Web page images is a standard format that can be opened by any program that supports that standard format.


69. Why do we use a scanner? Name the different types of scanners?
Ans.
Scanner is a peripheral device, which captures real object or image and saves it in a digital file as a graphic. Different types of scanner are as follows:
n  Flatbed or Sheet-fed Scanner
n  Film Scanner
n  Handheld Scanner
n  3 D Scanner

70. What are the components of a multimedia system?
Ans.
The components of a multimedia system are as follows:
n  Monitor
n  CPU
n  Mouse
n  Keyboard
n  Microphone
n  CD drive and disc
n  Speaker
n  Digital camera
n  Joystick
n  Scanner
n  Printer
n  Web camera

71. Explain the significance of file extensions and file formats.
Ans.
File formats organize and store data  in a specific format. The quality and characteristics  of the  format decide the quality and usage of the data stored in the file, and the applications with which the file will be compatible. For example, a graphic can be saved as a bitmap file or a GIF file. In the first case, the quality of the graphic is good because bitmap format does not compress data, whereas GIF does. However, the size of the file in the first case will be much more than the size of the file in the second case. Therefore, bitmap graphics cannot be used on web pages because they take  a lot of time to load, whereas GIF graphics can be used.
File extensions help a user as well as an application  to identify the file format. For example, you can identify a graphic file by its extension such as .gif or .jpg. Similarly when you double click on a .gif file, Windows would read the extension and select the appropriate program for opening the file.
Fill in the Blanks
1.       Multimedia constitutes an integration of multiple media such as text, graphics, audio, video, and animation elements.
2.       JPEG uses lossy compression techniques.
3.       Wave or .wav files are Microsoft standard file format for storing waveform audio data.
4.       The amount of data that can be transmitted from one computer to another in a given time frame is called bit rate.
5.       The process of removal of extraneous noise that inevitable creeps into a recording is called filtering.



FAQ
72. What is a decibel?
Ans:
Decibel is a relative measure of the loudness/intensity of sound. It is actually measured as a ratio. A sound of 0dB is hardly audible to the human ear. Hearing a sound above 80-85 dB can be painful and damaging for the human ear.

73. Can you attach your home stereo speakers directly to your computer for better sound quality?
Ans:
The speakers are powered by the sound card and essentially the quality of sound produced by them would depend on the sound card itself. It is not advisable to attach your home stereo speakers to your computer because the quality of sound may still be bad. This is because the power that these speakers need is much more than what the sound card's amplifier can provide. Moreover, home stereo speakers do have magnetic shield protection and can damage your monitor or data in disks such as hard disk or floppy.

74. Do scanner characteristics such as bit depth also apply to digital cameras?
Ans:Yes, in most cases it does apply because they mostly work on similar principles.

75. What is an audio codec?
Ans: A codec is software that implements a compression/decompression technique. It is used for compressing/decompressing audio data to a file format or a streaming audio format. Specific audio -codecs act as interfaces to audio players such as Winamp, and Windows Media players. Like audio codecs, video codecs are used to compress/decompress video. To see a list of codecs, visit ttp://en.wikipedia.org/wiki/List_of_codecs#Video_codecs. To view the list of codecs installed on your system, open the Control Panel and select Sound and Multimedia (or Sound in some systems). The Sound and Multimedia Properties dialog box opens. Navigate to the Hardware tab and select Audio Codecs in the list. Next, click the Properties button, a dialog box showing the codecs installed will open. 
------------------------------------------------------------------------------------------------------------
Solutions to Chapter Five Questions
76Fill in the blanks:
a. Computer Graphics can be classified into _____________ and _______________.
Ans.
Bitmap
Images

b. A Photoshop file can contain vector & raster data.
Ans.
True

c. __________ is defined as the number of pixel along the height & width of bitmap.
Ans.
Resolution

d. _____________ Method is used to assign color values to any new pixel, at the time of re-sampling.
Ans.
Interpolation
e. Vectors graphics are made of ____ and ______ defined by mathematical objects, which are called vectors.
Ans.
Line
Curves

77. How many colors are there in RGB Color mode?
Ans.
RGB images use three colors, Red, Green, and Blue. These colors are known as primary colors.

78. What is gamut in Photoshop?
Ans.
The series of colors that a color system can demonstrate or print is called gamut in Photoshop. A color that can be displayed in RGB may be out of gamut, and therefore unprintable, for your CMYK setting.

79. What is a layer?
Ans.
Layers can be visualized as transparent sheets placed over one another in an image. Creating a layered image refers to putting different objects on different levels in a sequence. . You can create empty layers and add content to them, or you can create new layers from existing content. When you create a new layer, it appears either above the selected layer or within the selected layer set in the Layers palette.
Layer sets help you organize and manage layers. You can use layer sets to easily move layers as a group, to apply attributes and masks to groups of layers, and to reduce clutter in the Layers palette. You cannot create a new layer set within an existing layer set.

80. Name the different selections tools.
Ans.
The selection tools in Photoshop include the Lasso tool, Pen tools, Marquee Tool, and Path selection tool.

81. What are editing Tools?
Ans.
Editing tools are used to fine-tune or modify graphic elements. Photoshop delivers high-powered image editing, photo retouching, and composition tools. It also supports features, such as  Making Color Adjustments, Auto Color Command, Adjustment Layers and Fill Layers, and Masking Layers to help you get professional-quality results.

82. Give the steps to use rubber stamp tool.
Ans.
To use the rubber stamp tool (Clone tool), perform the following steps:
1.       Open the image that you want to clone.
2.       Select rubber stamp tool.
3.       Select an appropriate brush size and style from the Brush drop down in the options bar at the top. Also set values for other options such as blending mode, opacity, and flow. Determine how you want to align the sampled pixels. If you select Aligned, you can release the mouse button without losing the current sampling point. As a result, the sampled pixels are applied continuously, no matter how many times you stop and resume painting. If you deselect Aligned, the sampled pixels are applied from the initial sampling point each time you stop and resume painting. Select Use All Layers to sample data from all visible layers; deselect Use All Layers to sample only from the active layer.
4.       Press Alt and click the image that you want to clone, to select the source point for cloning.
5.       Use the brush to clone the image by dragging the mouse on another area. The image will be cloned in that area.

83. What is File Format? Name the different image file formats?
Ans.
The method by which the software organizes the data in the saved file is called the file format. The file name extension or suffixes indicate the format or usage of a file and a brief description of that format. Several different types of file format are used by various kind of software to save files. For example, the GIF file format used for Web page images are standard formats that can be opened by any program that supports it.
The various image file format are as follows:
n  Tagged-Image File Format (TIFF)
n  Graphics Interchange Format (GIF)
n  Joint Photographic Experts Group (JEPG)
n  Encapsulated PostScript (EPS)
n  Portable Document Format (PDF)
n  Portable Network Graphics (PNG)
n  TGA- Targa


84. Give the steps to use the image printing utility of Photoshop?
Ans.
In Photoshop, you can print a complete image, selected area of an image, or even one or more layers.
To print a complete image, select File --> Print from the main menu (or press Ctrl + P). The Print dialog box opens up as shown in the following figure:
Ensure that the All radio button is selected. You can also set the print resolution  by selecting it from the Print Quality drop-down. After making the desired print settings click OK to print.
To print a selected area, make a selection in the image using the Rectangular Marquee tool and select File >Print. Select the Selection option button in the Print dialog box and click OK.
Note that by default, Photoshop prints all visible layers and channels. If you want to print just certain layers or channels, make them the only ones that are visible and then print.


You can also choose to print the filename, along with crop marks, registration marks and a caption along with the image. To set such options, select File >Page Setup in Photoshop 6. The Page Setup dialog box opens as shown in the following figure:
You can select the checkboxes if you want to include the corresponding options in the printed image:
n  Caption: Selecting this checkbox will print a caption with the image. This caption can be set in the File Info dialog box. To open the File Info dialog box select File > File Info, and choose Caption from the Section drop-down list. Type a caption in the Caption text area and click OK.
n  Calibration Bars: Select this checkbox to print the calibration and color bars for your image. A calibration bar is a row of 11 gray squares of different values. A color bar is a row of 11 colors. These bars can be helpful when trying to calibrate to a specific printer. This option is available only for a PostScript printer.
n  Registration Marks: Select this checkbox to print a registration mark such as bull's eyes around the image. These marks can be helpful for aligning color separations.
n  Corner Crop Marks: Select this checkbox to view horizontal and vertical lines around the corners of the image, defining where the image should be trimmed.
n  Center Crop Marks: Select this checkbox to view the exact center of the image defined by two crossed lines.
n  Labels: Select this checkbox to print the file name next to the image. You can also print the name of the appropriate color channel if you are using color separations.
n  Negative: Select this checkbox to print an image that appears like a negative of the original image. With this option selected, the colors are reversed.
n  Emulsion Down: Select this checkbox to print the image as a horizontal mirror image of the original image.
n  Interpolation: Interpolation refers to a printer's ability to resample an image as they print it to improve its resolution. This option is useful in case of low-resolution images.
The buttons on the left side also present some useful options such as printing  a border around the image and printing a background with the image.



FAQ
85. Why are options under the Filter menu grayed or not available sometimes?
Ans:
The most common reason for this, assuming that an image is open, is that the Color mode of the image is not supported by the Filter commands. For examples, filters cannot be applied to Index images.

86. Can you open a Photoshop 6.0 file in Photoshop CS?
Ans:
Yes, a Photoshop 6.0 file can be opened in Photoshop CS. However, the new features of Photoshop CS may  not be available to that file. In addition, the file may not appear exactly as created in Photoshop 6.0.

87. Can you apply a gradient on an existing image?
Ans:
Yes, a gradient on an existing image can be applied using Quick Masking. To do this, open the image and copy the area (or the whole image) to which you want to apply a gradient. Now open a new image and click the Edit in Quick Mask Mode button in the toolbox. Next, select the Gradient tool and apply a gradient in the new image. Click the Edit in Standard Mode button. A selection will be formed on the new image. Select Edit>Paste Into from the main menu. The image opened first will be pasted in the selection and a gradient will be applied to it.

88. Can you delete the path created as an outline of an illustration using the Pen tool?
Ans:
Yes, the path created as an outline of an illustration using the Pen tool can be deleted.  To do this, open the Paths palate, right-click Work Path, and select Delete Path from the shortcut menu.

89. An image has been created using multiple layers. Can you merge all layers into one layer before saving the image?
Ans:
Yes, it is possible to merge all layers by selecting Layer>Flatten Image from the main menu.
------------------------------------------------------------------------------------------------------------
90. What is the need for computer graphics?
Ans. Graphical communication is an old and more popular method of exchanging information than verbal communication and is more convenient when computers are utilized for this purpose.
  As the volume of information increases, problem of storage arises. Also, in the 21st century people do not have time to read huge number of pages. This problem was solved by computer graphics. This can be clearly understood with the help of an example where we want to present the performance of a factory since 1980. For this, we require a number of pages to render this large volume of information related with financial, numerical and statistical information. It will take a lot of time to analyze such a long report. We can easily represent this data in a pictorial form thus making it simple to understand. Pictures can represent a huge database in the form of bar charts, pie charts, and so on.
Two other prominent applications of graphics are in the field of Computer Aided Design (CAD) and Computer Aided Manufacturing (CAM).  In CAD, graphics techniques are used to produce the drawings of certain parts of a machine from any viewing angle. In CAM computer graphics techniques, one may display the manufacturing layout for a given part and trace the path taken by machine tools for a given manufacturing process.
91. Define computer graphics and Interactive computer graphics?
Ans. Computer graphics can be defined as the use of computers to define, store, manipulate, interrogate, and present pictorial output of the data.
Interactive computer graphics refers to devices and systems that facilitate the man-machine graphic communication.
92. Briefly, narrate the history of graphics hardware technology?
Ans. In early days, the high cost of the hardware for computer graphics remained the obstacle, which prevented their widespread use. Computers have been getting progressively more inexpensive and it has become a household article these days. The microelectronics revolution and the subsequent reduction in the price of the digital hardware have completely changed the situation. Due to this price reduction, it is now realistic to expect that all computers with graphic display hardware capability will be making extensive use of computer graphics.
The announcement of the IBM personal computer using 16-bit Intel 8088 microprocessor on August 12, 1981, can be regarded as a historic event, which had a profound effect in the world of computers. These computers significantly improved the state of display technology in the world of computers.
TFhe next major change in PC display technology was announced by Apple Company in 1984, when it introduced the Macintosh PC. It was the first PC that did not include a text-based display but provided only a graphic display. The application programs developed for the Macintosh advocated WYSIWYG (What You See Is What You Get) style of interface. This concept has become a basic requirement in the area of desktop publishing (DTP). The PowerPC's from IBM, Apple, and other vendors created a new standard for DTP computers. With such a development, computer graphics and multimedia has become a necessity for all types of users.
93. How to make graphics processing faster?
Ans. Video/Graphic processing can be made faster in two ways: by using a graphic co-processor and a graphic accelerator. The graphic co-processor boosts video performance by assuming tasks normally handled by the CPU. An accelerator takes control of graphic task, which are otherwise performed by the CPU. However, an accelerator is not programmable. It is a functioned processor, which caries out specific tasks hard-coded into the chip.
94. What is graphics processor? Why it is needed?
Ans. Graphics processor helps in managing the screen faster with an equivalent software algorithm executed on the CPU. Through the use of these processors certain amount of parallelism can be achieved for executing graphic commands. Several manufacturers of personal computers use a proprietary graphics processor.
95. Name some graphics processors.
Ans. Some graphics processors are:
n   Intel 82786
n   Texas Instruments 43010
 96. Justify the statement "Windows OS is so popular"?
Ans. The Windows OS is popular because it supports a graphical user interface (GUI), in which users can perform operations with the help of graphical objects such as windows and buttons. Apart from an intuitive GUI, it supports various other features such as support for integrated application environment, multitasking, multimedia, and networking.
97. What are the strengths of UNIX operating system?
Ans.  The Unix operating system has been known and popular as a simple, small, portable, powerful, time-sharing operating system. However, now it has also gained commercial strength. It is still the most portable and configurable of all operating systems. Unix has adopted to the new hardware architecture and application requirements by incorporating new functionalities such as distributed file system, X11 base GUIs, Multi threading, distributability and so on. Unix became quite popular within Bell Labs.
98. What is a pixel?
Ans.  Pixel may be defined as the smallest size object or color spot that can be displayed and addressed on a monitor.
100. Give the different applications of Computer Graphics.
Ans.  Computer graphics is used in every field. Some of the major application areas are:
a. Building design and construction
b. Electronic Design
c. Mechanical Design
d. Entertainment and Animation
e. Aerospace industry
f. Medical Technology
g. Cartography
h. Art and Commerce.
101. Name the Computer languages that support Computer Graphics.
Ans.  Some languages that support computer graphics are:
a.FORTRAN
b.BASIC
c.PASCAL
d.C
102. What is the use of malloc() function in C.
Ans.  The malloc() function allocates memory for an object. The number of bytes of memory to be allocated is specified as its parameter.
103.F Why C language is popular for graphics programming?
AnsF.  C has become a choice for today's professionals, deveFlopers for graphics programming. C is a structured languFage and is rich in expressive power and applicable to a widFe variety of users. Because of the rich set of graphicaFl functions available, this language helps in designing Ffor graphical applications. The C code is small, fast, portablFe, and flexible.
104. Compare thFe merits and demerits of raster and random scanning systeFm.
Ans.F
1. In raFster scan display, the electron beam is swept across tFhe screen, one row at a time from top to bottom.
Random sFcan monitors draw a picture one line at a time and so theFy are also referred to as vector displays.
2.    RefreshinFg on raster scan display is carried out at the rate of 60 toF 80- frames per second. Refresh rate on a random scan sFystem depends on the number of lines to be displayed.F
3. The picture dFefinition is stored in a memory area called refresh buffer oFr frame buffer in case of a raster scan display. In case oFf random scan display, picture definition is stored as a set Fof line-drawing commands in an area of memory referred Fto as the refresh display file. Refresh display file is also Fcalled the display list, display program, or the refresh buffeFr.
105. Define pixel, resoluFtion, and aspect ratio.
Ans.  Pixel can be defined as the smallest size object or color spot that can be dFisplayed and addressed on a monitor.                                                                
Image resolution refers to pixel spacing that is the distance from one pixel to the next pixel.
The aspect ratio of the image is the ratio of the number of X pixels to the number of Y pixels. The standard aspect ratio for PC’s is 4:3 and some use 5:4.
106. Explain the principle of drawing pictures on CRT.
Ans.  In CRT, an electron gun produces a stream of electrons. This electron beam can be switched on/off through a heating system. The electron beam is focused towards the phosphor coated screen. The point where the beam hits the screen becomes phosphorent and produces a speck of light. A pair of focusing grids,  focus the beam to a particular point on the screen. The grid controls the focusing with the help of magnetic/electric fields. In this way a whole picture can be drawn by illuminating the points on the screen.
107. Explain briefly the working principle of Shadow mask CRT.
Ans.  The Shadow Mask CRT is based on the principle of combining the basic colors - red, green and blue. The shadow mask CRT, instead of using one electron gun, uses three different guns placed adjacent to each other to form a triangle or a "Delta". Each pixel point on the screen is made up of three types of phosphors to produce red, blue, and green colors. Just in front of the phosphor screen, is a metal screen, called a "shadow mask". This plate has holes placed strategically, so that the beams from the three electron guns are focused on particular color- producing pixel only.
Now, unlike the beam penetration CRT’s, the acceleration of the electron beam was being monitored, one can manipulate the intensity of the three beams simultaneously. If the red beam is made more intense, we get more of red color in the final combination etc. Since fine-tuning of the beam intensities is comparatively simple, we can get much more combination of colors than the beam penetration case.

108. Explain the principle of DVST system.
Ans.  The Direct View Storage Tube (DVST) behaves like a CRT with highly persistent phosphor. Pictures drawn on this screen will be seen for several minutes (40-50 minutes) before fading. It is similar to a CRT as far as the electronic gun and phosphor-coated mechanisms are concerned. However, instead of the electron beam directly writing the pictures on the phosphor coated CRT screen, the writing is done with the help of a fine-mesh wire grid. The grid made of very thin, high quality wire is located with a dielectric and is mounted just before the screen on the path of the electron beam from the gun. A pattern of positive charges is deposited on the grid and this pattern is transferred to the phosphor coated CRT by a continuous flood of electrons. This flood of electrons is mounted by a "flood gun", which is  separate from the electron gun that produces the main electron beam.
109. What are the different graphical input interactive techniques?
Ans.  Following are the various graphical input interactive techniques:
a.   Positioning
b.   Constraints
c.   Grids
d.   Gravity Field
e.   Rubber band methods
f.    Dragging
110. Why refreshing is required in CRT?
Ans.  When an electron beam strikes a dot of phosphor material, it glows for a fraction of a second and then fades. As brightness of the dots begins to reduce, the screen image becomes unstable and gradually fades out. In order to maintain a stable image, the electron beam must sweep the entire surface of the screen and return to redraw it number of times per second. That is, the screen must be refreshed multiple times in a second.
111. Name the different positioning devices.
Ans.  The various positioning devices are:
n Mouse
n Tablet
n Joystick
n Digitizer
n Light pen
n Track ball
112. What are pointing devices? Give examples.
Ans.  A pointing device is a hardware peripheral that allows user to point to objects on the screen and perform operations on them, such as selecting, clicking, moving, and dragging. Mouse is an example of pointing device.
113. Explain the working principle of Mouse.
Ans.  A mouse is a small handled box used to position the screen cursor. It has two wheels at right angles to each other. Each of these wheels is connected to the shaft encode. For every incremental rotation of the wheel, an electrical signal is produced by the shaft encode. As the device is moved on a flat surface, the movement is coded in the x and y directions by counting the number of pulses received from the shaft encoder. These values are held in separate registers and the computer can sample them at a suitable rate. The device can, therefore, be used for a moving cursor around the display screen.
114. If we use 3 bits for primary colors how many different colors are possible?
Ans.   8 colors are possible.

115. Explain the working of Light pen along with a diagram.
Ans.  Light pen has a very simple working. Every pixel on the screen that is a part of the picture emits light. All that the light pen does is to make use of this light signal to indicate the position. A small aperture is held against the portion of the picture to be modified and the light from the pixels falls on a photocell, after passing through the aperture. This photocell converts the light signal received from the screen to an electrical pulse to be sent as a signal sent to the computer. Since the electrical signal is rather weak, an amplifier amplifies it before being sent to the computer.
A "tracking software" keeps track of the position of the light pen always. Through the use of the tracking software, a signal received by the light pen at any point indicates the portion of the picture that needs to be modified.
Note that, when the pen is being moved to its position, to the position where the modification is required,it will encounter various other light sources on the way. These light sources should not trigger the computer to accept the signal. So the aperture of the light pen is normally kept closed till the final position is reached, and then it can be opened by a switch.
116. Compare the features of text and graphics mode?
Text mode
Graphics mode
You can only handle text.
You can display, capture, and animate figures.
You can display in 16 colors on a color monitor.
You can display various colors.
Text mode display is in two forms, 25 rows of 40 columns or 25 rows of 80 columns.
The resolution of the graphics mode depends on the adapter.
Ans.  The following table compares the text and graphics modes:
117. With the help of an illustration, explain how initgraph() function works.
Ans.  The initgraph() function is used to initialize the graphics system to load appropriate graphics drive and video mode used by the graphics functions. The syntax of this function is:
initgraph(int *driver, int *mode, char *path)
As its parameters, you must specify the graphics mode such as EGA, or VGA (depends on the graphics adapter being used), the graphics driver (a program that interfaced between the hardware and your C program), and path of the graphics driver.
For example, to initialize graphics mode in CGA high resolution mode:
int gdriver = 1, gmode=4;
initgraph(&gdriver, &gmode, "d:\\tc\\bgi");
For example, to select the best driver and mode  possible on a computer:
int gdriver = DETECT, gmode;
initgraph(&gdriver, &gmode, "d:\\tc\\bgi");
118. Use graphics function to draw concentric circles?
Ans.    #include<conio.h>
#include<graphics.h>
# include<stdio.h>
main() {
  int gdriver = DETECT, gmode;
  /* initialize graphics mode */
  initgraph(&gdriver, &gmode, "d:\\tc\\bgi");
  circle(100,100,90);
  circle(100,100,50);
  circle(100,100,30);
  getch();
  restorecrtmode();
}
Inform the students that the path “d:\\tc\\bgi” should be changed according to the machine settings. The code given here has been tested on Turbo C 3.0.
119. Develop a C program to draw a structure of a fish and give animation.
Ans.   #include<graphics.h>
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<dos.h>
void main() {
  int gdriver=DETECT,gmode;
  int i;
  initgraph(&gdriver,&gmode,"e:\\tc\\bgi");
  int max_y=getmaxy()/2;
  i=0;
  setcolor(BLUE);
  while(!kbhit()) {
              line(0+i,max_y+30,0+i,max_y-30);  /*triangle*/
              line(0+i,max_y+30,30+i,max_y);
              line(0+i,max_y-30,30+i,max_y);
              ellipse(90+i,max_y,0,360,60,35);
              circle(120+i,max_y-5,5);
              i=i+3;
              if(i>=635)
              i=0;
              delay(100);
              cleardevice();
  }
  getch();
  closegraph();
}
Inform the students that the path “e:\\tc\\bgi” should be changed according to the machine settings. The code given here has been tested on Turbo C 3.0.
120. What is sampling?
Ans.  The process of transfer of information from analog to digital is called sampling.


121. Develop a C program to draw a car shape and move the car using animation functions.
Ans.
#include<graphics.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>
void car_wheel(int x,int y) {
  setcolor(WHITE);
  setfillstyle(SOLID_FILL,WHITE);
  circle(x,y,10);
  floodfill(x,y,WHITE);
  circle(x,y,25);
}
void car_body() {
  car_wheel(50,200);
  car_wheel(200,200);
  setcolor(RED);
  line(25,200,0,210);
  line(40,160,70,130);
  bar(105,110,125,130);
  line(0,160,40,160);
  line(70,130,170,130);
  line(170,130,200,160);
  line(175,200,75,200);
  line(200,160,260,160);
  line(260,160,260,200);
  line(260,200,225,200);
  arc(50,200,0,180,25);
  arc(200,200,0,180,25);
  setfillstyle(SOLID_FILL,RED);
  floodfill(150,170,RED);
}
void main() {
  int gdriver = DETECT,gmode;
  int i;
  void *buff;
  initgraph(&gdriver,&gmode,"e:\\tc\\bgi ");
  car_body();
  buff=malloc(imagesize(0,100,270,230));
  getimage(0,100,270,230,buff);
  putimage(0,100,buff,XOR_PUT);
  i=0;
  while(!kbhit()) {
              if(i>500) i=0;
              putimage(i,100,buff,OR_PUT);
              delay(75);
              putimage(i,100,buff,XOR_PUT);
              putimage(i+5,100,buff,OR_PUT);
              delay(75);
              putimage(i+5,100,buff,XOR_PUT);
              i =i+10    }
  closegraph();
  restorecrtmode();
  getch();
}
Inform the students that the path “d:\\tc\\bgi” should be changed according to the machine settings. The code given here has been tested on Turbo C 3.0.
122. List the different graphics functions along with example.
Ans.
C supports various graphics functions, such as:
n line(int x1, int y1, int x2, int y2): This draws a line from position (x1, y1) to (x2, y2)
Example: line(10,50,10,100);
n bar(int x1, int y1, int x2, int y2): This draws a filled rectangle with diagonal from (x1, y1) to (x2,y2)
   bar(10,25,100,75)
n circle(int x, int y, int r): This draws a circle with    center at (x, y) and radius of r.
   Example: circle(50,50,10)
n arc(int x, int y, int start, int end, int r): This draws an arc of circle with the center at (x,y), radius r and start and end specified in degrees to mention the portion of the circle that forms the arc.
  Example: arc(100,100,0,90,20) draws the first quarter of the circle, arc with center (100,100) and radius 20.
123. Explain the use of getimage() and putimage() with examples?
Ans.
The getimage() function captures the image inside the rectangle whose diagonal is defined by (x1, y1), and (x2,y2),where x1, y1, x2, and y2 are the first four parameters of getimage(). The captured image is stored in an array, which is specified as the last parameter of getimage().
For example, to capture a rectangle whose diagonal is defined by (10, 50) and (50, 125), you can use the getimage() function as:
int area =  imagesize(10,50,50,125);
unsigned char * buf = malloc(arear);
getimage(10,50,50,125, buf);
The putimage() function copies the image captured using getimage(),  starting at location (x, y), where x and y are the first two parameters of this function. The image to be captured is specified as the third parameter. The fourth parameter of this function specifies how the image has to be copied and takes any of the following values:
n COPY_PUT or 0, which copies the image as it is
n XOR_PUT or 1, which performs an exclusive OR between the background pixels and the image pixels
n OR_PUT or 2, which performs an inclusive OR between the background pixels and the image pixels
n AND_PUT or 3, which performs an AND between the background pixels and the image pixels
n NOT_PUT or 4, which inverts the pixels of the image.
For example, animate a rectangle as it is you can use the COPY_PUT option in putimage:
putimage(10,50, buf, COPY_PUT);
124. What is multimedia?
Ans.  Multimedia can be defined as presentation of information with integration of multiple media elements that can be used on and manipulated by computer. This media includes graphic software, video, audio, animation software, and computer hardware such as CD players, scanners and cameras.
125. What are the main components of Multimedia?
Ans.   The components of Multimedia are as follows:
n  Text
n  Graphics
n  Sound
n  Animation
n  Video
126. With illustration briefly narrate the origin and development of multimedia technology?
Ans.   Multimedia is an effective medium to express information in a more attractive way. It makes use of text, pictures, audio, animation, and video. It was started more then 25 years ago. However, it only became popular with the advent of desktop computers.
Audio was the first multimedia data incorporated into desktop computing, with the introduction of soundboards built around the tone-synthesis chips. In addition, video could also be captured, displayed and stored on a computer disk with the help of digital overlay and capture boards installed on any ordinary computer.
However, the use of audio and video on desktop computers was limited due to their large size and high computing power requirements. These limitations were overcome through the introduction of compression/decompression engines for reducing the sizes of these files. As the demand increased for multi standard compression on the same system, several manufacturers introduced a new generation of compression chips that supported software programming. These chips contained hardware engines for operations requiring high computing power and also integrated processors that can be programmed to control data flow within the chip. Such technologies made audio and video boards capable of transferring data to computer systems efficiently, in some cases, in real time.
The advent of RISC technology, parallel processing architecture, high speed hard disk, optical disk drives and a variety of interfacing devices made it possible to design computer systems that have multimedia features as standards.
The latest breakthrough in the field of multimedia was the advent of the Internet and other high-speed networking technologies. These have presented new opportunities such as video conferencing, medical imaging, and scientific visualization.
127. Give different applications for multimedia?
Ans.  Multimedia finds application in the field of entrainment, marketing, broadcasting, advertising, publication, telecommunications, training, collaborative engineering, and design manufacturing process because of its user-friendly operation.
128. What are sound cards?
Ans.   Sound card is the hardware for sound input and output. It is used with speakers, headphones, and microphones to record and play sound. Some sound cards also include MIDI, .Wav, and MP3.
129. How do graphics help in digital imaging?
Ans.   In digital imaging, film less camera may capture an image electronically, or an image may be traditionally created and scanned, or it may be created directly on the computer using graphics packages. The last option is where graphics help digital imaging. Direct graphics can be created on a computer in sophisticated, feature-rich packages such as Photoshop. These graphics editing packages allow creation of realistic digital images for use in multimedia applications.
In addition, graphics packages also help to edit digital images, which have been scanned or captured in digital cameras.
130. What are the different choices for digital imaging?
Ans.    There are three different choices for digital imaging:
n A film less camera may capture an image electronically
n The image may be created within the computer using various paints and illustration programs
n The image may be created traditionally and than scanned into digital form
131. What are the different kinds of film less cameras available in the market?
Ans.   There are five different types of film less cameras suitable for digital imaging available in the market:
n  Video floppy disk Cameras
n  Digital Cameras
n  PCMCIA Cameras
n  Filmless Camera backs
n  Still Video Cameras
132. Explain how an artist can make use of multimedia software for his work.
Ans.   An artist can create illustrations using illustration software such as Adobe Illustrator. He can also apply special effects to existing and new images through filters such as those in Photoshop and Illustrator. In addition, he can scan hand-drawn illustrations and apply effects to or edit them. He can also create animation and add sound to his artwork using such software.
133. Explain how moving images are recorded on the hard disk.
Ans.   Moving images can be captured or copied on the hard disk with the help of a capture board.
Digital cameras RF or audio and video ports are connected to the corresponding RF of Audio video ports available in the capture board. With the help of any Video studio software live images can be captured and stored on the hard disk.
134. Explain how sound helps in multimedia. What are the major types of sound files?
Ans.   Sound in multimedia can include speech, special effect sounds, and music. Sound is an essential component of a multimedia production, such as video or animation, and presentations. It helps to make a multimedia application, entertaining,  easy to understand, and more presentable. For example, a presentation used for computer-based training can be more effective for students, if the text is also read out as it is displayed.
The major types of sound file formats include Wave files and MIDI files.
2. How many colors are there in RGB Color mode?
Ans.   RGB images use three colors, Red, Green, and Blue. These colors are known as primary colors.
135. What is gamut in Photoshop?
Ans.   The series of colors that a color system can demonstrate or print is called gamut in Photoshop. A color that can be displayed in RGB may be out of gamut, and therefore unprintable, for your CMYK setting.

136. Explain the meaning of the following terms: Morphing, Rendering, Wrapping.
Ans.   Morphing: It is the process of transformation of one image to another by the transformation and distortion of corresponding points in both the images. The best example will be Kawasaki advertisement where the motorbike changes into a cheetah.
n Rendering: The process of converting your designed objects with texturing and animation into an image or a series of images is called rendering.
n Wrapping: It is the process where certain parts of the image could be marked for a change and made to change to different one for example legs of cheetah to be morphed with the wheels and head with head lights. Head can alone be marked and wrapped.
137. What is the meaning of file format?
Ans.
The method by which software organizes the data in the saved file is called the file format. The file name extension or suffixes indicate the format or usage of the file. Several different types of file formats are used by various kinds of software. For example: the GIF file format used for Web page images is a standard format that can be opened by any program that supports that standard format.
138. Why do we use a scanner? Name the different types of scanners?
Ans.   Scanner is a peripheral device, which captures real object or image and saves it in a digital file as a graphic. Different types of scanner are as follows:
n  Flatbed or Sheet-fed Scanner
n  Film Scanner
n  Handheld Scanner
n  3 D Scanner
139. What are the components of a multimedia system?
Ans.   The components of a multimedia system are as follows:
n   Monitor
n   CPU
n   Mouse
n   Keyboard
n   Microphone
n   CD drive and disc
n   Speaker
n   Digital camera
n   Joystick
n   Scanner
n   Printer
n   Web camera
140. Explain the significance of file extensions and file formats.
Ans.   File formats organize and store data  in a specific format. The quality and characteristics  of the  format decide the quality and usage of the data stored in the file, and the applications with which the file will be compatible. For example, a graphic can be saved as a bitmap file or a GIF file. In the first case, the quality of the graphic is good because bitmap format does not compress data, whereas GIF does. However, the size of the file in the first case will be much more than the size of the file in the second case. Therefore, bitmap graphics cannot be used on web pages because they take  a lot of time to load, whereas GIF graphics can be used.
File extensions help a user as well as an application  to identify the file format. For example, you can identify a graphic file by its extension such as .gif or .jpg. Similarly when you double click on a .gif file, Windows would read the extension and select the appropriate program for opening the file.
Fill in the Blanks
Multimedia constitutes an integration of multiple media such as text, graphics, audio, video, and animation elements.
JPEG uses lossy compression techniques.
Wave or .wav files are Microsoft standard file format for storing waveform audio data.
4.                                                                The amount of data that can be transmitted from one computer to another in a given time frame is called bit rate.
5. The process of removal of extraneous noise that inevitable creeps into a recording is called filtering.
141. Name the different selections tools.
Ans.   The selection tools in Photoshop include the Lasso tool, Pen tools, Marquee Tool, and Path selection tool.
142. What are editing Tools?
Ans.   Editing tools are used to fine-tune or modify graphic elements. Photoshop delivers high-powered image editing, photo retouching, and composition tools. It also supports features, such as  Making Color Adjustments, Auto Color Command, Adjustment Layers and Fill Layers, and Masking Layers to help you get professional-quality results.
143. Give the steps to use rubber stamp tool.
Ans.   To use the rubber stamp tool (Clone tool), perform the following steps:
Open the image that you want to clone.
Select rubber stamp tool.
Select an appropriate brush size and style from the Brush drop down in the options bar at the top. Also set values for other options such as blending mode, opacity, and flow. Determine how you want to align the sampled pixels. If you select Aligned, you can release the mouse button without losing the current sampling point. As a result, the sampled pixels are applied continuously, no matter how many times you stop and resume painting. If you deselect Aligned, the sampled pixels are applied from the initial sampling point each time you stop and resume painting. Select Use All Layers to sample data from all visible layers; deselect Use All Layers to sample only from the active layer.
Press Alt and click the image that you want to clone, to select the source point for cloning.
Use the brush to clone the image by dragging the mouse on another area. The image will be cloned in that area.
144. What is File Format? Name the different image file formats?
Ans.   The method by which the software organizes the data in the saved file is called the file format. The file name extension or suffixes indicate the format or usage of a file and a brief description of that format. Several different types of file format are used by various kind of software to save files. For example, the GIF file format used for Web page images are standard formats that can be opened by any program that supports it.
The various image file format are as follows:
n Tagged-Image File Format (TIFF)
n Graphics Interchange Format (GIF)
n Joint Photographic Experts Group (JEPG)
n Encapsulated PostScript (EPS)
n Portable Document Format (PDF)
n Portable Network Graphics (PNG)
n TGA- Targa




149. Give the steps to use the image printing utility of Photoshop?
Ans.   In Photoshop, you can print a complete image, selected area of an image, or even one or more layers.
To print a complete image, select File --> Print from the main menu (or press Ctrl + P). The Print dialog box opens up as shown in the following figure:
Ensure that the All radio button is selected. You can also set the print resolution  by selecting it from the Print Quality drop-down. After making the desired print settings click OK to print.
To print a selected area, make a selection in the image using the Rectangular Marquee tool and select File >Print. Select the Selection option button in the Print dialog box and click OK.
Note that by default, Photoshop prints all visible layers and channels. If you want to print just certain layers or channels, make them the only ones that are visible and -*then print.
You can also choose to print the filename, along with crop marks, registration marks and a caption along with the image. To set such options, select File >Page Setup in Photoshop 6. The Page Setup dialog box opens as shown in the following figure:
You can select the checkboxes if you want to include the corresponding options in the printed image:
n               Caption: Selecting this checkbox will print a caption with the image. This caption can be set in the File Info dialog box. To open the File Info dialog box select File > File Info, and choose Caption from the Section drop-down list. Type a caption in the Caption text area and click OK.
n               Calibration Bars: Select this checkbox to print the calibration and color bars for your image. A calibration bar is a row of 11 gray squares of different values. A color bar is a row of 11 colors. These bars can be helpful when trying to calibrate to a specific printer. This option is available only for a PostScript printer.
n               Registration Marks: Select this checkbox to print a registration mark such as bull's eyes around the image. These marks can be helpful for aligning color separations.
n               Corner Crop Marks: Select this checkbox to view horizontal and vertical lines around the corners of the image, defining where the image should be trimmed.
n               Center Crop Marks: Select this checkbox to view the exact center of the image defined by two crossed lines.
n               Labels: Select this checkbox to print the file name next to the image. You can also print the name of the appropriate color channel if you are using color separations.
n               Negative: Select this checkbox to print an image that appears like a negative of the original image. With this option selected, the colors are reversed.
n               Emulsion Down: Select this checkbox to print the image as a horizontal mirror image of the original image.
n               Interpolation: Interpolation refers to a printer's ability to resample an image as they print it to improve its resolution. This option is useful in case of low-resolution images.
The buttons on the left side also present some useful options such as printing  a border around the image and printing a background with the image.
150. What is animation? Explain different types of animation techniques.
Ans.  Animation is the process in which each frame of a film or movie is produced individually and viewed in rapid succession to give an illusion of continuous movement. On
PCs the two main types of animation techniques are as follows:
n Object animation: Is the moment of unchanged text and object around the screen
n Cell animation/Frame animation: Is made of different frames on screen where they are rapidly displayed to simulate motion.
151. What is a layer?
Ans.
Layers can be visualized as transparent sheets placed over one another in an image. Creating a layered image refers to putting different objects on different levels in a sequence. . You can create empty layers and add content to them, or you can create new layers from existing content. When you create a new layer, it appears either above the selected layer or within the selected layer set in the Layers palette.
Layer sets help you organize and manage layers. You can use layer sets to easily move layers as a group, to apply attributes and masks to groups of layers, and to reduce clutter in the Layers palette. You cannot create a new layer set within an existing layer set.

 ------------------------------------------------------------------------------------------------------------------------------------------------------------------
152. Develop a C program to draw a structure of a fish and give animation.
Ans. #include<graphics.h>
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<dos.h>
void main() {
int gdriver=DETECT,gmode;
int i;
initgraph(&gdriver,&gmode,"e:\\tc\\bgi");
int max_y=getmaxy()/2;
i=0;
setcolor(BLUE);
while(!kbhit()) {
line(0+i,max_y+30,0+i,max_y-30);  /*triangle*/
line(0+i,max_y+30,30+i,max_y);
line(0+i,max_y-30,30+i,max_y);
ellipse(90+i,max_y,0,360,60,35);
circle(120+i,max_y-5,5);
i=i+3;
if(i>=635)
i=0;
delay(100);
cleardevice();
}
getch();
closegraph();
}
Inform the students that the path “e:\\tc\\bgi” should be changed according to the machine settings. The code given here has been tested on Turbo C 3.0.
                              5. Develop a C program to draw a car shape and move the car using animation fnctns.
Ans.  #include<graphics.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>
void car_wheel(int x,int y) {
setcolor(WHITE);
setfillstyle(SOLID_FILL,WHITE);
circle(x,y,10);
floodfill(x,y,WHITE);
circle(x,y,25);
}
void car_body() {
car_wheel(50,200);
car_wheel(200,200);
setcolor(RED);
line(25,200,0,210);
line(40,160,70,130);
bar(105,110,125,130);
line(0,160,40,160);
line(70,130,170,130);
line(170,130,200,160);
line(175,200,75,200);
line(200,160,260,160);
line(260,160,260,200);
line(260,200,225,200);
arc(50,200,0,180,25);
arc(200,200,0,180,25);
setfillstyle(SOLID_FILL,RED);
floodfill(150,170,RED);
}
void main() {
int gdriver = DETECT,gmode;
int i;
void *buff;
initgraph(&gdriver,&gmode,"e:\\tc\\bgi ");
car_body();
buff=malloc(imagesize(0,100,270,230));
getimage(0,100,270,230,buff);
putimage(0,100,buff,XOR_PUT);
i=0;
while(!kbhit()) {
if(i>500) i=0;
putimage(i,100,buff,OR_PUT);
delay(75);
putimage(i,100,buff,XOR_PUT);
putimage(i+5,100,buff,OR_PUT);
delay(75);
putimage(i+5,100,buff,XOR_PUT);
i =i+10
}
closegraph();
restorecrtmode();
getch();
}
Inform the students that the path “d:\\tc\\bgi” should be changed according to the machine settings. The code given here has been tested on Turbo C 3.0.
153. Explain how an artist can make use of multimedia software for his work.
Ans. An artist can create illustrations using illustration software such as Adobe Illustrator. He can also apply special effects to existing and new images through filters such as those in Photoshop and Illustrator. In addition, he can scan hand-drawn illustrations and apply effects to or edit them. He can also create animation and add sound to his artwork using such software.
154. What is a layer?
Ans. Layers can be visualized as transparent sheets placed over one another in an image. Creating a layered image refers to putting different objects on different levels in a sequence. . You can create empty layers and add content to them, or you can create new layers from existing content. When you create a new layer, it appears either above the selected layer or within the selected layer set in the Layers palette.
Layer sets help you organize and manage layers. You can use layer sets to easily move layers as a group, to apply attributes and masks to groups of layers, and to reduce clutter in the Layers palette. You cannot create a new layer set within an existing layer set.
155. What are editing Tools?
Ans. Editing tools are used to fine-tune or modify graphic elements. Photoshop delivers high-powered image editing, photo retouching, and composition tools. It also supports features, such as  Making Color Adjustments, Auto Color Command, Adjustment Layers and Fill Layers, and Masking Layers to help you get professional-quality results.
156. Give the steps to use rubber stamp tool.
Ans. To use the rubber stamp tool (Clone tool), perform the following steps:
1.     Open the image that you want to clone.
2.     Select rubber stamp tool.
3.     Select an appropriate brush size and style from the Brush drop down in the options bar at the top. Also set values for other options such as blending mode, opacity, and flow. Determine how you want to align the sampled pixels. If you select Aligned, you can release the mouse button without losing the current sampling point. As a result, the sampled pixels are applied continuously, no matter how many times you stop and resume painting. If you deselect Aligned, the sampled pixels are applied from the initial sampling point each time you stop and resume painting. Select Use All Layers to sample data from all visible layers; deselect Use All Layers to sample only from the active layer.
4.     Press Alt and click the image that you want to clone, to select the source point for cloning.
5.     Use the brush to clone the image by dragging the mouse on another area. The image will be cloned in that area.
 157. What is File Format? Name the different image file formats?
Ans. The method by which the software organizes the data in the saved file is called the file format. The file name extension or suffixes indicate the format or usage of a file and a brief description of that format. Several different types of file format are used by various kind of software to save files. For example, the GIF file format used for Web page images are standard formats that can be opened by any program that supports it.
 158Give the steps to use the image printing utility of Photoshop?
Ans. In Photoshop, you can print a complete image, selected area of an image, or even one or more layers.
To print a complete image, select File --> Print from the main menu (or press Ctrl + P). The Print dialog box opens up.
Ensure that the All radio button is selected. You can also set the print resolution  by selecting it from the Print Quality drop-down. After making the desired print settings click OK to print.
To print a selected area, make a selection in the image using the Rectangular Marquee tool and select File >Print. Select the Selection option button in the Print dialog box and click OK.
Note that by default, Photoshop prints all visible layers and channels. If you want to print just certain layers or channels, make them the only ones that are visible and then print.
You can also choose to print the filename, along with crop marks, registration marks and a caption along with the image. To set such options, select File >Page Setup in Photoshop 6. The Page Setup dialog box opens.
You can select the checkboxes if you want to include the corresponding options in the printed image:
n  Caption: Selecting this checkbox will print a caption with the image. This caption can be set in the File Info dialog box. To open the File Info dialog box select File > File Info, and choose Caption from the Section drop-down list. Type a caption in the Caption text area and click OK.
n  Calibration Bars: Select this checkbox to print the calibration and color bars for your image. A calibration bar is a row of 11 gray squares of different values. A color bar is a row of 11 colors. These bars can be helpful when trying to calibrate to a specific printer. This option is available only for a PostScript printer.
n  Registration Marks: Select this checkbox to print a registration mark such as bull's eyes around the image. These marks can be helpful for aligning color separations.
n  Corner Crop Marks: Select this checkbox to view horizontal and vertical lines around the corners of the image, defining where the image should be trimmed.
n  Center Crop Marks: Select this checkbox to view the exact center of the image defined by two crossed lines.
n  Labels: Select this checkbox to print the file name next to the image. You can also print the name of the appropriate color channel if you are using color separations.
n  Negative: Select this checkbox to print an image that appears like a negative of the original image. With this option selected, the colors are reversed.
n  Emulsion Down: Select this checkbox to print the image as a horizontal mirror image of the original image.
n  Interpolation: Interpolation refers to a printer's ability to resample an image as they print it to improve its resolution. This option is useful in case of low-resolution images.
The buttons on the left side also present some useful options such as printing  a border around the image and printing a background with the image.
Read More »