啊哈~
原來帳號密碼是要打自己BLOG的帳密啦
1. Add Image Files:把圖檔匯進來
2. Sort List:照順序排好
3. 設定Border size Width和Border size Height,我都設0
4. 設定要不要Maintain Aspect Ratio和Zoom In(expand smaller pics),我都設不要
5. DVD NSTSC 720*480換成coustom
6. 點Compile Images
7. 設定壓縮格式,我是選DivX 6.9.2 Codec (8 Logical C… (要先灌DivX才能選到)
8. 按確定
就完成了
使用libjpeg library
1. 先把libkpeg.dsw(在我的信箱裡)點開compile
2. 連結libjpeg.lib檔
3. 也要把pic.h, pic.c納進來
4. #include "pic.h"
5. 把以下程式碼放程式中,每個frame都要呼叫到一次
//filename:預存出之檔名 ex “a.jpg”
//nFrameNum:現在輸出的是第幾個frame
//w, h:輸出圖片的寬和高
void save (char *filename, int nFrameNum, int w, int h)
{
int i;
int j;
static char anim_filename[512];
static Pic *in = NULL;
sprintf(anim_filename, "%s_%03d.jpg", filename, nFrameNum); //設定anim_filename
if (filename == NULL) return;
//Allocate a picture buffer.
if(in == NULL) in = pic_alloc(w,h,3,NULL);
printf("File to save to: %s\n", anim_filename);
for (i=h-1; i>=0; i—)
{
glReadPixels(0,h-1-i,w,1,GL_RGB, GL_UNSIGNED_BYTE, &in->pix[i*in->nx*in->bpp]);
}
if ( jpeg_write(anim_filename, in) ) //匯出去成jpg檔
printf("%s saved Successfully\n", anim_filename);
else
printf("Error in Saving\n");
}