Hello everybody,

can anybody help me setting up a tiff image viewer.
I have downloaded the jai package and want to make a image viewer where i can zoom in or zoom out.

I don't now where to start.
Displaying the tiff image is not the problem i also can shrink the image, but what i want is to zoom in or out when i click on the right button (zoom buttons).

ps I'am new to Java! So sorry when i write nonsense!


This is wat i got for so far:

Java Code:
import java.awt.Component;
import java.awt.image.renderable.ParameterBlock;
import java.io.File;

import javax.media.jai.JAI;
import javax.media.jai.PlanarImage;
import javax.media.jai.RenderedOp;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

import com.sun.media.jai.widget.DisplayJAI;


public class ImageModel{
	public String path;
	public String imageName;
	PlanarImage image;
	RenderedOp resizedImage;
	
	public ImageModel()
	{

		
		
		
				
	}
	
	public DisplayJAI originalImage()
	{
		
		path = System.getProperty("user.dir");
		
		
		//imageName
		imageName = "CCITT_1.TIF";
		
		String imagePath1 = path + "/" + imageName;
		
		
		image = JAI.create("fileload", imagePath1);
		System.out.println(imagePath1);
		
		DisplayJAI dj = new DisplayJAI(image);
		
		return dj;
	}
	
	public PlanarImage planarImage()
	{
		path = System.getProperty("user.dir");
		
		
		//imageName
		imageName = "CCITT_1.TIF";
		
		String imagePath1 = path + "/" + imageName;
		System.out.println(imagePath1);
		
		
		image = JAI.create("fileload", imagePath1);
		
		return image;
				
		
	}
	

	
	public DisplayJAI rescale(PlanarImage image, float scale)
	{
		//scale
		float scaleFactor= scale;
		ParameterBlock pb = new ParameterBlock();
		pb.add(scaleFactor);
		pb.add(scaleFactor);
		pb.add(0.0f);
		pb.add(0.0f);
		pb.addSource(image);
		
	    
		
		resizedImage = JAI.create("scale", pb, null);
		DisplayJAI dj = new DisplayJAI(resizedImage);
		return dj;
	}

}