• <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 - 我并不覺的自豪,我所嘗試的事情都失敗了······習慣原本生活的人不容易改變,就算現狀很糟,他們也很難改變,在過程中,他們還是放棄了······他們一放棄,大家就都是輸家······讓愛傳出去,很困難,也無法預料,人們需要更細心的觀察別人,要隨時注意才能保護別人,因為他們未必知道自己要什么·····
            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;
            }

            暫時未支持動態的gif,不過好像有個開源的gif89的一個開源庫,里面有支持動態的gif圖像處理的,記下學習筆記
            posted on 2009-05-13 22:19 小果子 閱讀(188) 評論(0)  編輯 收藏 引用 所屬分類: 學習筆記
            欧美性猛交xxxx免费看久久久| 一级做a爰片久久毛片看看| 日本五月天婷久久网站| 久久99这里只有精品国产| 久久久久亚洲精品日久生情 | 亚洲v国产v天堂a无码久久| 亚洲日本va午夜中文字幕久久 | 少妇久久久久久被弄到高潮| 久久久久久伊人高潮影院| 亚洲精品乱码久久久久66| 久久精品无码一区二区三区| 精品久久久无码中文字幕天天| 久久这里有精品视频| 99久久精品日本一区二区免费| 九九热久久免费视频| 久久精品中文闷骚内射| 国内高清久久久久久| 综合久久精品色| 一级做a爰片久久毛片16| 99久久免费国产精品热| 亚洲国产另类久久久精品黑人| 久久国产亚洲精品麻豆| 波多野结衣久久一区二区| 久久国产精品久久国产精品| 久久精品国产精品亚洲精品| 精品久久人人做人人爽综合| 国产亚洲色婷婷久久99精品| 久久无码高潮喷水| 久久久久久久免费视频| 久久久久久噜噜精品免费直播| 精品国产一区二区三区久久蜜臀| 色欲久久久天天天综合网| 亚洲&#228;v永久无码精品天堂久久 | 亚洲国产天堂久久综合网站| 热re99久久精品国99热| 亚洲精品高清国产一线久久| 久久久久久国产精品美女| 久久人人爽人人爽人人片AV麻烦 | 久久婷婷是五月综合色狠狠| 久久精品18| 欧美精品丝袜久久久中文字幕 |