当前位置: 首页>>代码示例>>C++>>正文


C++ CDC::Draw3dRect方法代码示例

本文整理汇总了C++中CDC::Draw3dRect方法的典型用法代码示例。如果您正苦于以下问题:C++ CDC::Draw3dRect方法的具体用法?C++ CDC::Draw3dRect怎么用?C++ CDC::Draw3dRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CDC的用法示例。


在下文中一共展示了CDC::Draw3dRect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PaintSeparator

void MenuEditorItem::PaintSeparator(CDC& dc, CRect& rect)
{
	// Draw separator

	CRect sep = rect;
	sep.bottom = sep.top + 2;
	dc.FillSolidRect(sep, 0xffffff);
	dc.Draw3dRect(sep,GetSysColor(COLOR_BTNFACE), GetSysColor(COLOR_BTNFACE));
	rect.OffsetRect(0, sep.Height()+1);
}
开发者ID:aolko,项目名称:construct,代码行数:10,代码来源:Menu+Editor+Dlg.cpp

示例2: OnNcPaint

void CSizingControlBar::OnNcPaint()
{
    // get window DC that is clipped to the non-client area
    CWindowDC dc(this);

    CRect rcClient, rcBar;
    GetClientRect(rcClient);
    ClientToScreen(rcClient);
    GetWindowRect(rcBar);
    rcClient.OffsetRect(-rcBar.TopLeft());
    rcBar.OffsetRect(-rcBar.TopLeft());

    CDC mdc;
    mdc.CreateCompatibleDC(&dc);
    
    CBitmap bm;
    bm.CreateCompatibleBitmap(&dc, rcBar.Width(), rcBar.Height());
    CBitmap* pOldBm = mdc.SelectObject(&bm);

    // draw borders in non-client area
    CRect rcDraw = rcBar;
    DrawBorders(&mdc, rcDraw);

    // erase the NC background
#ifdef _WIN64
    mdc.FillRect(rcDraw, CBrush::FromHandle(
        (HBRUSH) GetClassLong(m_hWnd, GCLP_HBRBACKGROUND)));
#else
    mdc.FillRect(rcDraw, CBrush::FromHandle(
        (HBRUSH) GetClassLong(m_hWnd, GCL_HBRBACKGROUND)));
#endif

    if (m_dwSCBStyle & SCBS_SHOWEDGES)
    {
        CRect rcEdge; // paint the sizing edges
        for (int i = 0; i < 4; i++)
            if (GetEdgeRect(rcBar, GetEdgeHTCode(i), rcEdge))
                mdc.Draw3dRect(rcEdge, ::GetSysColor(COLOR_BTNHIGHLIGHT),
                    ::GetSysColor(COLOR_BTNSHADOW));
    }

    NcPaintGripper(&mdc, rcClient);

    // client area is not our bussiness :)
    dc.IntersectClipRect(rcBar);
    dc.ExcludeClipRect(rcClient);

    dc.BitBlt(0, 0, rcBar.Width(), rcBar.Height(), &mdc, 0, 0, SRCCOPY);

    ReleaseDC(&dc);

    mdc.SelectObject(pOldBm);
    bm.DeleteObject();
    mdc.DeleteDC();
}
开发者ID:banduladh,项目名称:meplayer,代码行数:55,代码来源:sizecbar.cpp

示例3: OnDrawItem

void CChatWnd::OnDrawItem(int /*nIDCtl*/, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
    CDC* pDC = CDC::FromHandle( lpDrawItemStruct->hDC );
    CRect rc( &lpDrawItemStruct->rcItem );

    Emoticons.Draw( pDC, lpDrawItemStruct->itemID - 1, rc.left + 8, rc.top + 3 );

    if ( lpDrawItemStruct->itemState & ODS_SELECTED )
    {
        pDC->Draw3dRect( &rc, CoolInterface.m_crHighlight, CoolInterface.m_crHighlight );
        rc.DeflateRect( 1, 1 );
        pDC->Draw3dRect( &rc, CoolInterface.m_crHighlight, CoolInterface.m_crHighlight );
    }
    else
    {
        pDC->Draw3dRect( &rc, CoolInterface.m_crWindow, CoolInterface.m_crWindow );
        rc.DeflateRect( 1, 1 );
        pDC->Draw3dRect( &rc, CoolInterface.m_crWindow, CoolInterface.m_crWindow );
    }
}
开发者ID:nlstone,项目名称:Shareaza,代码行数:20,代码来源:WndChat.cpp

示例4: OnDrawBackground

