#include <cv.h>
#include <cvcam.h>
#include <cxcore.h>
#include <highgui.h>
#pragma comment(lib,"cv.lib")
#pragma comment(lib,"cvcam.lib")
#pragma comment(lib,"cxcore.lib")
#pragma comment(lib,"highgui.lib")
void main()
{
IplImage *src_image=cvLoadImage("1.jpg");
assert(src_image!=NULL);
IplImage *dst_image=cvCreateImage(cvSize(src_image->width+100,src_image->height+100),src_image->depth,src_image->nChannels);
assert(dst_image!=NULL);
//执行拷贝边界操作
cvCopyMakeBorder(src_image,dst_image,cvPoint(1,1),IPL_BORDER_REPLICATE);
//创建窗口
cvNamedWindow("Show_Src");
cvNamedWindow("Show_Dst");
//显示图像
cvShowImage("Show_Src",src_image);
cvShowImage("Show_Dst",dst_image);
cvWaitKey();
//释放资源
cvReleaseImage(&src_image);
cvReleaseImage(&dst_image);
cvDestroyWindow("Show_Src");
cvDestroyWindow("Show_Dst");
}