📄 cropfilter.java
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3)
// Source File Name: CropFilter.java
package se.southend.drops.pixelfilter;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
// Referenced classes of package se.southend.drops.pixelfilter:
// Filter
public class CropFilter
implements Filter
{
public CropFilter()
{
}
public CropFilter(Image fromImage)
{
setImage(fromImage);
}
public Image getImage()
{
return image;
}
public int[] getRGB()
{
return null;
}
public int getWidth()
{
return wCrop;
}
public int getHeight()
{
return hCrop;
}
public void setCropRegion(int x, int y, int width, int height)
{
xCrop = x;
yCrop = y;
wCrop = width;
hCrop = height;
}
public void setImage(Image fromImage)
{
image = fromImage;
if(fromImage != null)
{
width = fromImage.getWidth();
height = fromImage.getHeight();
} else
{
width = height = 0;
}
setCropRegion(0, 0, width, height);
}
public void setRGB(int ai[], int i, int j)
{
}
public void render()
{
}
public void paintAt(Graphics graphics, int x, int y)
{
int xTemp = xCrop;
int yTemp = yCrop;
int wTemp = wCrop;
int hTemp = hCrop;
if(xTemp < 0)
{
x -= xTemp;
xTemp = 0;
}
if(yTemp < 0)
{
y -= yTemp;
yTemp = 0;
}
if(wTemp > width)
wTemp = width;
if(hTemp > height)
hTemp = height;
if((wTemp > 0) & (hTemp > 0))
graphics.drawRegion(image, xTemp, yTemp, wTemp, hTemp, 0, x, y, 0);
}
protected Image image;
protected int width;
protected int height;
protected int xCrop;
protected int yCrop;
protected int wCrop;
protected int hCrop;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -