本文整理汇总了C++中CDib::Create方法的典型用法代码示例。如果您正苦于以下问题:C++ CDib::Create方法的具体用法?C++ CDib::Create怎么用?C++ CDib::Create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDib
的用法示例。
在下文中一共展示了CDib::Create方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MergeDib
/*
*--------------------------------------------------------------------------------
* 函数名 : MergeDib
* 功能 : 将窗口内的图像与指定图像融合
* 参数 : CDib* pDib - 画布图像,融合于此DIB之上
* 算法 : 先隐藏按钮,然后将窗口内的图像抓取下来,再将此DIB与参数DIB融合
*--------------------------------------------------------------------------------
*/
BOOL CFloatDibWnd::MergeDib(CDib * pDib)
{
CDib* newDib = new CDib();
// 隐藏全部形变按钮
if(g_createBtn)
HideAllButton();
CRect rcSelf, rcParent;
GetWindowRect(&rcSelf);
::GetWindowRect(m_hParentWnd, &rcParent);
// 抓取浮动窗口客户区图像
newDib->Create(GetSafeHwnd(), CRect(0, 0, rcSelf.Width(), rcSelf.Height()) );
// 计算起点座标
int xStart, yStart;
// 减 2 是因为边框占两个像素
xStart = rcSelf.left - rcParent.left - 2;
yStart = rcSelf.top - rcParent.top - 2;
pDib->MergeDib(newDib->GetHandle(), CPoint(xStart, yStart));
delete newDib;
return TRUE;
}
示例2: OnAcquire
//.........这里部分代码省略.........
// The acquireSelectorStart function informs the host of the image type,
// mode, and resolution. Plugin dialogs are displayed during this call.
try
{
(*lpEntryPoint)( (short)acquireSelectorStart, (AcquireRecordPtr FAR)&Record, (long* FAR)lpData, (short* FAR)&sErrCode );
}
catch(...)
{
sErrCode = true;
}
if ( sErrCode )
{
m_bAborted = true;
}
bool bRGBColor;
bRGBColor = (Record.depth == 8 && Record.planes == 3);
if ( !bRGBColor || Record.imageMode != plugInModeRGBColor )
{
m_bAborted = true;
}
// Only support chunky data
if ( Record.planeBytes != 1 || Record.colBytes != Record.planes )
{
m_bAborted = true;
}
// Create a DIB to catch the image data
CDib* pDib;
if (pDib = new CDib())
{
pDib->Create(8 * Record.planes, Record.imageSize.h, Record.imageSize.v);
}
else
{
m_bAborted = true;
}
// Create a progress dialog
if (CPluginTestDlg::pProgressDlg = new CProgressDlg)
{
CPluginTestDlg::pProgressDlg->Create(this);
CPluginTestDlg::pProgressDlg->SetStatus((const char*)Record.filename);
CPluginTestDlg::pProgressDlg->SetStep(1);
}
// start the processing of the data
while ( !bDone && !m_bAborted )
{
// The acquireSelectorContinue function returns an area of the image to the host.
try
{
(*lpEntryPoint)( (short)acquireSelectorContinue, (AcquireRecordPtr FAR)&Record, (long* FAR)lpData, (short* FAR)&sErrCode );
}
catch(...)
{
sErrCode = true;
}
if ( sErrCode )
{
m_bAborted = true;
break;
}