⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shrinkstretchfilteruse.java

📁 包含6个源码。主要是使用APPLET对图形图像进行处理。 有旋转
💻 JAVA
字号:
import java.awt.*;
import java.applet.Applet;
import java.awt.image.*;

public class shrinkStretchFilterUse extends Applet
{
	Image img,stretch,shrink;
	int nwidth,nheight;
	
	public void init()
	{
		img = getImage(getDocumentBase(),getParameter("image"));
		MediaTracker mt = new MediaTracker(this);
		mt.addImage(img,0);
		try
		{
			mt.waitForAll();
		}
		catch(InterruptedException ie)
		{
			ie.printStackTrace();
		}
	
		nwidth = img.getWidth(this);
		nheight =img.getHeight(this);
	
		ImageFilter stretchF = new ReplicateScaleFilter(nwidth * 2,nheight * 2);
		FilteredImageSource stretchS = new FilteredImageSource(img.getSource(),stretchF);
		stretch = createImage(stretchS);
		ImageFilter shrinkF = new ReplicateScaleFilter(nwidth / 2,nheight / 2);
		FilteredImageSource shrinkS = new FilteredImageSource(img.getSource(),shrinkF);
		shrink = createImage(shrinkS);
	}
	
	public void paint(Graphics g)
	{
		g.drawImage(img,0,0,this);
		g.drawImage(shrink,nwidth + 50,0,this);
		g.drawImage(stretch,nwidth + 100,0,this);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -