我还是把C源文件贴出来吧,那位有时间试试
#include <condefs.h>
#pragma hdrstop
//---------------------------------------------------------------------------
#pragma argsused
#include <windows.h>
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
#include <jpeg.hpp>
int printImage(char *FileName)
{
TJPEGImage *Jpg = new TJPEGImage();
TMemoryStream *S = new TMemoryStream();
try
{
Jpg->LoadFromFile(FileName);
try
{
Jpg->SaveToStream(S);
S->Position = 0;
fwrite(S->Memory,S->Size,1,stdout);
}
__finally
{
&S->Free;
}
}
__finally
{
&Jpg->Free;
}
fflush(stdout);
return 1;
}
void main()
{
TJPEGImage *Jpg = new TJPEGImage();
TMemoryStream *S = new TMemoryStream();
char *filenames[]={
"d://share//kangxi//images//gxinbar-1on.JPG",
"d://share//kangxi//images//gxinbar-2on.JPG",
"d://share//kangxi//images//gxinbar-3on.JPG",
"d://share//kangxi//images//gxinbar-4on.JPG",
"d://share//kangxi//images//gxinbar-5on.JPG"
};
setvbuf(stdout,NULL,_IONBF,0);
printf("Content-type: multipart/x-mixed-replace;boundary=BoundaryString/n/n");
printf("--BoundaryString/nContent-type:image/jpeg/n/n");
if(printImage(filenames[0])==-1)
return;
printf("/n");
for(int x=1;x<5;x++)
{
printf("/n--BoundaryString/nContent-type:image/jpeg/n/n");
fflush(stdout);
Sleep(4500);
if(printImage(filenames[x])==-1)
return;
printf("/n");
fflush(stdout);
}
Sleep(4500);
printf("/n--BoundaryString--/n/n");
}