#include <opencv2/highgui/highgui.hpp>
#include <cv.h>
#include <iostream>
using namespace cv;
using namespace std;
int g_slider_position = 0;
CvCapture *g_cap = nullptr;
void onTrackbarslide(int pos)
{
cvSetCaptureProperty(g_cap,CV_CAP_PROP_POS_FRAMES,pos);
}
void main()
{
cvNamedWindow("example3",CV_WINDOW_AUTOSIZE);
g_cap = cvCreateFileCapture("D:\1.wmv");
int frames = static_cast<int>(cvGetCaptureProperty(g_cap,CV_CAP_PROP_FRAME_COUNT));
if (frames != 0)
{
cvCreateTrackbar("position","example3",&g_slider_position,frames,onTrackbarslide);
}
IplImage *frame;
while(1)
{
frame = cvQueryFrame(g_cap);
if(!frame)
break;
cvShowImage("example3",frame);
char c = waitKey(33);
if (c == 27)
{
break;
}
}
cvReleaseCapture(&g_cap);
cvDestroyWindow("example3");
system("pause");
}#include <opencv2/highgui/highgui.hpp>
#include