個人覺得這個方法比用flashcom要便宜的多,就是有點費資源,不過要求的環境非常簡單。過兩天給大家看看一個正式應用的
[url=http://220.194.55.60:8080/bitmap/MDT.html]http://220.194.55.60:8080/bitmap/MDT.html[/url]
這是我用Flash8的位圖緩沖制作的大頭貼應用。
完全獨立于FlashCom,這個大頭貼不像以前的,要FlashCommunicationServer來幫助。
這個利用Flash8的位圖緩沖技術制作,不需要FlashCommunicationServer
服務端的java程式編寫真是費了我老大的勁啊!!熬了兩天,不過還算值得,哈哈
注意:如果要測試,必須有一個攝像頭和Flash Player 8才行。(其實,攝像頭也不是必須的,沒有攝像頭,你就看不到真實效果,但是功能還是可以實作的,哈哈)
[url=http://220.194.55.60:8080/bitmap/MDT.html]http://220.194.55.60:8080/bitmap/MDT.html[/url]
我把javaBean給放上,還有那個接受的jsp檔案
先看jsp吧
然後是javaBean
package com.n0rthwood;
import java.io.File;
import java.io.FileOutputStream;
import java.awt.Graphics2D;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.BufferedImage;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
public class ImageSaver{
//靜态方法:參數含義:int 寬,int 高,包含顔色資訊的字元串數組,這裡如果你不明白這個數組怎麼回事,可以去看一下我前面一片blog裡提到的那個位址,那裡有關于flash檔案如何寫,還有傳遞到伺服器的所有參數。
public static void JpgTset(int width,int height,String[] rowColor) throws Exception{
BufferedImage bufimg= new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
for(int i=0;i
本文轉自:http://www.5uflash.com/flashjiaocheng/Flashyingyongkaifa/1082.html