本文整理汇总了C++中CPaintDC::LineTo方法的典型用法代码示例。如果您正苦于以下问题:C++ CPaintDC::LineTo方法的具体用法?C++ CPaintDC::LineTo怎么用?C++ CPaintDC::LineTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPaintDC
的用法示例。
在下文中一共展示了CPaintDC::LineTo方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawField
void CModelFormItem::DrawField(CPaintDC & dc)
{
CRect rectItem;
GetClientRect(rectItem);
int eff = m_param.GetEndFirstField();
int bsf = m_param.GetBeginSecondField();
dc.MoveTo(eff, rectItem.top + 2);
dc.LineTo(eff, rectItem.bottom - 2);
dc.MoveTo(bsf, rectItem.top + 2);
dc.LineTo(bsf, rectItem.bottom - 2);
}
示例2: DrawLine
void CSeparator::DrawLine(CPaintDC &dc, CRect &clientRect)
{
HPEN hp = dc.SelectPen(Globals::Instance().sep.pen);
dc.MoveTo(clientRect.left, (clientRect.top + clientRect.bottom) / 2-1);
dc.LineTo(clientRect.right, (clientRect.top + clientRect.bottom) / 2-1);
dc.SelectPen(hp);
}
示例3: AxeGraph
void CAfficheMesPol::AxeGraph(CPaintDC &dc)
{
dc.FillSolidRect(PosGrX(0),PosGrY(255),PosGrX(255)-20,PosGrY(0)-40,RGB(255,255,255));
CPen PenAxe(PS_SOLID,1,RGB(0,0,0));
dc.SelectObject(&PenAxe);
dc.MoveTo(PosGrX(0),PosGrY(0));
dc.LineTo(PosGrX(0),PosGrY(255));
dc.MoveTo(PosGrX(0),PosGrY(0));
dc.LineTo(PosGrX(255),PosGrY(0));
for(int i=5;i<255;i+=5)
{
dc.MoveTo(PosGrX(0),PosGrY(i));
dc.LineTo(PosGrX(3),PosGrY(i));
dc.MoveTo(PosGrX(i),PosGrY(0));
dc.LineTo(PosGrX(i),PosGrY(3));
}
DeleteObject(&PenAxe);
}
示例4: DoPaint
// CFileOpenDlg::DoPaint
//
// Paints the splitter if it is displayed
//
void CFileOpenDlg::DoPaint(CPaintDC& dc)
{
if(m_nState == vsStandard)
{
CRect rcClient;
int y;
GetClientRect(&rcClient);
y = m_ySplit;
dc.MoveTo(0, y);
dc.LineTo(rcClient.right, y);
y += 6; // This is the splitter height
dc.MoveTo(0, y);
dc.LineTo(rcClient.right, y);
}
}
示例5: OnPaint
void CMainWindow::OnPaint ()
{
CPaintDC dc (this);
//
// Initialize the device context.
//
dc.SetMapMode (MM_LOENGLISH);
dc.SetTextAlign (TA_CENTER | TA_BOTTOM);
dc.SetBkMode (TRANSPARENT);
//
// Draw the body of the ruler.
//
CBrush brush (RGB (255, 255, 0));
CBrush* pOldBrush = dc.SelectObject (&brush);
dc.Rectangle (100, -100, 1300, -200);
dc.SelectObject (pOldBrush);
//
// Draw the tick marks and labels.
//
for (int i=125; i<1300; i+=25) {
dc.MoveTo (i, -192);
dc.LineTo (i, -200);
}
for (i=150; i<1300; i+=50) {
dc.MoveTo (i, -184);
dc.LineTo (i, -200);
}
for (i=200; i<1300; i+=100) {
dc.MoveTo (i, -175);
dc.LineTo (i, -200);
CString string;
string.Format (_T ("%d"), (i / 100) - 1);
dc.TextOut (i, -175, string);
}
}
示例6: DrawDepartment
void CDepartmentEstimationDialog::DrawDepartment(CPaintDC &dc, std::vector<SPosition> Coordinates, std::string DerpartmentName /*= ""*/)
{
// First, Draw Contour
// -------------------
if (Coordinates.size() == 0)
return;
CBrush brush(3, RGB(255,255,255));
dc.SelectObject(&brush);
dc.MoveTo(ConvertPhysicalCoordinateToCanvas(Coordinates[0]));
for (unsigned int i = 1; i < Coordinates.size(); i++)
{
dc.LineTo(ConvertPhysicalCoordinateToCanvas(Coordinates[i]));
}
dc.LineTo(ConvertPhysicalCoordinateToCanvas(Coordinates[0]));
brush.DeleteObject();
if (DerpartmentName == "")
return; // this is the establishment itself and does not require name printing
// Then, Print Title
// -----------------
CRectReal RectReal = GetEncapsulatingRect(Coordinates);
SPosition DepartmentNamePosition;
DepartmentNamePosition.x = (RectReal.left + RectReal.right) / 2;
DepartmentNamePosition.y = (RectReal.top + RectReal.bottom) / 2;
POINT DepartmentNamePositionOnCanvas = ConvertPhysicalCoordinateToCanvas(DepartmentNamePosition);
DrawText(dc, DerpartmentName.c_str(), RGB(255,255,255),
DepartmentNamePositionOnCanvas.x - HALF_TEXT_WIDTH,
DepartmentNamePositionOnCanvas.y - HALF_TEXT_HEIGHT,
DepartmentNamePositionOnCanvas.x + HALF_TEXT_WIDTH,
DepartmentNamePositionOnCanvas.y + HALF_TEXT_HEIGHT);
}
示例7: PaintItems
void CIperfView::PaintItems(CPaintDC &dc, CIperfViewItem *pa)
{
POSITION pos;
INT_PTR count;
INT_PTR idx = 0;
double x0 = 0, x1 = 0, y = 0;
double t0, t1;
double xstep, ystep;
double speed;
int fast = 0;
CRect rect;
count = pa->m_List.GetCount();
GetClientRect(&rect);
xstep = rect.Width() / 60.0;
ystep = rect.Height() / HEIGHT;
CPen pen(PS_SOLID, 1, pa->m_color);
CPen* pOldPen = dc.SelectObject(&pen);
for ( pos = pa->m_List.GetHeadPosition(); pos != NULL; pa->m_List.GetNext( pos ) )
{
t0 = pa->m_List.GetAt( pos ).t0;
t1 = pa->m_List.GetAt( pos ).t1;
if(pa->m_List.GetAt( pos ).speed) {
speed = 10*log10(pa->m_List.GetAt( pos ).speed);
} else {
speed = 0;
}
//
x0 = t0 * xstep;
x1 = t1 * xstep;
y = rect.Height() - speed * ystep;
// point set
CRect rect0( (int)x0-2, (int)y-2, (int)x0+2, (int)y+2);
CRect rect1( (int)x1-2, (int)y-2, (int)x1+2, (int)y+2);
//dc.Ellipse(rect0);
dc.Ellipse(rect1);
if(fast++ == 0)
dc.MoveTo(CPoint((int)x0,(int)y));
dc.LineTo(CPoint((int)x1,(int)y));
}
dc.SelectObject(pOldPen);
}
示例8: PaintXMaps
void CIperfView::PaintXMaps(CPaintDC &dc)
{
CRect rect;
GetClientRect(&rect);
double x, xstep;
xstep = rect.Width() / 60.0 * 2;
for(x =0.0; x < rect.Width() ; x += xstep)
{
CPen pen(PS_SOLID, 1, RGB(240,240,240));
CPen* pOldPen = dc.SelectObject(&pen);
dc.MoveTo(CPoint( (int)x, 1));
dc.LineTo(CPoint( (int)x, (int)rect.Height() - 1));
dc.SelectObject(pOldPen);
}
}
示例9: PaintYMaps
void CIperfView::PaintYMaps(CPaintDC &dc)
{
CRect rect;
GetClientRect(&rect);
double y, ystep, k, j;
ystep = rect.Height() / HEIGHT;
for(j = 1; j < 10000000000; j*=10)
{
for(k = 1; k < 10; k++)
{
y = rect.Height() - 10*log10(k*j) * ystep;
if(y < 0) goto over;
CPen pen(PS_SOLID, 1, ((k != 1) ? RGB(240,240,240) : RGB(120,120,120)) );
CPen* pOldPen = dc.SelectObject(&pen);
dc.MoveTo(CPoint( 1, (int)y));
dc.LineTo(CPoint( (int)rect.Width() -1, (int)y));
dc.SelectObject(pOldPen);
}
}
over:
return;
}