void CXTPHeaderCtrlThemeExplorer::OnDrawBackground(LPDRAWITEMSTRUCT lpDIS)
{
	CRect rcItem(lpDIS->rcItem);
	CDC* pDC = CDC::FromHandle(lpDIS->hDC);

	// fill background
	pDC->FillSolidRect(&rcItem, m_cr3DFace);
	rcItem.right += 2;

	// draw 3D borders.
	pDC->Draw3dRect(&rcItem, m_cr3DHighLight, m_cr3DShadow);
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:12,代码来源:XTPHeaderCtrlTheme.cpp

示例5: DrawActivePage

void CMonitorWnd::DrawActivePage(BOOL bFlag)
{
	if(!m_pActivePage || m_PageList.GetCount() < 2)
	{
		return;
	}

	CRect rect;
	m_pActivePage->GetWindowRect(&rect);
	ScreenToClient(&rect);
	rect.InflateRect(1,1);

	if(bFlag)
	{
		CDC *pDC = GetDC();
		if(pDC == NULL)
		{
			return;
		}

		pDC->Draw3dRect(&rect,m_clrTopLeft, m_clrBottomRight);	

		ReleaseDC(pDC);
	}
	else
	{
		CDC *pDC = GetDC();
		if(pDC == NULL)
		{
			return;
		}

		pDC->Draw3dRect(&rect, MONITOR_BACK_COLOR, MONITOR_BACK_COLOR);	

		ReleaseDC(pDC);
	}
}
开发者ID:mk-z,项目名称:Scan,代码行数:37,代码来源:MonitorWnd.cpp

示例6: DoPaint

void CMonitorBarCtrl::DoPaint(CDC* pDC)
{
	CRect rcClient;
	GetClientRect( &rcClient );

	CSize size = rcClient.Size();
	CDC* pMemDC = CoolInterface.GetBuffer( *pDC, size );
	if ( Settings.General.LanguageRTL )
		SetLayout( pMemDC->m_hDC, 0 );

	if ( ! CoolInterface.DrawWatermark( pMemDC, &rcClient, &m_bmWatermark ) )
		pMemDC->FillSolidRect( &rcClient, CoolInterface.m_crMidtone );

	if ( Skin.m_bBordersEnabled )
		DrawBorders( pMemDC, rcClient );
	else
		rcClient.DeflateRect( 2, 3, 2, 1 );

	for ( int nY = rcClient.top + 4 ; nY < rcClient.bottom - 4 ; nY += 2 )
	{
		pMemDC->Draw3dRect( rcClient.left + 3, nY, 4, 1,
			CoolInterface.m_crDisabled, CoolInterface.m_crDisabled );
	}

	DrawIconEx( pMemDC->GetSafeHdc(), rcClient.right - 16, rcClient.bottom - 16, m_hUpDown, 16, 16, 0, NULL, DI_NORMAL );

	m_pTxItem->SetHistory( rcClient.Width(), TRUE );
	m_pRxItem->SetHistory( rcClient.Width(), TRUE );

	CRect rcHistory( rcClient.left + 10, rcClient.top + 2, rcClient.right - 15, rcClient.bottom - 6 );
	PaintHistory( pMemDC, &rcHistory );

	CRect rcCurrent( rcClient.right - 7, rcClient.top + 2, rcClient.right - 2, rcClient.bottom - 6 );
	PaintCurrent( pMemDC, &rcCurrent, m_pRxItem );
	rcCurrent.OffsetRect( -6, 0 );
	PaintCurrent( pMemDC, &rcCurrent, m_pTxItem );

	m_rcTrack.SetRect( rcClient.left + 6, rcClient.bottom - 8, rcClient.right, rcClient.bottom - 2 );
	PaintTab( pMemDC );

	GetClientRect( &rcClient );
	pDC->BitBlt( rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(),
		pMemDC, 0, 0, SRCCOPY );
	if ( Settings.General.LanguageRTL )
		SetLayout( pMemDC->m_hDC, LAYOUT_RTL );
}
开发者ID:ivan386,项目名称:Shareaza,代码行数:46,代码来源:CtrlMonitorBar.cpp

示例7: DoPaint

void CDownloadMonitorDlg::DoPaint(CDC& dc)
{
	CRect rc;

	m_wndProgress.GetWindowRect( &rc );
	ScreenToClient( &rc );

	DrawProgressBar( &dc, &rc );

	m_wndGraph.GetWindowRect( &rc );
	ScreenToClient( &rc );

	dc.Draw3dRect( &rc, 0, 0 );
	rc.DeflateRect( 1, 1 );

	m_pGraph->BufferedPaint( &dc, &rc );
}
开发者ID:ivan386,项目名称:Shareaza,代码行数:17,代码来源:DlgDownloadMonitor.cpp

示例8: OnEraseBkgnd

BOOL CColorEdit::OnEraseBkgnd(CDC* pDC)
{
	CDC* pdcParent = GetParent()->GetDC();

	ui::CClientRect rcThisClient(this);
	ui::CWindowRect rcThisWindow(this);
	if (rcThisClient.Width() == rcThisWindow.Width())
	{
		rcThisWindow.InflateRect(2, 2);
	}

	GetParent()->ScreenToClient(rcThisWindow);
	pdcParent->Draw3dRect(rcThisWindow, m_crBorder, m_crBorder);
	ReleaseDC(pdcParent);

	return TRUE;
}
开发者ID:mengskysama,项目名称:V8,代码行数:17,代码来源:ColorEdit.cpp

示例9: OnPaint

void ComicStripPicture::OnPaint()
{
   CRect rect;
   GetClientRect(&rect);
	CPaintDC dc(this);
	CDC* pDC = &dc;
	CDC memDC;
	memDC.CreateCompatibleDC(pDC);
	CBitmap memZoomBitmap;
	memZoomBitmap.CreateCompatibleBitmap(pDC, rect.Width(), rect.Height());
	memDC.SelectObject(&memZoomBitmap);

   CDrawer::Draw(this, &memDC, m_pComicStripData);
   memDC.Draw3dRect(rect, RGB(0, 0, 0), RGB(0, 0, 0));
   pDC->BitBlt(0, 0, rect.Width(), rect.Height(), &memDC, 0, 0, SRCCOPY);
	memDC.DeleteDC();
	memZoomBitmap.DeleteObject();
}
开发者ID:njustccy,项目名称:NjustTool,代码行数:18,代码来源:ComicStripPicture.cpp

示例10: PaintMenu

void MenuEditorItem::PaintMenu(CDC& dc, CRect& rect)
{
	// draw this item

	dc.FillSolidRect(rect, 0xffffff);
	dc.Draw3dRect(rect,GetSysColor(COLOR_BTNFACE), GetSysColor(COLOR_BTNFACE));
	m_rect = rect;

	CRect temp = rect;
	
	if(pEditor->selected == this)
	{
		for(int x = temp.left; x < temp.right; x+=2)
		{
			dc.SetPixel(x,temp.top, 0);
			dc.SetPixel(x + 1- temp.Height()%2,temp.bottom-1, 0);
		}
		for(int y = temp.top; y < temp.bottom; y+=2)
		{
			dc.SetPixel(temp.left,y, 0);
			dc.SetPixel(temp.right-1,y +1- temp.Width()%2, 0);
		}
	}

	temp.DeflateRect(2,2);

	if(pEditor->selected == this)
		dc.FillSolidRect(temp, GetSysColor(COLOR_MENUHILIGHT));
	

	temp.left += 20;
	
	if(inserttext)
		dc.SetTextColor(GetSysColor(COLOR_GRAYTEXT));
	else if(pEditor->selected == this)
		dc.SetTextColor(GetSysColor(COLOR_HIGHLIGHTTEXT));
	else
		dc.SetTextColor(GetSysColor(COLOR_MENUTEXT));
	dc.DrawText(m_Text, temp, 0);

	rect.OffsetRect(rect.Width() + 1,0);

}
开发者ID:aolko,项目名称:construct,代码行数:43,代码来源:Menu+Editor+Dlg.cpp

示例11: OnDrawItemValue

BOOL CXTPPropertyGridItemPicture::OnDrawItemValue(CDC& dc, CRect rcValue)
{
	COLORREF clr = dc.GetTextColor();
	CRect rcSample(rcValue.left - 2, rcValue.top + 1, rcValue.left - 2 + m_nPreviewWidth, rcValue.bottom - 1);

	m_olePicture.Render(&dc, rcSample, rcSample);
	dc.Draw3dRect(rcSample, clr, clr);

	CRect rcText(rcValue);
	rcText.left += m_nPreviewWidth + 5;

	short type = m_olePicture.GetType();
	CString str = type == PICTYPE_ICON ? _T("(Icon)") :
		type == PICTYPE_BITMAP ? _T("(Bitmap)") : _T("None");

	dc.DrawText(str, rcText, DT_SINGLELINE | DT_VCENTER);

	return TRUE;
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:19,代码来源:XTPPropertyGridItemExt.cpp

示例12: cdc

void COutlook2Ctrl::AnimateToFolder(int f)
{
	m_iSelectedFolder = f;
 	pLastHilink = NULL;
	m_csCaption = GetFolder(f)->csName;

	if (m_iSize > 4)
	{

		CRect rc;
		GetClientRect(rc);

		CDC dc;
		CClientDC cdc(this);
		dc.CreateCompatibleDC(&cdc);
		CBitmap bmp;
		bmp.CreateCompatibleBitmap(&cdc, rc.Width(), rc.Height());
		CBitmap * ob = (CBitmap *) dc.SelectObject(&bmp);

		DrawCaption(&dc, rc);
		CRect rcBdr(rc);
		rc.InflateRect(-1,-1);
		DrawButtons(&dc, rc);
		int iBottomInner = rc.bottom;
		dc.Draw3dRect(rcBdr, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHILIGHT));
		rcInnerRect = rc;
		dc.FillSolidRect(rc, m_crBackground);
		if (m_iSelectedFolder >= 0 && m_iSelectedFolder < m_Folders.GetSize())
		{
			COL2Folder * o = (COL2Folder *) m_Folders.GetAt(m_iSelectedFolder);
			DrawItems(&dc, o, rc);
		}

		for (int t = iBottomInner - 10; t > 0; t -= (iBottomInner/8))
		{
			cdc.BitBlt(0,t,rc.Width(), iBottomInner - t, &dc, 0,0, SRCCOPY);
			Sleep(30);
		}
		dc.SelectObject(ob);
	}

	Invalidate();
}
开发者ID:Wanghuaichen,项目名称:SignalProcess,代码行数:43,代码来源:Outlook2Ctrl.cpp

示例13: OnTimer

void CPlayWnd::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
	if(nIDEvent ==2)
	{
		if(m_FlagRect == TRUE)
		{
			CDC *pdc = GetDC();
			RECT  rt;
			rt.left =  pointStart.x;
			rt.top =   pointStart.y;		
			rt.right = 	pointEnd.x;
			rt.bottom = pointEnd.y;
			pdc->Draw3dRect(&rt,RGB(255,0,0),RGB(255,0,0));
			ReleaseDC(pdc);
		}
	}
	CWnd::OnTimer(nIDEvent);
}
开发者ID:dalinhuang,项目名称:demodemo,代码行数:19,代码来源:PlayWnd.cpp

