#include\x0d\x0a#include\x0d\x0a#include\x0d\x0aintmain()\x0d\x0a{\x0d\x0aCvCapture*capture=cvCreateCameraCapture(0)\x0d\x0acvNamedWindow("camera",CV_WINDOW_AUTOSIZE)\x0d\x0aIplImage*image\x0d\x0acharfile_name[15]\x0d\x0ainti\x0d\x0awhile(1)\x0d\x0a{\x0d\x0afor(i=0i<99999i++)\x0d\x0a{\x0d\x0aimage=cvQueryFrame(capture)\x0d\x0aif(!image)\x0d\x0abreak\x0d\x0acvShowImage("camera",image)\x0d\x0acharc=cvWaitKey(20)\x0d\x0aif(c==27)\x0d\x0a{\x0d\x0acvReleaseCapture(&capture)\x0d\x0acvDestroyWindow("hh")\x0d\x0aexit(0)\x0d\x0a}//按esc退出\x0d\x0a\x0d\x0asprintf(file_name,"d:\\%05d.jpg",i)//d盘根高扰目录下生成\x0d\x0acvSaveImage(file_name,image)\x0d\x0a\x0d\x0a}\x0d\x0aMessage(NULL,"
文件名超出范戚伏旦围!","警告!",MB_OK)\x0d\x0a\x0d\厅神x0a}\x0d\x0a\x0d\x0a}\x0d\x0a供参考。#include <conio.h> //声明 getch 函数
#include<stdio.h>
int main(){
char c=0
printf("请按ESC,慧毁退出前察备程序。\n")
while(c!=(27)) //ESC 退出
{
c=getch()
}
printf("恭喜你,成没兆功退出程序。\n")
}
评论列表(0条)