ʹÓÃJavaµÈ±ÈÀýËõ·ÅͼÏñ
±¾ÎÄת×Ôhttp://blog.csdn.net/nokiaguy/archive/2010/04/16/5493817.aspx
Ëõ·ÅͼÏñµÄ»ù±¾ÔÀíÊÇ´´½¨Ò»¸öÄ¿±ê´óСµÄ»²¼£¬È»ºó¶ÁȡԴͼÏñ£¬²¢½«¸ÃͼÏñ»æÖÆÕâ¸ö»²¼ÉÏ¡£ÎªÁËʹ³ÌÐòͨÓã¬Ô´Í¼ÏñºÍËõ·ÅºóµÄÄ¿±êͼÏñÓ¦Ó÷ֱðʹÓÃ
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
);
&
Ïà¹ØÎĵµ£º
ÏÖÔÚÎҾ͸ø´ó¼Ò½éÉÜÒ»ÏÂfinal¹Ø¼ü×ÖÏà¹ØµÄһЩ¶«Î÷~~~
1£¬finalÊý¾Ý
ÔÚJavaÖУ¬Ïò±àÒëÆ÷¸æÖªÒ»¿éÊý¾ÝÊǺ㶨²»±äµÄ£¬ÕâÀà³£Á¿±ØÐëÊÇ»ù±¾Êý¾ÝÀàÐÍ£¬²¢ÇÒÒԹؼü×Öfinal±íʾ£¬ÔÚ¶ÔÕâ¸ö³£Á¿½øÐж¨ÒåµÄʱºò£¬ ......
1. ¸ÅÄ ÐòÁл¯¾ÍÊǰѶÔÏó±ä³É¶ÔÏóÁ÷£¨È·ÇÐ˵ÊǰѶÔÏóµÄÊôÐÔдÈëÁ÷£©£¬Èç¹ûÐèÒª½ø¶ø¿ÉÒ԰ѶÔÏóÁ÷´æ³É¶þ½øÖÆÎļþ£»
2. Ä¿µÄ£º ÐòÁл¯µÄÄ¿µÄÊÇΪÁË·½±ãÓÀ¾Ã´æ´¢»òÕßÍøÂç´«Ê䣻
3. ÈçºÎʵÏÖ£º ½«ÀàʵÏÖSerializable½Ó¿Ú¼´¿É£¬ÎÞ±ØÐëʵÏֵķ½·¨£¬ÊµÏָýӿÚÖ»ÊÇΪÁ˱êʶ¸ÃÀà¿É±»ÐòÁл¯£»
4. £¨×ª£©ÆäËûÐèÒªÖªµÀµÄ£º
  ......
¸Õ¸Õ¿´µ½Ò»ÆªÎÄÕÂÌá³öc++¶à̬Óëjava¶à̬²»Í¬µÄµØ·½£¬»ù±¾Òâ˼ÈçÏ£º
Çë¿´C++´úÂ룺
class Base
{
public:
Base()
{
init();
}
virtual ~Base() {}
protected:
int value;
virtual void init()
{
value = 100; &nb ......
1.¾²Ì¬µ¼È룺
¾²Ì¬µ¼ÈëÊÇJDK1.5ºóмӵŦÄÜ£¬Ò»°ã²»Ôõô³£Ó㬺ܼòµ¥¸øÄã¾Ù¸öÀý×ÓÄã¾ÍÄÜÃ÷°×ÁË£¬¿´Õâ¶Î´úÂ룺
import static java.lang.System.out;//µ¼Èëjava.lang°üϵÄSystemÀàµÄ¾²Ì¬·½·¨out;
public class HelloWorld{
public static void main(String[] args){
out.print("Hello World!");//¼ÈÊÇÔÚÕ ......
JAVAµÄ¿çƽ̨µÄÌØÐÔÉîÊÜjava³ÌÐòÔ±ÃǵÄϲ°®,µ«ÕýÊÇÓÉÓÚËüΪÁËʵÏÖ¿çƽ̨µÄÄ¿µÄ,ʹµÃËüºÍ±¾µØ»úÆ÷µÄ¸÷ÖÖÄÚ²¿ÁªÏµ±äµÃºÜÉÙ,´ó´óÔ¼ÊøÁËËüµÄ¹¦ÄÜ,±ÈÈçÓëһЩӲ¼þÉ豸ͨÐÅ,ÍùÍùÒª»¨·ÑºÜ´óµÄ¾«Á¦È¥Éè¼ÆÁ÷³Ì±àд´úÂëÈ¥¹ÜÀíÉ豸¶Ë¿Ú,¶øÇÒÓÐһЩÉ豸³§ÉÌÌṩµÄÓ²¼þ½Ó¿ÚÒѾ¾¹ýÒ»¶¨µÄ·â×°ºÍ´¦Àí,²»ÄÜÖ±½ÓʹÓÃjava³ÌÐòͨ¹ý¶Ë¿ÚºÍÉè± ......