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

JavaͼƬ´¦Àí·½·¨——·Å´ó¡¢ËõС¡¢Çиî

import java.io.*;
import java.awt.*;
import java.awt.image.*;
import java.awt.Graphics;
import java.awt.color.ColorSpace;
import javax.imageio.ImageIO;
public class ChangeImageSize
{
    /** *//**
     * Ëõ·ÅͼÏñ
     * @param srcImageFile ԴͼÏñÎļþµØÖ·
     * @param result       Ëõ·ÅºóµÄͼÏñµØÖ·
     * @param scale        Ëõ·Å±ÈÀý
     * @param flag         Ëõ·ÅÑ¡Ôñ:true ·Å´ó; false ËõС;
     */
    public static void scale(String srcImageFile, String result, int scale, boolean flag)
    {
        try
        {
            BufferedImage src = ImageIO.read(new File(srcImageFile)); // ¶ÁÈëÎļþ
            int width = src.getWidth(); // µÃµ½Ô´Í¼¿í
            int height = src.getHeight(); // µÃµ½Ô´Í¼³¤
            if (flag)
            {
                // ·Å´ó
                width = width * scale;
                height = height * scale;
            }
            else
            {
           &n


Ïà¹ØÎĵµ£º

JavaỊ̈߳ºÏ̵߳ĵ÷¶È ÐÝÃß

JavaỊ̈߳ºÏ̵߳ĵ÷¶È-ÐÝÃß
 
JavaÏ̵߳÷¶ÈÊÇJava¶àÏ̵߳ĺËÐÄ£¬Ö»ÓÐÁ¼ºÃµÄµ÷¶È£¬²ÅÄܳä·Ö·¢»ÓϵͳµÄÐÔÄÜ£¬Ìá¸ß³ÌÐòµÄÖ´ÐÐЧÂÊ¡£
 
ÕâÀïÒªÃ÷È·µÄÒ»µã£¬²»¹Ü³ÌÐòÔ±Ôõô±àдµ÷¶È£¬Ö»ÄÜ×î´óÏ޶ȵÄÓ°ÏìÏß³ÌÖ´ÐеĴÎÐò£¬¶ø²»ÄÜ×öµ½¾«×¼¿ØÖÆ¡£
 
Ïß³ÌÐÝÃßµÄÄ¿µÄÊÇʹÏß³ÌÈóöCPUµÄ×î¼òµ¥µÄ×ö·¨Ö®Ò»£¬Ïß³ÌÐÝÃß ......

JavaỊ̈߳ºÏ̵߳ĵ÷¶È Èò½

JavaỊ̈߳ºÏ̵߳ĵ÷¶È-Èò½
 
Ï̵߳ÄÈò½º¬Òå¾ÍÊÇʹµ±Ç°ÔËÐÐ×ÅÏß³ÌÈóöCPU×ÊÔ´£¬µ«ÊÇÈ»¸øË­²»ÖªµÀ£¬½ö½öÊÇÈóö£¬Ïß³Ì״̬»Øµ½¿ÉÔËÐÐ״̬¡£
 
Ï̵߳ÄÈò½Ê¹ÓÃThread.yield()·½·¨£¬yield() Ϊ¾²Ì¬·½·¨£¬¹¦ÄÜÊÇÔÝÍ£µ±Ç°ÕýÔÚÖ´ÐеÄÏ̶߳ÔÏ󣬲¢Ö´ÐÐÆäËûÏ̡߳£
 
/**
* JavaỊ̈߳ºÏ̵߳ĵ÷¶È-Èò½
*
......

JavaỊ̈߳ºÏ̵߳ĵ÷¶È ÊØ»¤Ïß³Ì

JavaỊ̈߳ºÏ̵߳ĵ÷¶È-ÊØ»¤Ïß³Ì
 
ÊØ»¤Ïß³ÌÓëÆÕͨÏß³Ìд·¨ÉÏ»ù±¾Ã´É¶Çø±ð£¬µ÷ÓÃÏ̶߳ÔÏóµÄ·½·¨setDaemon(true)£¬Ôò¿ÉÒÔ½«ÆäÉèÖÃΪÊØ»¤Ï̡߳£
 
ÊØ»¤Ïß³ÌʹÓõÄÇé¿ö½ÏÉÙ£¬µ«²¢·ÇÎÞÓ㬾ÙÀýÀ´Ëµ£¬JVMµÄÀ¬»ø»ØÊÕ¡¢ÄÚ´æ¹ÜÀíµÈÏ̶߳¼ÊÇÊØ»¤Ï̡߳£»¹ÓоÍÊÇÔÚ×öÊý¾Ý¿âÓ¦ÓÃʱºò£¬Ê¹ÓõÄÊý¾Ý¿âÁ¬½Ó³Ø£¬Á¬½Ó³Ø±¾ÉíÒ²°üº ......

JavaÖеÄ×Ö·û±àÂëÓë½âÂë


import
 java
.io.BufferedReader;   
import
 java
.io.FileInputStream;   
import
 java
.io.FileNotFoundException;   
import
 java
.io.FileOutputStream;   
import
 java
.io.IOException;   
import
 java
. ......

java transient¼ò½é

 ÎÒÃǶ¼ÖªµÀÒ»¸ö¶ÔÏóֻҪʵÏÖÁËSerilizable½Ó¿Ú£¬Õâ¸ö¶ÔÏó¾Í¿ÉÒÔ±»ÐòÁл¯£¬javaµÄÕâÖÖÐòÁл¯Ä£Ê½Îª¿ª·¢ÕßÌṩÁ˺ܶà±ãÀû£¬ÎÒÃÇ¿ÉÒÔ²»±Ø¹Øϵ¾ßÌåÐòÁл¯µÄ¹ý³Ì£¬Ö»ÒªÕâ¸öÀàʵÏÖÁËSerilizable½Ó¿Ú£¬Õâ¸öµÄËùÓÐÊôÐԺͷ½·¨¶¼»á×Ô¶¯ÐòÁл¯¡£
       È»¶øÔÚʵ¼Ê¿ª·¢¹ý³ÌÖУ¬ÎÒÃdz£³£»áÓöµ½ÕâÑ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