Posts

Showing posts from November, 2013

Java Patterns

public class pattern { public static void main(String args[]) {  for(int i=1; i<6 ; i++)  {   for(int j=1 ; j<6 ; j++)   {    if(i==5)   {    System.out.print("*");   }    if(j==5)   {    System.out.print("*");   }   else   {   System.out.print(" ");   }             } System.out.println();  }  } } public class pattern1 { public static void main(String args[]) {  for(int i=1; i<=5 ; i++)  {   for(int j=1 ; j<=5-i ; j++)   {       System.out.print(" ");   }   for(int k=1; k<=((2*i)-1); k++ )   {    System.out.print("*");   }         ...

Java Patterns

public class pattern21 {   public static void main(String args[]) {         for(int i=1; i<6 ; i++)  {   for(int j=1 ; j<=5-i ; j++)   {       System.out.print(" ");   }   int n=i; for(int k=0; k<i; k++) { System.out.print(n); n++; } n--; for(int m=1; m<i; m++) { System.out.print(--n); }   System.out.println();  }  } }

Graphic Basics

Pixel is the smallest area of screen which can be independently plotted and displayed. Resolution is the number of pixels on screen, maximum number of pixels which can be plotted without overlapping. Refresh rate is the number of times in a second that display hardware updates its buffer. Display resolution is the number of distinct pixels in each dimension that can be displayed.  Display screen is grid of points.  Frame buffer is a memory space used to store pixels' color and intensity definition. Morphing is technique that changes on image into another through seamless transition. Image based modelling rely on set of two dimensional images of scene to generate three dimensional model.  Types of Images : Bitmap, Gray scale, colour - truecolour Flickering is the gap between two frame displays. Types of Transformations : Move, Reflection, Scaling, Rotation, Shearing

Java Programs

1. print hello world using java applet.Background colour must be black. import java.applet.*;  import java.awt.*;  public class Hello extends Applet  {   public void paint(Graphics g)       {         setBackground(Color.BLACK);              g.setColor(Color.YELLOW);       g.drawString("Hello World",20,40);             } }  2. program for life cycle of applet. import java.applet.Applet; import java.awt.*; public class LifeCycle extends Applet {      String output = "";      String event;      public void init()      {           event = "Initializing...";               printOutput();      }      public void start()     ...