亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? morph.java

?? Java Applet入門教程
?? JAVA
字號:
//Applet : Morph  -  Sep 11 '99.
//Author : Laxmi Narayana .Kota
// E-mail id: laxmikota@hotmail.com

import java.awt.*;
import java.awt.image.*;
import java.awt.event.*;
import java.applet.*;


public class Morph extends Applet implements Runnable{
  boolean isStandalone = false;
  int w,h,cnt=0,cnt1=0,totalpictures,temp,max,delay;
  int buf[],clearbuf[],bufimg[][],imagewidth,imageheight;
  static int zoomout=1;
  int lsmargin[],rsmargin[],ldmargin[],rdmargin[],lscnt=0,rscnt=0,clear[],ldcnt=0,rdcnt=0;
  int srcdif,dstdif,tempdif,xdif,xinc;
  int tcnt=0, bcnt=0,tsmargin=0,bsmargin=0,tdmargin=0,bdmargin=0;
  int dsthdif,srchdif,preh,yinc;
// l - left ; r- right; ls - left source; rs - right source
// t- top of the image; b - bottom of the image
// ld - left margin of destination image
// rd - right margin 0f destination image

  Thread t;
  Image img[],img1;
  MediaTracker med;
  PixelGrabber pg[];
  String imagenames[],bgcolor,fontcolor,author;

  Graphics offscreengraphics;
  Image offscreenimage=null;

  public String getParameter(String key, String def) {
    return isStandalone ? System.getProperty(key, def) :
      (getParameter(key) != null ? getParameter(key) : def);
  }

  public Morph() {
  }

