ʹÓÃJavaµÈ±ÈÀýËõ·ÅͼÏñ
±¾ÎÄΪԴ´£¬ÈçÐè×ªÔØ£¬Çë×¢Ã÷×÷Õߺͳö´¦£¬Ð»Ð»£¡
Ëõ·ÅͼÏñµÄ»ù±¾ÔÀíÊÇ´´½¨Ò»¸öÄ¿±ê´óСµÄ»²¼£¬È»ºó¶ÁȡԴͼÏñ£¬²¢½«¸ÃͼÏñ»æÖÆÕâ¸ö»²¼ÉÏ¡£ÎªÁËʹ³ÌÐòͨÓã¬Ô´Í¼ÏñºÍËõ·ÅºóµÄÄ¿±êͼÏñÓ¦Ó÷ֱðʹÓÃ
InputStreamºÍOutputStreamÀ´±íʾ£¬´úÂëÈçÏ£º
public
static
void
scaleImage(InputStream imgInputStream,
OutputStream imgOutputStream,
int
scale)
{
try
{
Image src
=
javax.imageio.ImageIO.read(imgInputStream);
int
width
=
(
int
) (src.getWidth(
null
)
*
scale
/
100.0
);
int
height
=
(
int
) (src.getHeight(
null
)
*
scale
/
100.0
);
BufferedImage bufferedImage
=
new
BufferedImage(width, height,
BufferedImage.TYPE_INT_RGB);
bufferedImage.getGraphics().drawImage(
src.getScaledInstance(width, height, Image.SCALE_SMOOTH),
0
,
0
,
null
);
&nb
Ïà¹ØÎĵµ£º
Èç¹ûÄã²»ÐèÒªÄÚ²¿Àà¶ÔÏóÓëÆäÍâΧÀà¶ÔÏóÖ®¼äÓÐÁªÏµ£¬ÄÇÄã¿ÉÒÔ½«ÄÚ²¿ÀàÉùÃ÷Ϊstatic¡£Õâͨ³£³ÆÎªÇ¶Ì×Àࣨnested class£©¡£ÏëÒªÀí½âstaticÓ¦ÓÃÓÚÄÚ²¿ÀàʱµÄº¬Ò壬Äã¾Í±ØÐë¼Çס£¬ÆÕͨµÄÄÚ²¿Àà¶ÔÏóÒþº¬µØ±£´æÁËÒ»¸öÒýÓã¬Ö¸Ïò´´½¨ËüµÄÍâΧÀà¶ÔÏó¡£È»¶ø£¬µ±ÄÚ²¿ÀàÊÇstaticµÄʱ£¬¾Í²»ÊÇÕâÑùÁË¡£Ç¶Ì×ÀàÒâζ×Å£º
1. Òª ......
1¡¢Âß¼ÔËËã·û == £¬ÔÚjavaÖÐÔËËã·û == ÊÇÓÃ×÷¶Ô±ÈÁ½¸ö¶ÔÏóµÄ±êʶÊÇ·ñÒ»Ñù£¬»òÕß¶ÔÓÚ»ù±¾ÀàÐͶøÑÔÊý¾ÝÖµÊÇ·ñÏàµÈ¡£»ù±¾ÀàÐͺͶÔÏóÊý¾ÝÖ®¼äÊDz»¿ÉÒÔÓÃÖ±½ÓÒâÒåÉϵıȽϣ¬javaÖвÉÓõÄÊǽ«¶ÔÏóÀàÐͲðÏ䣬¶øÔÚgroovyÖУ¬ÓÉÓÚ×Ô¶¯×°ÏäµÄ¹¦ÄÜ£¬Ò»Çж¼ÊǶÔÏó¡£ÒªÊ¹µÃ == ±È½ÏÓÐͨÓÃÐÔµÄÒâÒ壬groovyͨ¹ýequals()À´ÖØÔØ == Ô¤Ëã·û¡ ......
/**
* inParam:ÐèҪת»»µÄgb2312ÖÐÎÄ×Ö·û ·µ»Ø:¸ÃÖÐÎÄ×Ö·û¶ÔÓ¦µÄUTF-8±àÂëµÄ×Ö·û
*/
public static String toUTF(String inPara) {
char temChr;
&n ......
JAVAÖÐÓÃÓÚ´¦Àí×Ö·û´®µÄ“ÈýÐֵܔ
JAVAÖÐÓÃÓÚ´¦Àí×Ö·û´®³£ÓõÄÓÐÈý¸öÀࣺjava.lang.String¡¢java.lang.StringBuffer¡¢java.lang.StringBuilder£¬ÕâÈýÕߵĹ²Í¬Ö®´¦¶¼ÊÇfinalÀ࣬²»ÔÊÐí±»¼Ì³Ð£¬ÕâÖ÷ÒªÊÇ´ÓÐÔÄܺͰ²È«ÐÔÉÏ¿¼Âǵģ¬ÒòΪÕ⼸¸öÀà¶¼ÊǾ³£±»Ê¹ÓÃ×ŵģ¬ÇÒ¿¼Âǵ½·ÀÖ¹ÆäÖеIJÎÊý±»ÐÞ¸ÄÓ°Ïìµ½ÆäËüµÄÓ¦Óᣠ......
ÔÚJDK6ÖÐ ,AWTÐÂÔö¼ÓÁËÁ½¸öÀà:DesktopºÍSystemTray,ǰÕß¿ÉÒÔÓÃÀ´´ò¿ªÏµÍ³Ä¬ÈÏä¯ÀÀÆ÷ä¯ÀÀÖ¸¶¨µÄURL,´ò¿ªÏµÍ³Ä¬ÈÏÓʼþ¿Í»§¶Ë¸øÖ¸¶¨µÄÓÊÏä·¢Óʼþ,ÓÃĬÈÏÓ¦ÓóÌÐò´ò¿ª»ò±à¼Îļþ(±ÈÈç,ÓüÇʱ¾´ò¿ªÒÔtxtΪºó׺ÃûµÄÎļþ),ÓÃϵͳĬÈϵĴòÓ¡»ú´òÓ¡Îĵµ;ºóÕß¿ÉÒÔÓÃÀ´ÔÚϵͳÍÐÅÌÇø´´½¨Ò»¸öÍÐÅ̳ÌÐò.ÏÂÃæ´úÂëÑÝʾÁËDeskt ......