この記事の例では、写真をWebサイトにアップロードする方法について説明します。あなたの参照のために全員のためにそれを共有してください。詳細は次のとおりです。
最近、私は卒業生の記録に行きました。みんなが勉強するためにそれを送ってください。議論してください!
非常に古いコード
/******************************************* ** <p> Javaの写真の操作(JPGのみ)</p>*写真の署名<br>*写真の収縮<br>* <p>タイトル:Javaの写真の操作(のみ缶のみができますjpg)</p>* <p> createdata:2004-12-2 </p>* <p>説明:</p>* <p> Copyright:Copyright(c)2004 </p> *@authororrrrr王凯*@version 1.0 ********************************************************* *** *** Com.cn.wangk.test; awt。 ImageObserver; Import javax.imageio.imageio;/*** @author wangkai*/public class test {/****/public test(){try {//生成以后新的图片地址ファイルfo = new file ( "C://4.jpg"); /ピクチャーファイルをシールするtoiagepth "c://1.jpg";ファイルjpegimagedecoder = jpegcodec.createjpegdecoder(//)新しいファイル(toimagepth); = null; int x = image2.getWidth();存在しません"、image.getWidth()-180、image.getheight()-10);} g.dispose(); imageio.write(image、" jpeg "、fo); system.out.println(" ok "); on e){// Catch block e.printstacktrace();} catch(yageformatexception e){// Catch block e.printstacktrace();} catch(ioexception)Catch block E. printStacktrace(); }} public void savefixedboundicon(ファイルImageFile、int height、int width)スロー{double比= 0.0;ファイル! "); string filepath = imagefile.getPath(); buffredimage bi = imagefile); if(bi.getheight()> deep)||(bi.getWidth()> width){{if( bi.getheight()> bi.getWidth()){new Integer(height)) / bi.getheight();} / bi.getWidth();} file savefile = new file(filepath + "_" + "_" + width + ".jpg"); Affintransformop = new affintransformop(affintransform.getscaleinstance、null); ){}}} public static void main(string [] args){// test ts = new test(); );} catch(Exception E){// Catch block e.printstacktrace();}}}}}を自動的に生成しますこの記事がすべての人のJavaプログラムのデザインに役立つことが期待されています。