上一篇:asp当中判断函数一览 >>
专门采色用的JAVA原代码
| import java.awt.*; public class pickcolor { public static void main(string[] args) { pickcolor pc = new pickcolor(); color color = pc.pickcolor(); system.out.println("color = "+color); } public color pickcolor() { color pixel = new color(0,0,0); robot robot = null; point mousepoint; int r,g,b; // mouseinfo mouseinfo = new mouseinfo(); try { robot = new robot(); } catch (awtexception e) { e.printstacktrace(); system.exit(1); } mousepoint = mouseinfo.getpointerinfo().getlocation(); pixel = robot.getpixelcolor(mousepoint.x,mousepoint.y); r = pixel.getred(); g = pixel.getgreen(); return pixel; } } 下一篇:玩透9种网页弹出窗口 >> 相关文章:
© 2006 www.java-asp.net
|
