本文整理汇总了C++中CImage::CopyOf方法的典型用法代码示例。如果您正苦于以下问题:C++ CImage::CopyOf方法的具体用法?C++ CImage::CopyOf怎么用?C++ CImage::CopyOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CImage
的用法示例。
在下文中一共展示了CImage::CopyOf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowOnDc
/////////////////////////////////////////////////////////////////////////////
// CResizeView message handlers
void CResizeView::ShowOnDc(const IplImage*img,int idx /* = 0 */,int idy /* =0 */,const char * title /* = */ )
{
CClientDC dc(this);
OnPrepareDC(&dc);
CImage image;
//image.Load(path);
image.CopyOf((IplImage *)img);
//HDC hdc = ::GetDC(this->m_hWnd);
//image.Draw(hdc, 300, 200);
RECT * tmpRect = new RECT();
tmpRect->right = image.Width() + idx;
tmpRect->left = 0 + idx;
tmpRect->top = 0 + idy;
tmpRect->bottom = image.Height() + idy;
image.DrawToHDC(dc,tmpRect);
dc.TextOut(idx,image.Height() + idy,title);
//UpdateData(FALSE);
OnDraw(&dc);
}
示例2: testcallback
// Callback function ----------------------------------------------------------
void testcallback(IplImage* img)
{
assert (img);
lastframe.Destroy();
lastframe.Create(img->width,img->height,24,img->origin);
lastframe.CopyOf(img);
if (view.m_track) {
if (!view.m_trackinit) {
view.StartTracking(lastframe);
view.m_trackinit = true;
}
view.TrackFeatures(lastframe);
//double kx = (double)view.m_w/img->width;
//double ky = (double)view.m_h/img->height;
if( !view.m_night_mode )
{
}
else
{
//iplSet( img, 0 );
CvPoint tl = {0,0};
CvPoint br = {img->width,img->height};
//cvRectangle(img, tl, br, 0, (img->width > img->height) ? img->width : img->height);
//cvRectangle(img, tl, br, 0, 255);
memset(img->imageData,0,img->imageSize);
}
int i, count = view.m_tracker.GetCount();
const PointArray& array = view.m_tracker.GetPoints();
cvCircle( img, P, cvRound(3), CV_RGB(0,0,255));
for( i = 0; i < count; i++ )
{
CvPoint pt;
int color;
if( i != view.m_moved_idx )
{
pt = cvPoint( cvRound(array[i].x), cvRound(array[i].y));
color = CV_RGB(0,255,0);
}
else
{
pt = cvPoint( cvRound(view.m_moved_point.x),
cvRound(view.m_moved_point.y));
color = CV_RGB(255,0,0);
}
cvCircle( img, pt, 1, color, CV_FILLED );
}
}
else
{
if (view.m_trackinit)
{
view.StopTracking();
view.m_trackinit = false;
}
}
#ifdef WIN32
Sleep(10);
#endif
}