• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            xiaoguozi's Blog
            Pay it forword - 我并不覺的自豪,我所嘗試的事情都失敗了······習慣原本生活的人不容易改變,就算現(xiàn)狀很糟,他們也很難改變,在過程中,他們還是放棄了······他們一放棄,大家就都是輸家······讓愛傳出去,很困難,也無法預料,人們需要更細心的觀察別人,要隨時注意才能保護別人,因為他們未必知道自己要什么·····
            package JingJiaGuo;

            import javax.imageio.*;
            import java.awt.image.*;
            import java.io.*;
            public class Image{
                
            public Image(String path)
                
            throws IOException{
                    bi
            =ImageIO.read(new File(path));
                    weight
            =bi.getWidth();
                    height
            =bi.getHeight();
                }

                
            public void SaveTo(String path,String formatname,int maxlen,boolean flag)
                
            throws FileNotFoundException,IOException{
                    
            int nw=weight,nh=height;
                    
            if(flag){
                        
            if(weight>maxlen){
                            nw
            =maxlen;
                            nh
            =height*nw/weight;
                            
            if(nh>maxlen){
                                nh
            =maxlen;
                                nw
            =weight*nh/height;
                            }

                        }

                        
            if(height>maxlen){
                            nh
            =maxlen;
                            nw
            =weight*nh/height;
                            
            if(nw>maxlen){
                                nw
            =maxlen;
                                nh
            =height*nw/weight;
                            }

                        }

                    }
            else{
                        nw
            =nh=maxlen;
                    }

                    
            int imagetype=BufferedImage.TYPE_INT_RGB;
                    
            if(formatname!="jpeg")imagetype=BufferedImage.TYPE_4BYTE_ABGR_PRE;
                    
                    ByteArrayOutputStream bous
            =new ByteArrayOutputStream();
                    BufferedImage tmp
            =new BufferedImage(nw,nh,imagetype);
                    tmp.getGraphics().drawImage(bi,
            0,0,nw,nh,null);
                    ImageIO.write(tmp,formatname,bous);
                    
                    FileOutputStream fos
            =new FileOutputStream(path);
                    fos.write(bous.toByteArray());
                    fos.close();
                }

                
            public int weight,height;
                
            public BufferedImage bi;
            }

            暫時未支持動態(tài)的gif,不過好像有個開源的gif89的一個開源庫,里面有支持動態(tài)的gif圖像處理的,記下學習筆記
            posted on 2009-05-13 22:19 小果子 閱讀(189) 評論(0)  編輯 收藏 引用 所屬分類: 學習筆記
            久久99精品国产麻豆婷婷| 色妞色综合久久夜夜| 91久久精品国产91性色也| 国産精品久久久久久久| 亚洲另类欧美综合久久图片区| 婷婷五月深深久久精品| 伊人热人久久中文字幕| 久久午夜夜伦鲁鲁片免费无码影视| 精品综合久久久久久888蜜芽| 91精品国产高清久久久久久国产嫩草| 久久亚洲天堂| 国产精品狼人久久久久影院| 久久精品国产亚洲av麻豆色欲| 一级a性色生活片久久无| 久久夜色精品国产亚洲| 99久久国语露脸精品国产| 精品久久人人爽天天玩人人妻| 一级做a爰片久久毛片看看| 久久青青草原国产精品免费| 77777亚洲午夜久久多喷| 2021国内久久精品| 日韩十八禁一区二区久久| 久久乐国产精品亚洲综合| 亚洲精品美女久久久久99| 久久精品人妻一区二区三区| 久久精品成人免费观看97| 1000部精品久久久久久久久| 中文字幕无码免费久久| 无码八A片人妻少妇久久| 污污内射久久一区二区欧美日韩| 91精品国产综合久久四虎久久无码一级 | 久久亚洲欧美国产精品| 精品久久久久久久无码| 无码超乳爆乳中文字幕久久 | 久久精品无码午夜福利理论片| 久久精品免费全国观看国产| 亚洲日韩欧美一区久久久久我| 久久精品亚洲精品国产欧美| 亚洲美日韩Av中文字幕无码久久久妻妇 | 99精品久久精品一区二区| 亚洲中文字幕无码一久久区|