Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

¼òµ¥µÄjavaͼÏñ²Ã¼õ

/**
* ¶ÔͼƬ²Ã¼ô£¬²¢°Ñ²Ã¼ôÍêµ°ÐÂͼƬ±£´æ ¡£
*
* @param srcpath: ±»²Ã¼õµÄͼƬÍêÕû·¾¶
* @param tarpath: ÒѲüõµÄÐÂͼƬ±£´æÍêÕûµÄ·¾¶
* @param x: ²Ã¼õ¾ØÐÎÇøÓò×óÉ϶¥µãË®Æ½Î»ÒÆ
* @param y: ²Ã¼õ¾ØÐÎÇøÓò×óÉ϶¥µã´¹Ö±Î»ÒÆ
* @param width: ²Ã¼õ¾ØÐÎÇøÓòµÄ¿í¶È
* @param height: ²Ã¼õ¾ØÐÎÇøÓòµÄ¸ß¶È
*/
public static void cut(String srcpath, String tarpath, int x, int y, int width, int height) {
try {
// ¶ÁȡͼƬÎļþ
FileInputStream is = new FileInputStream(srcpath);
// »ñȡͼƬÁ÷
ImageInputStream iis = ImageIO.createImageInputStream(is);
// ת»¯³ÉÊä³öÁ÷
BufferedImage outputImage = getSubimage(ImageIO.read(iis), x, y, width, height);
// ±£´æÐÂͼƬ
if (null != outputImage) {
ImageIO.write(outputImage, "jpg", new File(tarpath));
}
} catch (IOException e) {
e.printStackTrace();
}
}
public static BufferedImage getSubimage(BufferedImage inputImage, int x, int y, int width, int height) {
return getSubimage(inputImage, new Rectangle(x, y, width, height));
}
public static BufferedImage getSubimage(BufferedImage inputImage, Rectangle rect) {
if (rect.x < 1 || rect.y < 1 || rect.x > inputImage.getWidth() || rect.y > inputImage.getHeight()) {
return null;
}
int x = Math.min(inputImage.getWidth(), rect.x);
int y = Math.min(inputImage.getHeight(), rect.y);
int width = Math.min(inputImage.getWidth() - x, rect.width);
int height = Math.min(inputImage.getHeight() - y, rect.height);
return inputImage.getSubimage(x, y, width, height);
}


Ïà¹ØÎĵµ£º

JavaÖеÄimport

 
¡¡ ÓÐЩÈËдÁËÒ»Õó×Ó Java£¬¿ÉÊǶÔÓÚ Java µÄ package ¸ú import »¹ÊDz»Ì«Á˽⡣ºÜ¶àÈËÒÔΪԭʼÂë .java ÎļþÖÐµÄ import »áÈñàÒëÆ÷°ÑËù import µÄ³ÌÐòͨͨдµ½±àÒëºÃµÄ .class µµ°¸ÖУ¬»òÊÇÈÏΪ import ¸ú C/C++ µÄ #include ÏàËÆ£¬Êµ¼ÊÉÏ£¬ÕâÊÇ´íÎóµÄ¹ÛÄî¡£
¡¡¡¡
¡¡¡¡ÈÃÎÒÃÇÏÈÁ˽âһϣ¬Java µÄ package ......

java ÖеÄÀàÓë½Ó¿Ú¶¨ÒåʵÀý

java½Ó¿ÚʵÀý
2009-03-10 09:00:18.0      À´Ô´:ÖйúJAVA¼¼ÊõÍø   
¹Ø¼ü´Ê£º  java     ½Ó¿Ú     Âë  
½üÈÕÔÚ±à³ÌÖÐÓõ½½Ó¿Ú֪ʶ,ÓÉÓڿα¾ÖжԽӿÚÃèÊö½ÏÉÙ,ËùÒÔÏë´ÓÍøÉϲéÕÒ×ÊÁÏ,µ«ÍøÉϵÄ×ÊÁÏ´ó¶àÒ²Ö»ÊÇÈß³¤µÄÃèÊö,ËùÒÔÔ ......

Lucene£º»ùÓÚJavaµÄÈ«ÎļìË÷ÒýÇæ¼ò½é


LuceneÊÇÒ»¸ö»ùÓÚJavaµÄÈ«ÎÄË÷Òý¹¤¾ß°ü¡£
»ùÓÚJavaµÄÈ«ÎÄË÷ÒýÒýÇæLucene¼ò½é£º¹ØÓÚ×÷ÕߺÍLuceneµÄÀúÊ·
È«ÎļìË÷µÄʵÏÖ£ºLueneÈ«ÎÄË÷ÒýºÍÊý¾Ý¿âË÷ÒýµÄ±È½Ï
ÖÐÎÄÇзִʻúÖÆ¼ò½é£º»ùÓÚ´Ê¿âºÍ×Ô¶¯ÇзִÊËã·¨µÄ±È½Ï
¾ßÌåµÄ°²×°ºÍʹÓüò½é£ºÏµÍ³½á¹¹½éÉܺÍÑÝʾ
Hacking
Lucene£º¼ò»¯µÄ²éѯ·ÖÎöÆ÷£¬É¾³ýµÄʵÏÖ£¬¶¨ÖƵÄÅÅÐ ......

ºǫ́×Ô¶¯·¢Óʼþ java´úÂë

import java.util.Properties;
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class SendMail {
 /**
  * @param args
  */
 public static void main ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