示例14: rcItem

void CXTPHeaderCtrlThemeOffice2003::OnDrawBackground(LPDRAWITEMSTRUCT lpDIS)
{
	CRect rcItem(lpDIS->rcItem);
	CDC* pDC = CDC::FromHandle(lpDIS->hDC);

	// fill background
	pDC->FillSolidRect(&rcItem, m_cr3DFace);
	rcItem.right += 2;

	// draw 3D borders.
	pDC->Draw3dRect(&rcItem, m_cr3DHighLight, MixColor(m_cr3DFace, m_cr3DShadow, 0.6));

	CXTPPenDC penDC(lpDIS->hDC, MixColor(m_cr3DFace, m_cr3DShadow, 0.4));
	pDC->MoveTo(rcItem.left, rcItem.bottom-2);
	pDC->LineTo(rcItem.right, rcItem.bottom-2);

	penDC.Color(MixColor(m_cr3DFace, m_cr3DShadow, 0.25));
	pDC->MoveTo(rcItem.left, rcItem.bottom-3);
	pDC->LineTo(rcItem.right, rcItem.bottom-3);
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:20,代码来源:XTPHeaderCtrlTheme.cpp

示例15: DrawItem

void CMLListView::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
	CDC dcItem;
	dcItem.Attach(lpDrawItemStruct->hDC);
	lpDrawItemStruct->itemState;

	CHeaderCtrl* pHdr = GetListCtrl().GetHeaderCtrl();
	int nColCount = pHdr->GetItemCount();

	CRect rcCell = lpDrawItemStruct->rcItem;
	rcCell.right = 0;

	CRect rcCellText;
	for(int iCol = 0; iCol < nColCount; iCol ++)
	{
		int nWidthCol = GetListCtrl().GetColumnWidth(iCol);
		rcCell.right = rcCell.left + nWidthCol;

		CString strItem;
		GetItemText(lpDrawItemStruct->itemID, iCol, strItem);

		dcItem.FillSolidRect(rcCell, OnGetCellBkColor(lpDrawItemStruct->itemID, iCol));
		rcCellText = rcCell;

		rcCellText.DeflateRect(2, 1, 0, 0);
		dcItem.SelectObject(OnGetCellFont(lpDrawItemStruct->itemID, iCol));
		dcItem.SetTextColor(OnGetCellTextColor(lpDrawItemStruct->itemID, iCol));
		dcItem.DrawText(strItem, rcCellText, DT_EXTERNALLEADING|DT_LEFT);
		rcCell.left = rcCell.right;
	}

	if((lpDrawItemStruct->itemState & ODS_FOCUS) == ODS_FOCUS)
	{
		CRect rcFocus = lpDrawItemStruct->rcItem;
		rcFocus.DeflateRect(0, 0, 0, 1);
		dcItem.Draw3dRect(rcFocus, OnGetItemFocusColor(), OnGetItemFocusColor());
	}

	dcItem.SelectStockObject(SYSTEM_FONT) ;
	dcItem.Detach();
}
开发者ID:BennyThink,项目名称:TimeM,代码行数:41,代码来源:MLListView.cpp


注:本文中的CDC::Draw3dRect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。