我有源代码,留下mail 我给你发过去
解决方案 »
- 高分!求教Java混淆器或者class文件加密工具
- 怎么样隐藏JTable的列
- 关于main函数:
- 请教关于JScrollPane和画图意见
- 初级问题,一个数据库连接能不能用来同时create多个statement?
- public static void main(String args[]){...},父类与子类同时定义有这样的main方法,但在子类中运行main时,程序却跑到父类的main中执
- JBuilder 7特征!!!
- 安装JBuilder 求助
- 查询页面得到Sverlet传递过来的String 后,执行查询(有分页),在页面的最后将结果集关闭,那么我如何保持这个Sverlet传递过来的String?(如我
- java编写一个多线程同时运行的代码
- 请问。我的Oracle的数据库连接应该怎么写??一直不对。谢谢
- 郁闷?????,散分(来者有分)
int w = img.getWidth(this) ;int h = img.getHeight(this) ;
ImageFilter imgFilter = new TransparentImageFilter(w, h) ;FilteredImageSource fImgSource = new FilteredImageSource(img.getSource(), imgFilter) ;img2 = this.createImage(fImgSource) ;}
public void paint(Graphics g) {g.drawImage(img, 0, 0, this) ;g.drawImage(img2, 100, 100, this) ;}}/*** RGBImageFilter Extends Class - TransparentImageFilter*/
class TransparentImageFilter extends RGBImageFilter {
private int width = 0 ;private int height = 0 ;
public TransparentImageFilter(int width, int height) {this.width = width ;this.height = height ;}
public int filterRGB(int x, int y, int rgb) {DirectColorModel cm = (DirectColorModel)ColorModel.getRGBdefault() ;int alpha = cm.getAlpha(rgb) ;int red = cm.getRed(rgb) ;int green = cm.getGreen(rgb) ;int blue = cm.getBlue(rgb) ;
alpha = 255 * y / height ;return alpha << 24 | red << 16 | green << 8 | blue ;} }class TransparentImageFilter extends RGBImageFilter {
private int width = 0 ;private int height = 0 ;
public TransparentImageFilter(int width, int height) {canFilterIndexColorModel = true ; // 添加的代码this.width = width ;this.height = height ;}
public int filterRGB(int x, int y, int rgb) {DirectColorModel cm = (DirectColorModel)ColorModel.getRGBdefault() ;int alpha = cm.getAlpha(rgb) ;int red = cm.getRed(rgb) ;int green = cm.getGreen(rgb) ;int blue = cm.getBlue(rgb) ;
alpha = 80 ; // 修改的代码return alpha << 24 | red << 16 | green << 8 | blue ;} }public int filterRGB(int x, int y, int rgb){DirectColorModel cm = (DirectColorModel)ColorModel.getRGBdefault() ;int alpha = cm.getAlpha(rgb) ;int red = cm.getRed(rgb) ;int green = cm.getGreen(rgb) ;int blue = cm.getBlue(rgb) ;
if (red == 255 && green ==255 && blue == 255)alpha = 0 ;return alpha << 24 | red << 16 | green << 8 | blue ;}
谢谢拉
:)