  public void init() {
    //t=new Thread(this);
    try{
        totalpictures=Integer.parseInt(getParameter("totalpictures","0"));
        bgcolor=this.getParameter("bgcolor","0x000000");
        fontcolor=this.getParameter("fontcolor","0x00ff00");
        max=Integer.parseInt(getParameter("fadecount","30"));
	      delay=Integer.parseInt(getParameter("delay","30"));
        author=getParameter("author","");
    }catch(Exception exce){}
    if(!author.equalsIgnoreCase("Laxminarayana.kota"))
    System.exit(0);
    this.setBackground(new Color(Integer.parseInt(bgcolor.substring(2),16)));
    img=new Image[totalpictures];
    imagenames=new String[totalpictures];
    if(totalpictures >0 )
    { try{
           for(int i=0;i<totalpictures;i++)
           imagenames[i]=getParameter("imagenames["+i+"]","");
         }catch(Exception exce){}
    }

  for(int i=0;i<totalpictures;i++)
    img[i]=getImage(getCodeBase(),imagenames[i]);

  med=new MediaTracker(this);
  for(int i=0;i<img.length;i++)
  med.addImage(img[i],0);

  //t.start();
  }
  public void start() {
   t= new Thread(this);
   t.start();
  }
  public void run()
  {
    try{
     med.waitForAll();
     imagewidth=img[0].getWidth(null);imageheight=img[0].getHeight(null);
     buf=new int[imagewidth*imageheight];clearbuf=new int[imagewidth*imageheight];
     lsmargin=new int[imageheight];rsmargin=new int[imageheight];
     ldmargin=new int[imageheight];rdmargin=new int[imageheight];
     clear=new int[imageheight];

     for(int i=0;i<imageheight;i++)
     for(int j=0;j<imagewidth;j++)
      {buf[imagewidth*i+j]=0xffffff; clearbuf[imagewidth*i+j]=0xffffff;}

     for(int i=0; i<imageheight; ++i)
      clear[i]=0;

     bufimg=new int[img.length][imagewidth*imageheight];
     clear=new int[imageheight];pg=new PixelGrabber[img.length];

     for(int i=0;i<img.length;i++)
     {pg[i]=new PixelGrabber(img[i],0,0,imagewidth,imageheight,bufimg[i],0,imagewidth);
      pg[i].grabPixels();
     }

   }catch (InterruptedException exce){getAppletContext().showStatus("Loading images is failed");}

   try{
    for(;;){
     cnt++;
     if(cnt>max)
     { cnt1++; if(cnt1>img.length-1)cnt1=0;
       cnt=0;
     }
     temp=(cnt1 <(img.length-1)) ? 1+cnt1 : 0;



   System.arraycopy(clearbuf,0,buf,0,imagewidth*imageheight);
   tcnt=0;

  /* System.arraycopy(clear,0,lsmargin,0,imageheight);
   System.arraycopy(clear,0,rsmargin,0,imageheight);
   System.arraycopy(clear,0,ldmargin,0,imageheight);
   System.arraycopy(clear,0,rdmargin,0,imageheight);*/
  if(cnt>=0 && cnt<=1){
   for(int i=0; i<imageheight; ++i) // left margin of source image
   {lscnt=0;rscnt=0;
    for(int j=0; j<zoomout*imagewidth; ++j)
    { if(lscnt==0 && j>0){
       if( filter(bufimg[cnt1][imagewidth*i+j*imagewidth/(zoomout*imagewidth)],11) != filter(bufimg[cnt1][imagewidth*i],11) ){
       lsmargin[i]=j/zoomout;lscnt++;
       if(tcnt==0){tsmargin=i;tcnt++;}else tcnt++;}
      }
    }
   }
   bsmargin=tcnt + tsmargin;tcnt=0; // takes up the bottom margin of the image

   for(int i=0; i<imageheight; ++i) // for right margin of soure image
   {rscnt=0;
    for(int j=0; j<zoomout*imagewidth; ++j)
    { if (rscnt==0 && j<zoomout*imagewidth){
       if( filter(bufimg[cnt1][imagewidth*i+(zoomout*imagewidth-1-j)*imagewidth/(zoomout*imagewidth)],11) != filter(bufimg[cnt1][imagewidth*i+imagewidth-1],11) ){
       rsmargin[i]=j/zoomout;rscnt++;}
      }
     }
    }

   for(int i=0; i<imageheight; ++i)// left margin of destination image
   {ldcnt=0;rdcnt=0;
    for(int j=0; j<zoomout*imagewidth; ++j)
    { if(ldcnt==0 && j>0){
       if( filter(bufimg[temp][imagewidth*i+j*imagewidth/(zoomout*imagewidth)],11) != filter(bufimg[temp][imagewidth*i],11) ){
       ldmargin[i]=j/zoomout;ldcnt++;
        if(tcnt==0){tdmargin=i;tcnt++;}else tcnt++; }
      }
    }
   }
  bdmargin=tcnt+tdmargin;tcnt=0; // bottom margin of the destination image

  for(int i=0; i<imageheight; ++i) //right margin of destination image
  { rdcnt=0;
    for(int j=0; j<zoomout*imagewidth; ++j)
    {  if (rdcnt==0 && j<zoomout*imagewidth){
       if( filter(bufimg[temp][imagewidth*i+(zoomout*imagewidth-1-j)*imagewidth/(zoomout*imagewidth)],11) != filter(bufimg[temp][imagewidth*i+imagewidth-1],11) ){
       rdmargin[i]=j/zoomout;rdcnt++;}
      }
    }
  }
  }
  for(int k=0;k<imageheight;++k)
  { dsthdif=bdmargin-tdmargin; //132
    srchdif=bsmargin-tsmargin; // 76
    yinc=tsmargin - (tsmargin - tdmargin)*cnt/max;//27-25*30/30=2
    preh=srchdif - (srchdif - dsthdif)*cnt/max;//76- (-56)*30/30=134
   if(k>=yinc && k<=yinc+preh)
   {for(int j=0;j<imagewidth;++j)
    {int scalehsrc,scalehdst;
      scalehsrc=tsmargin+(k-yinc)*srchdif/preh;//27+(132)*76/132
      scalehdst=tdmargin+(k-yinc)*dsthdif/preh;//2+76*132/76
      dstdif=(imagewidth-1-rdmargin[scalehdst]) - ldmargin[scalehdst];
      srcdif=(imagewidth-1-rsmargin[scalehsrc]) - lsmargin[scalehsrc];
      xdif=lsmargin[scalehsrc] - ldmargin[scalehdst];
      xinc=lsmargin[scalehsrc] - xdif*(cnt)/max; //(max-cnt)/max;
      tempdif=srcdif - (srcdif-dstdif)*(cnt)/max;
      if(j>xinc && j<=xinc+tempdif)
      {int x1,x;
       x=imagewidth*scalehsrc+lsmargin[scalehsrc]+(j-xinc)*srcdif/tempdif;// for src image
       x1=imagewidth*scalehdst+ldmargin[scalehdst]+(j-xinc)*dstdif/tempdif;// for dst image
       buf[imagewidth*k+j]=0xff<<24 |( compositefilter(bufimg[cnt1][x],max-cnt)+compositefilter(bufimg[temp][x1],cnt));
      }else   buf[imagewidth*k+j]=0xff000000;
    }
   }
   }
	   img1=createImage(new MemoryImageSource(imagewidth,imageheight,buf,0,imagewidth));
     if(cnt==max)  t.sleep(1000);
     else  t.sleep(delay);
     repaint();
    }
  }catch(InterruptedException e){}

  }
   public synchronized void update(Graphics g)
  {
   Dimension d = getSize();
    if((offscreenimage == null))
    {
      offscreenimage = createImage(d.width, d.height);
      offscreengraphics= offscreenimage.getGraphics();
    }
    offscreengraphics.setColor(getBackground());
    offscreengraphics.fillRect(0, 0, d.width, d.height);
    paint(offscreengraphics);
    g.drawImage(offscreenimage, 0, 0,this);
  }

