• <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 - 我并不覺的自豪,我所嘗試的事情都失敗了······習(xí)慣原本生活的人不容易改變,就算現(xiàn)狀很糟,他們也很難改變,在過程中,他們還是放棄了······他們一放棄,大家就都是輸家······讓愛傳出去,很困難,也無法預(yù)料,人們需要更細(xì)心的觀察別人,要隨時注意才能保護(hù)別人,因為他們未必知道自己要什么·····
            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圖像處理的,記下學(xué)習(xí)筆記
            posted on 2009-05-13 22:19 小果子 閱讀(188) 評論(0)  編輯 收藏 引用 所屬分類: 學(xué)習(xí)筆記
            99久久综合狠狠综合久久止| 久久综合久久久| 日本精品久久久久久久久免费| 精品综合久久久久久88小说| 久久99精品国产99久久6| 亚洲第一永久AV网站久久精品男人的天堂AV | 97视频久久久| 国产亚洲美女精品久久久久狼| 伊人丁香狠狠色综合久久| 久久天天婷婷五月俺也去| 久久久一本精品99久久精品88| 久久99精品九九九久久婷婷| 久久久久亚洲av无码专区喷水| 亚洲国产成人久久精品99| 久久国产亚洲精品无码| 漂亮人妻被中出中文字幕久久| 亚洲一本综合久久| 99久久国产综合精品麻豆| 性做久久久久久久久浪潮| 97精品国产97久久久久久免费| 久久亚洲精品国产精品| 国产免费久久精品99re丫y| 99久久精品九九亚洲精品| 久久午夜伦鲁片免费无码| 久久久久久久波多野结衣高潮 | 一本一本久久A久久综合精品| 国产—久久香蕉国产线看观看| 日韩乱码人妻无码中文字幕久久| 久久久久亚洲AV无码专区桃色| 久久99久久无码毛片一区二区| 91亚洲国产成人久久精品网址| 精品久久久噜噜噜久久久 | 久久亚洲国产成人影院网站| 九九99精品久久久久久| 国产一区二区精品久久| 久久国产精品成人片免费| 久久久久亚洲av无码专区导航| 精品久久久久中文字幕日本| 国产成人精品久久一区二区三区| 国产成人综合久久综合| 久久久青草久久久青草|