How To Exam?

a knowledge trading engine...


Andhra University 2007 B.E Computer Science s - exam paper

Wednesday, 01 May 2013 05:55Web

ques. 1:

define the object that is created by the subsequent statement, and provide an example of how it might be used in a program:

BufferedImage OSC = new BufferedImage(32,32,BufferedImage.TYPE_INT_RGB);

Answer:

A BufferedImage is a region in memory that can be used as a drawing surface. In this statement, the image that is created is 32 pixels wide and 32 pixels high, and the color of every pixel is an RGB color that has red, green, and blue components in the range 0 to 255. The picture in a BufferedImage can easily be copied into a graphics situation g by calling 1 of the g.drawImage methods. However, since the image is so small in this case, it seems more likely that is going to be used to describe an ImageIcon.
ques. 2:

Many programs depend on resource files. What is meant by a resource in this sense? provide an example.
Answer:

In addition to the program code itself, programs often use other kinds of data such as images and sounds. These are stated to be resources for the program. In order to run, the program must be able to locate and load the resources. An example of a resource is a small image file that will be used by the program to describe a custom cursor.
ques. 3:

What is the FontMetrics class used for?
Answer:

An object that belongs to the class FontMetrics can be used to find info about the sizes of characters and strings that are drawn in a specific font. The font is specified when the FontMetrics object is created. If fm is a variable of kind FontMetrics, then, for example, fm.stringWidth(str) provide the width of the string str and fm.getHeight() is the usual amount of vertical space allowed for 1 line of text. This info could be used, for example, for positioning the string is a component.
ques. 4:

If a Color, c, is created as c = new Color(0,0,255,125), what is effect of drawing with this color?
Answer:

When a color is constructed from 4 integers, the 4th parameter is the alpha component of the color. When drawing, the alpha component is interpreted as the degree of opaqueness of the color. If the alpha component is less than its maximum possible value, 255, then the color is partially transparent. In this case, c represents a blue color that is about 50% transparent. When a pixel is colored with c, the pixel does not become entirely blue. Instead, the new color of the pixel is found by blending c with the previous color of the pixel. The effect is like adding a blue tint to the pixel, or like looking at the previous color of the pixel through blue-colored glass.
ques. 5:

What is antialiasing?
Answer:

Antialiasing is used to make shapes that are drawn look less "jagged." The jaggedness is called "aliasing," and it arises because shapes have to be drawn by coloring individual pixels. If antialiasing is off, then the only decision is either to color a pixel or not to color it. As a result, a boundary that should be a smooth curve will look like a jagged staircase. When antialiasing is on, the amount of color that is applied to a pixel depends on how much of that pixel is covered by the ideal geometric shape. For pixels along the boundary of the shape, the color of the shape will be blended with the previous color of the pixel. Although antialiasing does not produce a perfect result, it does tend to make pictures look better.



( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER Andhra University 2007 B.E Computer Science s - exam paper