我指定了一个图像文件,并且将数据读取出来,如何在网页上动态的显示图片?
读取文件的代码如下:
stream=fopen("e:\\123.jpg","r+b");
length=0;
_setmode( _fileno( stdin ), _O_BINARY );
length=fread(szBuf,1,MAX_JPEG_LEN,stream);
mywrite( "\n---foo---\n" ); // 2
mywrite( "Content-Type: image/jpeg\n" );
printf("Content-Length: %d\n", length );
fclose(stream);
mywrite( "\n---foo---\n" );
请问如何将上面的文件数据转换成图像显示出来?
上面的代码只是一个试验,我实际需要的是客户端能够实时的接受一个媒体流文件,并将文件以图片的形式显示在网页上。即静态图。另一方面我们还要让他显示动态图。
请大家指教方法?另有高分奉送!!
14 个解决方案
#1
{
// Start by writing the proper content type to the client
AddHeader(pCtxt, _T("Content-Type: image/jpeg\r\n"));
char szBuff[50];
int nSize = data.GetSize();
wsprintf(szBuff, "Content-length: %ld\r\n", nSize);
AddHeader(pCtxt, szBuff);
CBinaryHtmlStream* pStream = new CBinaryHtmlStream;
ISAPIVERIFY(pStream != NULL);
for (int nCount = 0; nCount<nSize; nCount++)
*pStream << data[nCount];
*pCtxt << *pStream;
delete pStream;
}
// Start by writing the proper content type to the client
AddHeader(pCtxt, _T("Content-Type: image/jpeg\r\n"));
char szBuff[50];
int nSize = data.GetSize();
wsprintf(szBuff, "Content-length: %ld\r\n", nSize);
AddHeader(pCtxt, szBuff);
CBinaryHtmlStream* pStream = new CBinaryHtmlStream;
ISAPIVERIFY(pStream != NULL);
for (int nCount = 0; nCount<nSize; nCount++)
*pStream << data[nCount];
*pCtxt << *pStream;
delete pStream;
}
#2
请教楼上的,这段代码是放在CGI中实现的么?还是在JAVASCRIPT 中定义的函数?
请详细说明。分数奉送!
请详细说明。分数奉送!
#3
楼上的楼上这个应该是ISAPI里的吧
#4
我下午答对了要100分。
#5
struct socket_type
{
unsigned int my_port; //本机端口
unsigned int dest_port; //对方端口
unsigned int dest_ip[2]; //对方ip
unsigned int dest_node_id[3]; //对方的以太网地址
unsigned long irs; //初始化顺序号
unsigned long iss; //我的初始化序列号
unsigned long rcv_nxt; //对方的顺序号
unsigned long snd_nxt; //我的已经发送顺序号
unsigned long snd_una; //我的还没有确认顺序号
//unsigned long dest_ack_number;
unsigned int rcv_wnd; //对方的window大小
unsigned int snd_wnd; //我的window大小
unsigned int dest_max_segment_size; //对方接受的最大的数据包大小MTU
unsigned int my_max_segment_size; //我能接受的最大的数据包大小
unsigned long my_wl1; //seq
unsigned long my_wl2; //ack
unsigned char state; //连接状态
unsigned char open;
unsigned int rx_len; //length of received data in buffer
unsigned char rx_buf[1024]; //recieve data buffer
unsigned int tx_len; //length of data to send
unsigned char tx_buf[4096]; //send data buffer
};
#define LOGO_PIC_LEN 1312
#define LOGO_PIC_LEN_STR "1312\r\n"
static unsigned char code pic_logo[] = {
0X47, 0X49, 0X46, 0X38, 0X39, 0X61, 0X5F, 0X00, 0X3D, 0X00, 0XF7, 0X00, 0X00, 0X00, 0X00, 0X00,
0X80, 0X00, 0X00, 0X00, 0X80, 0X00, 0X80, 0X80, 0X00, 0X00, 0X00, 0X80, 0X80, 0X00, 0X80, 0X00,
0X80, 0X80, 0X80, 0X80, 0X80, 0XC0, 0XC0, 0XC0, 0XFF, 0X00, 0X00, 0X00, 0XFF, 0X00, 0XFF, 0XFF,
0X00, 0X00, 0X00, 0XFF, 0XFF, 0X00, 0XFF, 0X00, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X33, 0X00, 0X00, 0X66, 0X00, 0X00,
0X99, 0X00, 0X00, 0XCC, 0X00, 0X00, 0XFF, 0X00, 0X33, 0X00, 0X00, 0X33, 0X33, 0X00, 0X33, 0X66,
0X00, 0X33, 0X99, 0X00, 0X33, 0XCC, 0X00, 0X33, 0XFF, 0X00, 0X66, 0X00, 0X00, 0X66, 0X33, 0X00,
0X66, 0X66, 0X00, 0X66, 0X99, 0X00, 0X66, 0XCC, 0X00, 0X66, 0XFF, 0X00, 0X99, 0X00, 0X00, 0X99,
0X33, 0X00, 0X99, 0X66, 0X00, 0X99, 0X99, 0X00, 0X99, 0XCC, 0X00, 0X99, 0XFF, 0X00, 0XCC, 0X00,
0X00, 0XCC, 0X33, 0X00, 0XCC, 0X66, 0X00, 0XCC, 0X99, 0X00, 0XCC, 0XCC, 0X00, 0XCC, 0XFF, 0X00,
0XFF, 0X00, 0X00, 0XFF, 0X33, 0X00, 0XFF, 0X66, 0X00, 0XFF, 0X99, 0X00, 0XFF, 0XCC, 0X00, 0XFF,
0XFF, 0X33, 0X00, 0X00, 0X33, 0X00, 0X33, 0X33, 0X00, 0X66, 0X33, 0X00, 0X99, 0X33, 0X00, 0XCC,
0X33, 0X00, 0XFF, 0X33, 0X33, 0X00, 0X33, 0X33, 0X33, 0X33, 0X33, 0X66, 0X33, 0X33, 0X99, 0X33,
0X33, 0XCC, 0X33, 0X33, 0XFF, 0X33, 0X66, 0X00, 0X33, 0X66, 0X33, 0X33, 0X66, 0X66, 0X33, 0X66,
0X99, 0X33, 0X66, 0XCC, 0X33, 0X66, 0XFF, 0X33, 0X99, 0X00, 0X33, 0X99, 0X33, 0X33, 0X99, 0X66,
0X33, 0X99, 0X99, 0X33, 0X99, 0XCC, 0X33, 0X99, 0XFF, 0X33, 0XCC, 0X00, 0X33, 0XCC, 0X33, 0X33,
0XCC, 0X66, 0X33, 0XCC, 0X99, 0X33, 0XCC, 0XCC, 0X33, 0XCC, 0XFF, 0X33, 0XFF, 0X00, 0X33, 0XFF,
0X33, 0X33, 0XFF, 0X66, 0X33, 0XFF, 0X99, 0X33, 0XFF, 0XCC, 0X33, 0XFF, 0XFF, 0X66, 0X00, 0X00,
0X66, 0X00, 0X33, 0X66, 0X00, 0X66, 0X66, 0X00, 0X99, 0X66, 0X00, 0XCC, 0X66, 0X00, 0XFF, 0X66,
0X33, 0X00, 0X66, 0X33, 0X33, 0X66, 0X33, 0X66, 0X66, 0X33, 0X99, 0X66, 0X33, 0XCC, 0X66, 0X33,
0XFF, 0X66, 0X66, 0X00, 0X66, 0X66, 0X33, 0X66, 0X66, 0X66, 0X66, 0X66, 0X99, 0X66, 0X66, 0XCC,
0X66, 0X66, 0XFF, 0X66, 0X99, 0X00, 0X66, 0X99, 0X33, 0X66, 0X99, 0X66, 0X66, 0X99, 0X99, 0X66,
0X99, 0XCC, 0X66, 0X99, 0XFF, 0X66, 0XCC, 0X00, 0X66, 0XCC, 0X33, 0X66, 0XCC, 0X66, 0X66, 0XCC,
0X99, 0X66, 0XCC, 0XCC, 0X66, 0XCC, 0XFF, 0X66, 0XFF, 0X00, 0X66, 0XFF, 0X33, 0X66, 0XFF, 0X66,
0X66, 0XFF, 0X99, 0X66, 0XFF, 0XCC, 0X66, 0XFF, 0XFF, 0X99, 0X00, 0X00, 0X99, 0X00, 0X33, 0X99,
0X00, 0X66, 0X99, 0X00, 0X99, 0X99, 0X00, 0XCC, 0X99, 0X00, 0XFF, 0X99, 0X33, 0X00, 0X99, 0X33,
{
unsigned int my_port; //本机端口
unsigned int dest_port; //对方端口
unsigned int dest_ip[2]; //对方ip
unsigned int dest_node_id[3]; //对方的以太网地址
unsigned long irs; //初始化顺序号
unsigned long iss; //我的初始化序列号
unsigned long rcv_nxt; //对方的顺序号
unsigned long snd_nxt; //我的已经发送顺序号
unsigned long snd_una; //我的还没有确认顺序号
//unsigned long dest_ack_number;
unsigned int rcv_wnd; //对方的window大小
unsigned int snd_wnd; //我的window大小
unsigned int dest_max_segment_size; //对方接受的最大的数据包大小MTU
unsigned int my_max_segment_size; //我能接受的最大的数据包大小
unsigned long my_wl1; //seq
unsigned long my_wl2; //ack
unsigned char state; //连接状态
unsigned char open;
unsigned int rx_len; //length of received data in buffer
unsigned char rx_buf[1024]; //recieve data buffer
unsigned int tx_len; //length of data to send
unsigned char tx_buf[4096]; //send data buffer
};
#define LOGO_PIC_LEN 1312
#define LOGO_PIC_LEN_STR "1312\r\n"
static unsigned char code pic_logo[] = {
0X47, 0X49, 0X46, 0X38, 0X39, 0X61, 0X5F, 0X00, 0X3D, 0X00, 0XF7, 0X00, 0X00, 0X00, 0X00, 0X00,
0X80, 0X00, 0X00, 0X00, 0X80, 0X00, 0X80, 0X80, 0X00, 0X00, 0X00, 0X80, 0X80, 0X00, 0X80, 0X00,
0X80, 0X80, 0X80, 0X80, 0X80, 0XC0, 0XC0, 0XC0, 0XFF, 0X00, 0X00, 0X00, 0XFF, 0X00, 0XFF, 0XFF,
0X00, 0X00, 0X00, 0XFF, 0XFF, 0X00, 0XFF, 0X00, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X33, 0X00, 0X00, 0X66, 0X00, 0X00,
0X99, 0X00, 0X00, 0XCC, 0X00, 0X00, 0XFF, 0X00, 0X33, 0X00, 0X00, 0X33, 0X33, 0X00, 0X33, 0X66,
0X00, 0X33, 0X99, 0X00, 0X33, 0XCC, 0X00, 0X33, 0XFF, 0X00, 0X66, 0X00, 0X00, 0X66, 0X33, 0X00,
0X66, 0X66, 0X00, 0X66, 0X99, 0X00, 0X66, 0XCC, 0X00, 0X66, 0XFF, 0X00, 0X99, 0X00, 0X00, 0X99,
0X33, 0X00, 0X99, 0X66, 0X00, 0X99, 0X99, 0X00, 0X99, 0XCC, 0X00, 0X99, 0XFF, 0X00, 0XCC, 0X00,
0X00, 0XCC, 0X33, 0X00, 0XCC, 0X66, 0X00, 0XCC, 0X99, 0X00, 0XCC, 0XCC, 0X00, 0XCC, 0XFF, 0X00,
0XFF, 0X00, 0X00, 0XFF, 0X33, 0X00, 0XFF, 0X66, 0X00, 0XFF, 0X99, 0X00, 0XFF, 0XCC, 0X00, 0XFF,
0XFF, 0X33, 0X00, 0X00, 0X33, 0X00, 0X33, 0X33, 0X00, 0X66, 0X33, 0X00, 0X99, 0X33, 0X00, 0XCC,
0X33, 0X00, 0XFF, 0X33, 0X33, 0X00, 0X33, 0X33, 0X33, 0X33, 0X33, 0X66, 0X33, 0X33, 0X99, 0X33,
0X33, 0XCC, 0X33, 0X33, 0XFF, 0X33, 0X66, 0X00, 0X33, 0X66, 0X33, 0X33, 0X66, 0X66, 0X33, 0X66,
0X99, 0X33, 0X66, 0XCC, 0X33, 0X66, 0XFF, 0X33, 0X99, 0X00, 0X33, 0X99, 0X33, 0X33, 0X99, 0X66,
0X33, 0X99, 0X99, 0X33, 0X99, 0XCC, 0X33, 0X99, 0XFF, 0X33, 0XCC, 0X00, 0X33, 0XCC, 0X33, 0X33,
0XCC, 0X66, 0X33, 0XCC, 0X99, 0X33, 0XCC, 0XCC, 0X33, 0XCC, 0XFF, 0X33, 0XFF, 0X00, 0X33, 0XFF,
0X33, 0X33, 0XFF, 0X66, 0X33, 0XFF, 0X99, 0X33, 0XFF, 0XCC, 0X33, 0XFF, 0XFF, 0X66, 0X00, 0X00,
0X66, 0X00, 0X33, 0X66, 0X00, 0X66, 0X66, 0X00, 0X99, 0X66, 0X00, 0XCC, 0X66, 0X00, 0XFF, 0X66,
0X33, 0X00, 0X66, 0X33, 0X33, 0X66, 0X33, 0X66, 0X66, 0X33, 0X99, 0X66, 0X33, 0XCC, 0X66, 0X33,
0XFF, 0X66, 0X66, 0X00, 0X66, 0X66, 0X33, 0X66, 0X66, 0X66, 0X66, 0X66, 0X99, 0X66, 0X66, 0XCC,
0X66, 0X66, 0XFF, 0X66, 0X99, 0X00, 0X66, 0X99, 0X33, 0X66, 0X99, 0X66, 0X66, 0X99, 0X99, 0X66,
0X99, 0XCC, 0X66, 0X99, 0XFF, 0X66, 0XCC, 0X00, 0X66, 0XCC, 0X33, 0X66, 0XCC, 0X66, 0X66, 0XCC,
0X99, 0X66, 0XCC, 0XCC, 0X66, 0XCC, 0XFF, 0X66, 0XFF, 0X00, 0X66, 0XFF, 0X33, 0X66, 0XFF, 0X66,
0X66, 0XFF, 0X99, 0X66, 0XFF, 0XCC, 0X66, 0XFF, 0XFF, 0X99, 0X00, 0X00, 0X99, 0X00, 0X33, 0X99,
0X00, 0X66, 0X99, 0X00, 0X99, 0X99, 0X00, 0XCC, 0X99, 0X00, 0XFF, 0X99, 0X33, 0X00, 0X99, 0X33,
#6
0X33, 0X99, 0X33, 0X66, 0X99, 0X33, 0X99, 0X99, 0X33, 0XCC, 0X99, 0X33, 0XFF, 0X99, 0X66, 0X00,
0X99, 0X66, 0X33, 0X99, 0X66, 0X66, 0X99, 0X66, 0X99, 0X99, 0X66, 0XCC, 0X99, 0X66, 0XFF, 0X99,
0X99, 0X00, 0X99, 0X99, 0X33, 0X99, 0X99, 0X66, 0X99, 0X99, 0X99, 0X99, 0X99, 0XCC, 0X99, 0X99,
0XFF, 0X99, 0XCC, 0X00, 0X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 0XFD, 0X27, 0X90, 0X80, 0X5B,
0X61, 0X14, 0XE0, 0X7D, 0X03, 0X1E, 0XD8, 0X5F, 0X82, 0X0B, 0X12, 0XF8, 0XC0, 0X7F, 0X02, 0X12,
0X08, 0X61, 0X84, 0X08, 0X86, 0X44, 0XE1, 0X82, 0X0F, 0X2A, 0X08, 0X20, 0X86, 0X17, 0XFA, 0XA7,
0XE1, 0X86, 0X0C, 0X72, 0X58, 0X21, 0X48, 0X15, 0X4E, 0X88, 0X61, 0X86, 0X0D, 0X96, 0XF8, 0XE1,
0X7E, 0X2A, 0XA6, 0X68, 0XE2, 0X46, 0X42, 0X49, 0XB8, 0X22, 0X8A, 0X0C, 0X7A, 0XE8, 0X62, 0X42,
0X32, 0XBA, 0X38, 0X23, 0X5D, 0X31, 0X8E, 0X68, 0XE3, 0X8F, 0X34, 0X82, 0X58, 0X23, 0X8B, 0X27,
0X9A, 0XA8, 0X9F, 0X83, 0X5F, 0X59, 0X15, 0X24, 0X91, 0X40, 0XE6, 0X08, 0X64, 0X41, 0X4E, 0XA2,
0X78, 0XA4, 0X8F, 0XA8, 0X41, 0X37, 0X64, 0X7E, 0X43, 0X5E, 0XD9, 0X62, 0X7D, 0X5B, 0X0A, 0X39,
0XA5, 0X7D, 0XB5, 0X2D, 0XC6, 0X65, 0X93, 0X5D, 0X46, 0X39, 0X66, 0X96, 0X41, 0X7E, 0X49, 0X60,
0X72, 0X38, 0X96, 0XE9, 0X66, 0X91, 0X33, 0XBE, 0XE8, 0XA5, 0X82, 0X15, 0X5A, 0XA9, 0X50, 0X94,
0X78, 0XBE, 0X49, 0X26, 0X9C, 0X37, 0X4A, 0X79, 0X22, 0X89, 0X08, 0X76, 0XB8, 0XA4, 0XA0, 0X4B,
0XA6, 0XA9, 0X67, 0X88, 0X29, 0X19, 0X39, 0XA7, 0X88, 0X7D, 0X2E, 0XBA, 0XA7, 0X90, 0X52, 0XC2,
0XC4, 0X1F, 0X94, 0X58, 0X6E, 0X08, 0X26, 0X97, 0X48, 0X4E, 0X0A, 0X69, 0XA1, 0XEE, 0X75, 0XEA,
0X29, 0X6F, 0X9F, 0X8E, 0XB7, 0X5D, 0XA8, 0XE6, 0X55, 0X47, 0XAA, 0X53, 0X62, 0X9E, 0X5A, 0X2A,
0X9B, 0XAA, 0X82, 0XF4, 0X1C, 0X7C, 0XAD, 0X4A, 0X05, 0XA7, 0X64, 0X41, 0X01, 0X01, 0X00, 0X3B
};
static char http_hdr_status[] = "HTTP/1.1 200 OK\r\n";
static char http_hdr_conn_close[] = "Connection: close\r\n";
static char http_hdr_contt_html[] = "Content-Type: text/html\r\n\r\n";
static char http_hdr_contt_gif[] = "Content-Type: image/gif\r\n\r\n";
static char http_hdr_contt_bmp[] = "Content-Type: image/bmp\r\n\r\n";
static char http_hdr_cont_len[] = "Content-Length: ";
//发送图片
printf( http_hdr_cont_len);
printf( LOGO_PIC_LEN_STR);
// Connection: close
printf( http_hdr_conn_close);
// Content-Type: image/gif
printf( http_hdr_contt_gif);
// Image data
memcpy(http_sck->tx_buf + http_sck->tx_len, pic_logo, LOGO_PIC_LEN);
http_sck->tx_len += LOGO_PIC_LEN;
//这是我写单片机程序在浏览器中显示一个图片的程序,绝对正确,看楼主怎么运用了,给分吧,还差363分我就涨级啦
0X99, 0X66, 0X33, 0X99, 0X66, 0X66, 0X99, 0X66, 0X99, 0X99, 0X66, 0XCC, 0X99, 0X66, 0XFF, 0X99,
0X99, 0X00, 0X99, 0X99, 0X33, 0X99, 0X99, 0X66, 0X99, 0X99, 0X99, 0X99, 0X99, 0XCC, 0X99, 0X99,
0XFF, 0X99, 0XCC, 0X00, 0X99, 0XCC, 0X33, 0X99, 0XCC, 0X66, 0X99, 0XCC, 0X99, 0X99, 0XCC, 0XCC,
0X99, 0XCC, 0XFF, 0X99, 0XFF, 0X00, 0X99, 0XFF, 0X33, 0X99, 0XFF, 0X66, 0X99, 0XFF, 0X99, 0X99,
0XFF, 0XCC, 0X99, 0XFF, 0XFF, 0XCC, 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X4A, 0X05, 0XA7, 0X64, 0X41, 0X01, 0X01, 0X00, 0X3B
};
static char http_hdr_status[] = "HTTP/1.1 200 OK\r\n";
static char http_hdr_conn_close[] = "Connection: close\r\n";
static char http_hdr_contt_html[] = "Content-Type: text/html\r\n\r\n";
static char http_hdr_contt_gif[] = "Content-Type: image/gif\r\n\r\n";
static char http_hdr_contt_bmp[] = "Content-Type: image/bmp\r\n\r\n";
static char http_hdr_cont_len[] = "Content-Length: ";
//发送图片
printf( http_hdr_cont_len);
printf( LOGO_PIC_LEN_STR);
// Connection: close
printf( http_hdr_conn_close);
// Content-Type: image/gif
printf( http_hdr_contt_gif);
// Image data
memcpy(http_sck->tx_buf + http_sck->tx_len, pic_logo, LOGO_PIC_LEN);
http_sck->tx_len += LOGO_PIC_LEN;
//这是我写单片机程序在浏览器中显示一个图片的程序,绝对正确,看楼主怎么运用了,给分吧,还差363分我就涨级啦
#7
用VC做一个控件,然后插入网页,就可以了
#8
不是早告诉过你,让你去下载一个gd library看看,都有源代码的东西,cgi模式,你学习一下不就解决了你的问题,下载链接:
http://www.boutell.com/gd/
http://www.boutell.com/gd/
#9
是啊是啊,用现成的库最好了,我的就是从数据库里读出东西来形成图片不过是jsp的。
#10
to jennyvenus(JennyVenus)
我把你的程序改动了一下放在CGI里执行,没有什么反映,这么多的printf()怎么可能好用呢?你再好好看看我上面的程序,根据这个代码改造一下,我再看看,解决了我一定给你分的!
我把你的程序改动了一下放在CGI里执行,没有什么反映,这么多的printf()怎么可能好用呢?你再好好看看我上面的程序,根据这个代码改造一下,我再看看,解决了我一定给你分的!
#11
to 楼主,我的程序在没有文件系统环境下面执行的,如果有了文件系统从cgi里面发送图片还不是小问题?我把程序改动一下看看。
#12
你先把我的程序里面的加上
static char http_hdr_contt_jpeg[] = "Content-Type: image/jpeg\r\n\r\n";
因为你发送的是jpeg格式的图片。
static char http_hdr_contt_jpeg[] = "Content-Type: image/jpeg\r\n\r\n";
因为你发送的是jpeg格式的图片。
#13
to oldworm(oldworm) 我去那个地址看过了,但不知道如何使用gd libary,请指教!
#14
to 楼主,我的程序和你的差别很大,而且我的程序里面的web server是自己写的,而你的是系统的,所以我现在也没有搞定,原理确是很简单的,帮你up。
#1
{
// Start by writing the proper content type to the client
AddHeader(pCtxt, _T("Content-Type: image/jpeg\r\n"));
char szBuff[50];
int nSize = data.GetSize();
wsprintf(szBuff, "Content-length: %ld\r\n", nSize);
AddHeader(pCtxt, szBuff);
CBinaryHtmlStream* pStream = new CBinaryHtmlStream;
ISAPIVERIFY(pStream != NULL);
for (int nCount = 0; nCount<nSize; nCount++)
*pStream << data[nCount];
*pCtxt << *pStream;
delete pStream;
}
// Start by writing the proper content type to the client
AddHeader(pCtxt, _T("Content-Type: image/jpeg\r\n"));
char szBuff[50];
int nSize = data.GetSize();
wsprintf(szBuff, "Content-length: %ld\r\n", nSize);
AddHeader(pCtxt, szBuff);
CBinaryHtmlStream* pStream = new CBinaryHtmlStream;
ISAPIVERIFY(pStream != NULL);
for (int nCount = 0; nCount<nSize; nCount++)
*pStream << data[nCount];
*pCtxt << *pStream;
delete pStream;
}
#2
请教楼上的,这段代码是放在CGI中实现的么?还是在JAVASCRIPT 中定义的函数?
请详细说明。分数奉送!
请详细说明。分数奉送!
#3
楼上的楼上这个应该是ISAPI里的吧
#4
我下午答对了要100分。
#5
struct socket_type
{
unsigned int my_port; //本机端口
unsigned int dest_port; //对方端口
unsigned int dest_ip[2]; //对方ip
unsigned int dest_node_id[3]; //对方的以太网地址
unsigned long irs; //初始化顺序号
unsigned long iss; //我的初始化序列号
unsigned long rcv_nxt; //对方的顺序号
unsigned long snd_nxt; //我的已经发送顺序号
unsigned long snd_una; //我的还没有确认顺序号
//unsigned long dest_ack_number;
unsigned int rcv_wnd; //对方的window大小
unsigned int snd_wnd; //我的window大小
unsigned int dest_max_segment_size; //对方接受的最大的数据包大小MTU
unsigned int my_max_segment_size; //我能接受的最大的数据包大小
unsigned long my_wl1; //seq
unsigned long my_wl2; //ack
unsigned char state; //连接状态
unsigned char open;
unsigned int rx_len; //length of received data in buffer
unsigned char rx_buf[1024]; //recieve data buffer
unsigned int tx_len; //length of data to send
unsigned char tx_buf[4096]; //send data buffer
};
#define LOGO_PIC_LEN 1312
#define LOGO_PIC_LEN_STR "1312\r\n"
static unsigned char code pic_logo[] = {
0X47, 0X49, 0X46, 0X38, 0X39, 0X61, 0X5F, 0X00, 0X3D, 0X00, 0XF7, 0X00, 0X00, 0X00, 0X00, 0X00,
0X80, 0X00, 0X00, 0X00, 0X80, 0X00, 0X80, 0X80, 0X00, 0X00, 0X00, 0X80, 0X80, 0X00, 0X80, 0X00,
0X80, 0X80, 0X80, 0X80, 0X80, 0XC0, 0XC0, 0XC0, 0XFF, 0X00, 0X00, 0X00, 0XFF, 0X00, 0XFF, 0XFF,
0X00, 0X00, 0X00, 0XFF, 0XFF, 0X00, 0XFF, 0X00, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X33, 0X00, 0X00, 0X66, 0X00, 0X00,
0X99, 0X00, 0X00, 0XCC, 0X00, 0X00, 0XFF, 0X00, 0X33, 0X00, 0X00, 0X33, 0X33, 0X00, 0X33, 0X66,
0X00, 0X33, 0X99, 0X00, 0X33, 0XCC, 0X00, 0X33, 0XFF, 0X00, 0X66, 0X00, 0X00, 0X66, 0X33, 0X00,
0X66, 0X66, 0X00, 0X66, 0X99, 0X00, 0X66, 0XCC, 0X00, 0X66, 0XFF, 0X00, 0X99, 0X00, 0X00, 0X99,
0X33, 0X00, 0X99, 0X66, 0X00, 0X99, 0X99, 0X00, 0X99, 0XCC, 0X00, 0X99, 0XFF, 0X00, 0XCC, 0X00,
0X00, 0XCC, 0X33, 0X00, 0XCC, 0X66, 0X00, 0XCC, 0X99, 0X00, 0XCC, 0XCC, 0X00, 0XCC, 0XFF, 0X00,
0XFF, 0X00, 0X00, 0XFF, 0X33, 0X00, 0XFF, 0X66, 0X00, 0XFF, 0X99, 0X00, 0XFF, 0XCC, 0X00, 0XFF,
0XFF, 0X33, 0X00, 0X00, 0X33, 0X00, 0X33, 0X33, 0X00, 0X66, 0X33, 0X00, 0X99, 0X33, 0X00, 0XCC,
0X33, 0X00, 0XFF, 0X33, 0X33, 0X00, 0X33, 0X33, 0X33, 0X33, 0X33, 0X66, 0X33, 0X33, 0X99, 0X33,
0X33, 0XCC, 0X33, 0X33, 0XFF, 0X33, 0X66, 0X00, 0X33, 0X66, 0X33, 0X33, 0X66, 0X66, 0X33, 0X66,
0X99, 0X33, 0X66, 0XCC, 0X33, 0X66, 0XFF, 0X33, 0X99, 0X00, 0X33, 0X99, 0X33, 0X33, 0X99, 0X66,
0X33, 0X99, 0X99, 0X33, 0X99, 0XCC, 0X33, 0X99, 0XFF, 0X33, 0XCC, 0X00, 0X33, 0XCC, 0X33, 0X33,
0XCC, 0X66, 0X33, 0XCC, 0X99, 0X33, 0XCC, 0XCC, 0X33, 0XCC, 0XFF, 0X33, 0XFF, 0X00, 0X33, 0XFF,
0X33, 0X33, 0XFF, 0X66, 0X33, 0XFF, 0X99, 0X33, 0XFF, 0XCC, 0X33, 0XFF, 0XFF, 0X66, 0X00, 0X00,
0X66, 0X00, 0X33, 0X66, 0X00, 0X66, 0X66, 0X00, 0X99, 0X66, 0X00, 0XCC, 0X66, 0X00, 0XFF, 0X66,
0X33, 0X00, 0X66, 0X33, 0X33, 0X66, 0X33, 0X66, 0X66, 0X33, 0X99, 0X66, 0X33, 0XCC, 0X66, 0X33,
0XFF, 0X66, 0X66, 0X00, 0X66, 0X66, 0X33, 0X66, 0X66, 0X66, 0X66, 0X66, 0X99, 0X66, 0X66, 0XCC,
0X66, 0X66, 0XFF, 0X66, 0X99, 0X00, 0X66, 0X99, 0X33, 0X66, 0X99, 0X66, 0X66, 0X99, 0X99, 0X66,
0X99, 0XCC, 0X66, 0X99, 0XFF, 0X66, 0XCC, 0X00, 0X66, 0XCC, 0X33, 0X66, 0XCC, 0X66, 0X66, 0XCC,
0X99, 0X66, 0XCC, 0XCC, 0X66, 0XCC, 0XFF, 0X66, 0XFF, 0X00, 0X66, 0XFF, 0X33, 0X66, 0XFF, 0X66,
0X66, 0XFF, 0X99, 0X66, 0XFF, 0XCC, 0X66, 0XFF, 0XFF, 0X99, 0X00, 0X00, 0X99, 0X00, 0X33, 0X99,
0X00, 0X66, 0X99, 0X00, 0X99, 0X99, 0X00, 0XCC, 0X99, 0X00, 0XFF, 0X99, 0X33, 0X00, 0X99, 0X33,
{
unsigned int my_port; //本机端口
unsigned int dest_port; //对方端口
unsigned int dest_ip[2]; //对方ip
unsigned int dest_node_id[3]; //对方的以太网地址
unsigned long irs; //初始化顺序号
unsigned long iss; //我的初始化序列号
unsigned long rcv_nxt; //对方的顺序号
unsigned long snd_nxt; //我的已经发送顺序号
unsigned long snd_una; //我的还没有确认顺序号
//unsigned long dest_ack_number;
unsigned int rcv_wnd; //对方的window大小
unsigned int snd_wnd; //我的window大小
unsigned int dest_max_segment_size; //对方接受的最大的数据包大小MTU
unsigned int my_max_segment_size; //我能接受的最大的数据包大小
unsigned long my_wl1; //seq
unsigned long my_wl2; //ack
unsigned char state; //连接状态
unsigned char open;
unsigned int rx_len; //length of received data in buffer
unsigned char rx_buf[1024]; //recieve data buffer
unsigned int tx_len; //length of data to send
unsigned char tx_buf[4096]; //send data buffer
};
#define LOGO_PIC_LEN 1312
#define LOGO_PIC_LEN_STR "1312\r\n"
static unsigned char code pic_logo[] = {
0X47, 0X49, 0X46, 0X38, 0X39, 0X61, 0X5F, 0X00, 0X3D, 0X00, 0XF7, 0X00, 0X00, 0X00, 0X00, 0X00,
0X80, 0X00, 0X00, 0X00, 0X80, 0X00, 0X80, 0X80, 0X00, 0X00, 0X00, 0X80, 0X80, 0X00, 0X80, 0X00,
0X80, 0X80, 0X80, 0X80, 0X80, 0XC0, 0XC0, 0XC0, 0XFF, 0X00, 0X00, 0X00, 0XFF, 0X00, 0XFF, 0XFF,
0X00, 0X00, 0X00, 0XFF, 0XFF, 0X00, 0XFF, 0X00, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X33, 0X00, 0X00, 0X66, 0X00, 0X00,
0X99, 0X00, 0X00, 0XCC, 0X00, 0X00, 0XFF, 0X00, 0X33, 0X00, 0X00, 0X33, 0X33, 0X00, 0X33, 0X66,
0X00, 0X33, 0X99, 0X00, 0X33, 0XCC, 0X00, 0X33, 0XFF, 0X00, 0X66, 0X00, 0X00, 0X66, 0X33, 0X00,
0X66, 0X66, 0X00, 0X66, 0X99, 0X00, 0X66, 0XCC, 0X00, 0X66, 0XFF, 0X00, 0X99, 0X00, 0X00, 0X99,
0X33, 0X00, 0X99, 0X66, 0X00, 0X99, 0X99, 0X00, 0X99, 0XCC, 0X00, 0X99, 0XFF, 0X00, 0XCC, 0X00,
0X00, 0XCC, 0X33, 0X00, 0XCC, 0X66, 0X00, 0XCC, 0X99, 0X00, 0XCC, 0XCC, 0X00, 0XCC, 0XFF, 0X00,
0XFF, 0X00, 0X00, 0XFF, 0X33, 0X00, 0XFF, 0X66, 0X00, 0XFF, 0X99, 0X00, 0XFF, 0XCC, 0X00, 0XFF,
0XFF, 0X33, 0X00, 0X00, 0X33, 0X00, 0X33, 0X33, 0X00, 0X66, 0X33, 0X00, 0X99, 0X33, 0X00, 0XCC,
0X33, 0X00, 0XFF, 0X33, 0X33, 0X00, 0X33, 0X33, 0X33, 0X33, 0X33, 0X66, 0X33, 0X33, 0X99, 0X33,
0X33, 0XCC, 0X33, 0X33, 0XFF, 0X33, 0X66, 0X00, 0X33, 0X66, 0X33, 0X33, 0X66, 0X66, 0X33, 0X66,
0X99, 0X33, 0X66, 0XCC, 0X33, 0X66, 0XFF, 0X33, 0X99, 0X00, 0X33, 0X99, 0X33, 0X33, 0X99, 0X66,
0X33, 0X99, 0X99, 0X33, 0X99, 0XCC, 0X33, 0X99, 0XFF, 0X33, 0XCC, 0X00, 0X33, 0XCC, 0X33, 0X33,
0XCC, 0X66, 0X33, 0XCC, 0X99, 0X33, 0XCC, 0XCC, 0X33, 0XCC, 0XFF, 0X33, 0XFF, 0X00, 0X33, 0XFF,
0X33, 0X33, 0XFF, 0X66, 0X33, 0XFF, 0X99, 0X33, 0XFF, 0XCC, 0X33, 0XFF, 0XFF, 0X66, 0X00, 0X00,
0X66, 0X00, 0X33, 0X66, 0X00, 0X66, 0X66, 0X00, 0X99, 0X66, 0X00, 0XCC, 0X66, 0X00, 0XFF, 0X66,
0X33, 0X00, 0X66, 0X33, 0X33, 0X66, 0X33, 0X66, 0X66, 0X33, 0X99, 0X66, 0X33, 0XCC, 0X66, 0X33,
0XFF, 0X66, 0X66, 0X00, 0X66, 0X66, 0X33, 0X66, 0X66, 0X66, 0X66, 0X66, 0X99, 0X66, 0X66, 0XCC,
0X66, 0X66, 0XFF, 0X66, 0X99, 0X00, 0X66, 0X99, 0X33, 0X66, 0X99, 0X66, 0X66, 0X99, 0X99, 0X66,
0X99, 0XCC, 0X66, 0X99, 0XFF, 0X66, 0XCC, 0X00, 0X66, 0XCC, 0X33, 0X66, 0XCC, 0X66, 0X66, 0XCC,
0X99, 0X66, 0XCC, 0XCC, 0X66, 0XCC, 0XFF, 0X66, 0XFF, 0X00, 0X66, 0XFF, 0X33, 0X66, 0XFF, 0X66,
0X66, 0XFF, 0X99, 0X66, 0XFF, 0XCC, 0X66, 0XFF, 0XFF, 0X99, 0X00, 0X00, 0X99, 0X00, 0X33, 0X99,
0X00, 0X66, 0X99, 0X00, 0X99, 0X99, 0X00, 0XCC, 0X99, 0X00, 0XFF, 0X99, 0X33, 0X00, 0X99, 0X33,
#6
0X33, 0X99, 0X33, 0X66, 0X99, 0X33, 0X99, 0X99, 0X33, 0XCC, 0X99, 0X33, 0XFF, 0X99, 0X66, 0X00,
0X99, 0X66, 0X33, 0X99, 0X66, 0X66, 0X99, 0X66, 0X99, 0X99, 0X66, 0XCC, 0X99, 0X66, 0XFF, 0X99,
0X99, 0X00, 0X99, 0X99, 0X33, 0X99, 0X99, 0X66, 0X99, 0X99, 0X99, 0X99, 0X99, 0XCC, 0X99, 0X99,
0XFF, 0X99, 0XCC, 0X00, 0X99, 0XCC, 0X33, 0X99, 0XCC, 0X66, 0X99, 0XCC, 0X99, 0X99, 0XCC, 0XCC,
0X99, 0XCC, 0XFF, 0X99, 0XFF, 0X00, 0X99, 0XFF, 0X33, 0X99, 0XFF, 0X66, 0X99, 0XFF, 0X99, 0X99,
0XFF, 0XCC, 0X99, 0XFF, 0XFF, 0XCC, 0X00, 0X00, 0XCC, 0X00, 0X33, 0XCC, 0X00, 0X66, 0XCC,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
static char http_hdr_status[] = "HTTP/1.1 200 OK\r\n";
static char http_hdr_conn_close[] = "Connection: close\r\n";
static char http_hdr_contt_html[] = "Content-Type: text/html\r\n\r\n";
static char http_hdr_contt_gif[] = "Content-Type: image/gif\r\n\r\n";
static char http_hdr_contt_bmp[] = "Content-Type: image/bmp\r\n\r\n";
static char http_hdr_cont_len[] = "Content-Length: ";
//发送图片
printf( http_hdr_cont_len);
printf( LOGO_PIC_LEN_STR);
// Connection: close
printf( http_hdr_conn_close);
// Content-Type: image/gif
printf( http_hdr_contt_gif);
// Image data
memcpy(http_sck->tx_buf + http_sck->tx_len, pic_logo, LOGO_PIC_LEN);
http_sck->tx_len += LOGO_PIC_LEN;
//这是我写单片机程序在浏览器中显示一个图片的程序,绝对正确,看楼主怎么运用了,给分吧,还差363分我就涨级啦
0X99, 0X66, 0X33, 0X99, 0X66, 0X66, 0X99, 0X66, 0X99, 0X99, 0X66, 0XCC, 0X99, 0X66, 0XFF, 0X99,
0X99, 0X00, 0X99, 0X99, 0X33, 0X99, 0X99, 0X66, 0X99, 0X99, 0X99, 0X99, 0X99, 0XCC, 0X99, 0X99,
0XFF, 0X99, 0XCC, 0X00, 0X99, 0XCC, 0X33, 0X99, 0XCC, 0X66, 0X99, 0XCC, 0X99, 0X99, 0XCC, 0XCC,
0X99, 0XCC, 0XFF, 0X99, 0XFF, 0X00, 0X99, 0XFF, 0X33, 0X99, 0XFF, 0X66, 0X99, 0XFF, 0X99, 0X99,
0XFF, 0XCC, 0X99, 0XFF, 0XFF, 0XCC, 0X00, 0X00, 0XCC, 0X00, 0X33, 0XCC, 0X00, 0X66, 0XCC, 0X00,
0X99, 0XCC, 0X00, 0XCC, 0XCC, 0X00, 0XFF, 0XCC, 0X33, 0X00, 0XCC, 0X33, 0X33, 0XCC, 0X33, 0X66,
0XCC, 0X33, 0X99, 0XCC, 0X33, 0XCC, 0XCC, 0X33, 0XFF, 0XCC, 0X66, 0X00, 0XCC, 0X66, 0X33, 0XCC,
0X66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0X68, 0XE3, 0X8F, 0X34, 0X82, 0X58, 0X23, 0X8B, 0X27,
0X9A, 0XA8, 0X9F, 0X83, 0X5F, 0X59, 0X15, 0X24, 0X91, 0X40, 0XE6, 0X08, 0X64, 0X41, 0X4E, 0XA2,
0X78, 0XA4, 0X8F, 0XA8, 0X41, 0X37, 0X64, 0X7E, 0X43, 0X5E, 0XD9, 0X62, 0X7D, 0X5B, 0X0A, 0X39,
0XA5, 0X7D, 0XB5, 0X2D, 0XC6, 0X65, 0X93, 0X5D, 0X46, 0X39, 0X66, 0X96, 0X41, 0X7E, 0X49, 0X60,
0X72, 0X38, 0X96, 0XE9, 0X66, 0X91, 0X33, 0XBE, 0XE8, 0XA5, 0X82, 0X15, 0X5A, 0XA9, 0X50, 0X94,
0X78, 0XBE, 0X49, 0X26, 0X9C, 0X37, 0X4A, 0X79, 0X22, 0X89, 0X08, 0X76, 0XB8, 0XA4, 0XA0, 0X4B,
0XA6, 0XA9, 0X67, 0X88, 0X29, 0X19, 0X39, 0XA7, 0X88, 0X7D, 0X2E, 0XBA, 0XA7, 0X90, 0X52, 0XC2,
0XC4, 0X1F, 0X94, 0X58, 0X6E, 0X08, 0X26, 0X97, 0X48, 0X4E, 0X0A, 0X69, 0XA1, 0XEE, 0X75, 0XEA,
0X29, 0X6F, 0X9F, 0X8E, 0XB7, 0X5D, 0XA8, 0XE6, 0X55, 0X47, 0XAA, 0X53, 0X62, 0X9E, 0X5A, 0X2A,
0X9B, 0XAA, 0X82, 0XF4, 0X1C, 0X7C, 0XAD, 0X4A, 0X05, 0XA7, 0X64, 0X41, 0X01, 0X01, 0X00, 0X3B
};
static char http_hdr_status[] = "HTTP/1.1 200 OK\r\n";
static char http_hdr_conn_close[] = "Connection: close\r\n";
static char http_hdr_contt_html[] = "Content-Type: text/html\r\n\r\n";
static char http_hdr_contt_gif[] = "Content-Type: image/gif\r\n\r\n";
static char http_hdr_contt_bmp[] = "Content-Type: image/bmp\r\n\r\n";
static char http_hdr_cont_len[] = "Content-Length: ";
//发送图片
printf( http_hdr_cont_len);
printf( LOGO_PIC_LEN_STR);
// Connection: close
printf( http_hdr_conn_close);
// Content-Type: image/gif
printf( http_hdr_contt_gif);
// Image data
memcpy(http_sck->tx_buf + http_sck->tx_len, pic_logo, LOGO_PIC_LEN);
http_sck->tx_len += LOGO_PIC_LEN;
//这是我写单片机程序在浏览器中显示一个图片的程序,绝对正确,看楼主怎么运用了,给分吧,还差363分我就涨级啦
#7
用VC做一个控件,然后插入网页,就可以了
#8
不是早告诉过你,让你去下载一个gd library看看,都有源代码的东西,cgi模式,你学习一下不就解决了你的问题,下载链接:
http://www.boutell.com/gd/
http://www.boutell.com/gd/
#9
是啊是啊,用现成的库最好了,我的就是从数据库里读出东西来形成图片不过是jsp的。
#10
to jennyvenus(JennyVenus)
我把你的程序改动了一下放在CGI里执行,没有什么反映,这么多的printf()怎么可能好用呢?你再好好看看我上面的程序,根据这个代码改造一下,我再看看,解决了我一定给你分的!
我把你的程序改动了一下放在CGI里执行,没有什么反映,这么多的printf()怎么可能好用呢?你再好好看看我上面的程序,根据这个代码改造一下,我再看看,解决了我一定给你分的!
#11
to 楼主,我的程序在没有文件系统环境下面执行的,如果有了文件系统从cgi里面发送图片还不是小问题?我把程序改动一下看看。
#12
你先把我的程序里面的加上
static char http_hdr_contt_jpeg[] = "Content-Type: image/jpeg\r\n\r\n";
因为你发送的是jpeg格式的图片。
static char http_hdr_contt_jpeg[] = "Content-Type: image/jpeg\r\n\r\n";
因为你发送的是jpeg格式的图片。
#13
to oldworm(oldworm) 我去那个地址看过了,但不知道如何使用gd libary,请指教!
#14
to 楼主,我的程序和你的差别很大,而且我的程序里面的web server是自己写的,而你的是系统的,所以我现在也没有搞定,原理确是很简单的,帮你up。