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

JAVAÉú³É¡¾ËõÂÔͼ¡¿·½·¨

/**
  * ´´½¨ËõÂÔͼƬ
  *
  * @param orgpath
  * @param filename
  * @return
  * @description: ÃèÊö
  */
//´Ë·½·¨¶ÔÓÚsshÏîÄ¿²¢ÇÒÕë¶Ô ÉÏ´«¹¦ÄÜʱ£¬·Ç³£ÓÐÓÃ
 public static Boolean createAbbreviateImg(String orgpath, String filename) {
  Boolean flag = true;
  String filetype = orgpath.substring(orgpath.lastIndexOf(".") + 1,
    orgpath.length());
  if ("jpg".equalsIgnoreCase(filetype)
    || "gif".equalsIgnoreCase(filetype)
    || "png".equalsIgnoreCase(filetype)) {
   try {
    Image srcImage = ImageIO.read(new File(orgpath));
    BufferedImage tag = new BufferedImage(380, 230,
      BufferedImage.TYPE_INT_RGB);
    tag.getGraphics().drawImage(srcImage, 0, 0, 380, 230, null);
    String newImage = IMG_Recroad_LOG_PATH + filename;
    FileOutputStream out = new FileOutputStream(newImage);
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    JPEGEncodeParam jep = JPEGCodec.getDefaultJPEGEncodeParam(tag);
    jep.setQuality(1, true);
    encoder.encode(tag, jep);
    srcImage.flush();
    out.close();
   } catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
   }
  } else {
   try {
    BufferedImage bis = ImageIO.read(new File(orgpath));
    int width = bis.getWidth();
    int height = bis.getHeight();
    int wantwidth = 80;// ÏëÒªµÄ¸ß¶È
    int wantheight = (wantwidth * height) / width;
  &nb


Ïà¹ØÎĵµ£º

JavaÈÕÆÚ´¦Àíº¯Êý

/*
* ´´½¨ÈÕÆÚ 2007-03-14
*
* ¹¦ÄÜ   È¡ÈÕÆÚʱ¼ä¹¤¾ß
*
*/
package com.util;

import java
.text.ParseException;
import java
.text.SimpleDateFormat;
import java
.util.Date;
import java
.util.Calendar;
import java
.util.GregorianCalendar;

/**
* ˵Ã÷:   &nbs ......

javaΪʲôÐèÒª³Ö¾Ã»¯£¿

¶ÔÏóÖ»ÄÜ´æÔÚÓÚÄÚ´æÖÐ £¬¶øÄÚ´æÖв»ÄÜÓÀ¾Ã±£´æÊý¾Ý¡£Èç¹ûÒªÓÀ¾Ã±£´æ¶ÔÏóµÄ״̬£¬ÐèÒª½øÐжÔÏóµÄ³Ö¾Ã»¯£¬¼´°Ñ¶ÔÏó´æ´¢µ½×¨ÃŵÄÊý¾Ý´æ´¢¿âÖÐ Ä¿Ç°£¬¹ØϵÊý¾Ý¿âȽȽÊÇʹÓÃ×î¹ã·ºµÄÊý¾Ý´æ´¢¿â¡£¹ØϵÊý¾Ý¿âÖдæ·ÅµÄÊǹØϵÊý¾Ý£¬ËüÊÇ·ÇÃæÏò¶ÔÏóµÄ¡£
³Ö¾Ã»¯Êǽ«JavaÐéÄâ»ú¶ÔÏó³Ö¾Ã±£´æ£¬¶ø²»Êǽ«Êý¾Ý¿âÓ³ÉäΪ¶ÔÏó£¬Í¨³£Êý¾ÝµÄ´æ´¢ ......

¡¶JavaÃæÏò¶ÔÏó±à³Ì¡·—JavaÖеļ¯ºÏ


1.¼¯ºÏµÄÌص㣺
¶¼Î»ÓÚ java.util°üÖУ¬²»ÄÜ´æ·Å»ù±¾ÀàÐ͵ÄÊý¾Ý£¬¶øÖ»ÄÜ´æ·Å¶ÔÏóµÄÒýÓ㬲Ù×÷µÄÊýÄ¿¿ÉÒÔ²»¹Ì¶¨£¨ÀàËÆÓÚ¶¯Ì¬Êý×飩¡£
2.·ÖÀࣺ
ÓÐÈý¸öÀࣺ
a.Set(¼¯)£º¶ÔÏó²»°´Ìض¨·½Ê½ÅÅÐò£¬Ã»ÓÐÖظ´ÔªËØ¡£Õâ¸öÓëÊýѧÖеļ¯ºÏ¸ÅÄî×îÏàËÆ¡£
b.List(Áбí)£º°´ÕÕË÷ÒýλÖÃÅÅÐò£¬¿ÉÒÔÓÐÖظ´ÔªËØ£¬ÔÊÐí°´ÕÕ¶ÔÏóÔÚ¼¯ºÏÖеÄË ......

JAVAÈçºÎµ÷ÓÃDOSÃüÁî

ÓÃJava±àдӦÓÃʱ£¬ÓÐʱÐèÒªÔÚ³ÌÐòÖе÷ÓÃÁíÒ»¸öÏֳɵĿÉÖ´ÐгÌÐò»òϵͳÃüÁÕâʱ¿ÉÒÔͨ¹ý×éºÏʹÓÃJavaÌṩµÄRuntimeÀàºÍProcessÀàµÄ·½·¨ÊµÏÖ¡£ÏÂÃæÊÇÒ»ÖֱȽϵäÐ͵ijÌÐòģʽ£º
...
Process process = Runtime.getRuntime().exec(".\\p.exe");
process.waitfor( );
...
ÔÚÉÏÃæµÄ³ÌÐòÖУ¬µÚÒ»Ðеē.\\p.exe& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