資源簡(jiǎn)介
VC++數(shù)字圖像處理用到的Cdib類(lèi) 希望對(duì)你有用。
代碼片段和文件信息
#include?“stdafx.h“
#include?“Dib.h“
#include?“windowsx.h“
#ifdef?_DEBUG
#undef?THIS_FILE
static?char?THIS_FILE[]=__FILE__;
#define?new?DEBUG_NEW
#endif
//?這里必須放在首行
IMPLEMENT_DYNAMIC(CDib?Cobject)
/////////////////???常用函數(shù)???/////////////////
//?交換兩數(shù)據(jù)。對(duì)于指針,交換指針變量
template
void?Swap(T?&p1T?&p2){
T?tmp;
tmp?=?p1;
p1 =?p2;
p2 =?tmp;
}
void?NormalizeRect(LPRECT?lpRc){
if(!lpRc)?return;
if(lpRc->left?>?lpRc->right)?Swap(lpRc->leftlpRc->right);
if(lpRc->top?>?lpRc->bottom)?Swap(lpRc->toplpRc->bottom);
}
//?判斷前矩形是否在后矩形內(nèi)
BOOL?RectInRect(LPRECT?lpRcSmallLPRECT?lpRcLarge){
if(?!lpRcSmall?||?!lpRcLarge?)?
return?FALSE;
if(lpRcSmall->left?left
||lpRcSmall->right?>?lpRcLarge->right
||lpRcSmall->top?top
||lpRcSmall->bottom?>?lpRcLarge->bottom)
{
return?FALSE;
}
else
{
return?TRUE;
}
}
/*************************************************
功能:將兩基本類(lèi)型變量按位進(jìn)行?dwRop?操作,包括:與、或、非、異或。
結(jié)果
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件??????24670??2004-08-26?16:21??cdib類(lèi)\cdib類(lèi)\Dib.cpp
?????文件???????4457??2004-08-26?16:25??cdib類(lèi)\cdib類(lèi)\Dib.h
?????目錄??????????0??2007-06-11?14:13??cdib類(lèi)\cdib類(lèi)
?????目錄??????????0??2010-04-27?19:06??cdib類(lèi)
-----------?---------??----------?-----??----
????????????????29127????????????????????4
評(píng)論
共有 條評(píng)論