  public void paint(Graphics g)
  {
   if(med.statusAll(false)==med.COMPLETE)
    g.drawImage(img1,0,0,this);
   else
   { g.setColor(new Color(Integer.parseInt(fontcolor.substring(2),16)));
     g.drawString("Loading Images Please wait...",20,100);
   }
  }

  public void stop() {
  t.interrupt();
  }
  public void destroy() {
  if(t != null){t=null;}
  }

  public String getAppletInfo() {
    return "Morph  by LaxmiNarayana.Kota, Java vesion 1.0.2 - 11 Sep '99";
  }

  public String[][] getParameterInfo() {
    return null;
  }

  public int filter(int rgb,int percent)
  { int r,g,b,temp;
    r=rgb>>16 & 0xff; g=rgb>>8 & 0xff; b=rgb & 0xff;
    r=r*8/100;g=g*8/100;b=b*8/100;
    return (0xff<<24 | r<<16 | g<<8 | b) ;
  }
 public int compositefilter(int rgb, int percent)
 { int r,g,b;
   r=rgb>>16 & 0xff; g=rgb>>8 & 0xff; b=rgb & 0xff;
   r=r*percent/max;g=g*percent/max;b=b*percent/max;
   return (0xff<<24 | r<<16 | g<<8 | b) ;

 }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩美女一区二区三区四区| 日韩三级.com| 成人深夜视频在线观看| 国产一区二区三区四区五区美女| 日韩av一区二区在线影视| 亚洲午夜精品17c| 三级成人在线视频| 久久国产精品99久久久久久老狼 | 亚洲自拍都市欧美小说| 亚洲在线视频免费观看| 日韩av中文字幕一区二区三区| 麻豆成人免费电影| 国产成人综合自拍| 色婷婷国产精品久久包臀| 欧美日韩中文字幕一区二区| 欧美一区二区精品久久911| 日韩欧美一卡二卡| 国产精品视频麻豆| 亚洲成人激情av| 狠狠色综合日日| caoporen国产精品视频| 欧美三级中文字| 26uuu久久天堂性欧美| 亚洲国产高清aⅴ视频| 性久久久久久久久| 国产一区二区三区美女| 色综合欧美在线| 日韩欧美卡一卡二| 亚洲欧美国产高清| 日韩在线a电影| 成人黄色免费短视频| 欧美日韩精品一区二区天天拍小说| 日韩欧美自拍偷拍| 亚洲另类春色国产| 国产一区久久久| 欧美图区在线视频| 国产色综合一区| 视频一区视频二区在线观看| 国产a久久麻豆| 欧美一区二区三区思思人| 中文字幕一区二区三区av| 青青草国产精品97视觉盛宴| 97久久精品人人做人人爽| 精品久久久久香蕉网| 亚洲综合一二区| 成人av在线影院| 日韩免费高清视频| 一区二区不卡在线播放| 国产成人精品亚洲午夜麻豆| 欧美日韩国产美女| 亚洲毛片av在线| 大陆成人av片| 精品国产凹凸成av人网站| 亚洲一级片在线观看| 91色九色蝌蚪| 国产精品短视频| 国产精品综合一区二区三区| 欧美成人性战久久| 免费av成人在线| 欧美久久婷婷综合色| 亚洲激情中文1区| 99精品视频在线免费观看| 国产欧美日韩激情| 国产一区91精品张津瑜| 精品动漫一区二区三区在线观看| 婷婷久久综合九色国产成人| 欧美自拍偷拍一区| 亚洲电影视频在线| 欧美丰满少妇xxxxx高潮对白| 一区二区三区成人| 欧美优质美女网站| 同产精品九九九| 这里只有精品99re| 免费看欧美美女黄的网站| 日韩欧美一级片| 久久99国产精品免费网站| 日韩欧美国产一二三区| 狠狠色丁香久久婷婷综合丁香| 日韩美一区二区三区| 国产在线看一区| 中文字幕欧美三区| 99精品视频一区二区三区| 亚洲主播在线播放| 日韩欧美在线123| 国模无码大尺度一区二区三区 | 懂色中文一区二区在线播放| 国产偷国产偷亚洲高清人白洁| 国产suv精品一区二区6| 中文字幕一区二区在线观看 | 亚洲一级电影视频| 欧美日韩一区二区三区四区五区 | 黑人巨大精品欧美一区| 久久久久国产精品人| 波多野结衣中文字幕一区| 一区二区三区欧美| 欧美成人vps| gogo大胆日本视频一区| 天堂av在线一区| 久久一二三国产| 91在线观看一区二区| 午夜婷婷国产麻豆精品| 久久综合久久综合亚洲| 99精品黄色片免费大全| 午夜精品福利一区二区三区蜜桃| 精品国产一区二区三区久久影院| 大尺度一区二区| 亚洲www啪成人一区二区麻豆| 日韩免费视频一区| 91视频免费播放| 麻豆国产精品官网| 亚洲欧美日韩国产中文在线| 日韩欧美色综合网站| 色婷婷狠狠综合| 国产成人在线视频免费播放| 亚洲第一二三四区| 中文字幕精品在线不卡| 91精品在线麻豆| 99精品视频在线观看免费| 老司机午夜精品| 午夜精品久久久久久久99樱桃| 国产欧美日韩在线观看| 欧美一区二区三区免费观看视频| 成人精品高清在线| 久久机这里只有精品| 天堂影院一区二区| 亚洲人午夜精品天堂一二香蕉| 日韩精品专区在线影院重磅| 欧美主播一区二区三区美女| 粉嫩aⅴ一区二区三区四区五区| 男人的天堂亚洲一区| 亚洲在线中文字幕| 亚洲视频1区2区| 国产精品黄色在线观看| 久久亚洲影视婷婷| 欧美刺激午夜性久久久久久久| 欧美视频第二页| 91美女在线观看| 99久久精品国产毛片| 国产精品自在在线| 国产精品资源在线观看| 精品影视av免费| 日韩成人午夜电影| 青青青爽久久午夜综合久久午夜| 亚洲电影一区二区三区| 亚洲一区影音先锋| 一区av在线播放| 亚洲一区二区欧美激情| 一区二区三区精密机械公司| 一区二区三区精品在线| 一区二区三区在线不卡| 一区二区国产视频| 亚洲一区二区3| 午夜在线电影亚洲一区| 天天综合网天天综合色| 日本亚洲三级在线| 国产在线观看一区二区| 国产精品911| 成人av电影在线| 日本精品视频一区二区三区| 在线视频一区二区免费| 欧美日韩免费一区二区三区 | 97久久久精品综合88久久| 色综合久久99| 欧美日韩国产综合一区二区三区 | 欧美日韩国产影片| 欧美高清精品3d| 久久久久国色av免费看影院| 国产精品美女久久久久久久| 亚洲色图制服丝袜| 日韩精品一级二级| 国产精品自在在线| 91福利在线观看| 日韩一区二区三区电影在线观看| 欧美大胆人体bbbb| 中文字幕一区二区三区四区| 午夜欧美大尺度福利影院在线看| 理论片日本一区| 91蝌蚪国产九色| 日韩一二三区不卡| 国产精品毛片高清在线完整版| 一区二区三区在线视频免费| 蜜臀av国产精品久久久久| 成人污污视频在线观看| 欧美亚洲精品一区| 久久精子c满五个校花| 亚洲视频一二三区| 久国产精品韩国三级视频| 成人美女视频在线观看| 91精品在线麻豆| 亚洲免费观看视频| 精品一区二区三区蜜桃| 91福利区一区二区三区| 久久综合九色综合97婷婷| 亚洲一区二区视频| 成人精品一区二区三区中文字幕| 欧美日本国产视频| 亚洲天堂免费在线观看视频| 另类专区欧美蜜桃臀第一页| 欧美三级三级三级爽爽爽| 国产精品伦理一区二区|