// virtual void Polyline::OnRender(Graphics* pGraphics) { PointCollection* points = get_Points(); if (points) { unsigned int count = points->GetCount(); if (count > 0) { __release<LDraw::GraphicsPathF> path = new LDraw::GraphicsPathF; Point point = points->get_Item(0); path->AddMove(point.X, point.Y); for (unsigned int i = 1; i < count; i++) { point = points->get_Item(i); path->AddLine(point.X, point.Y); } Brush* Fill = get_Fill(); if (Fill) { __release<LDraw::Brush> brush = Fill->CreateBrush(this, 1, 1); if (brush != NULL) { pGraphics->FillPath(brush, path); } } #if 0 double StrokeThickness; if (m_StrokeThickness) m_StrokeThickness->get_Value(&StrokeThickness); else StrokeThickness = 1; if (StrokeThickness > 0) { CComQIPtr<CLXUIElementImplImpl> Stroke(m_Stroke); if (Stroke) { Gdiplus::Brush* pBrush = Stroke->CreateBrush(this, 1, 1); if (pBrush) { Gdiplus::Pen pen(pBrush, StrokeThickness); pGraphics->DrawPath(pen, &path); delete pBrush; } } } #endif } } }
// virtual void Rectangle::OnRender(Graphics* pGraphics) { LDraw::SizeD actualSize = get_ActualSize(); //if (m_computedRectangleWidth > 0 && m_computedRectangleHeight > 0) { // LDraw::SmoothingMode oldSmoothingMode = pGraphics->GetSmoothingMode(); // pGraphics->SetSmoothingMode(LDraw::SmoothingModeHighQuality); // __release<LDraw::GraphicsPathF> path = new LDraw::GraphicsPathF; //#if _WINDOWS // RoundRect(&path, m_computedRectangleLeft, m_computedRectangleTop, m_computedRectangleWidth, m_computedRectangleHeight, m_computedRadiusX, m_computedRadiusY); //#else // path->AddRoundRect(0, 0, actualSize.Width, actualSize.Height, m_computedRadiusX, m_computedRadiusY); //#endif // pGraphics->FillPath(&LDraw::SolidBrush(LDraw::Color(255, 0, 0)), &path); Brush* Fill = get_Fill(); if (Fill) { __release<LDraw::Brush> brush = Fill->CreateBrush(this, 1, 1); if (brush != NULL) { pGraphics->FillRectangle(brush, 0, 0, actualSize.Width, actualSize.Height); #if 0 pGraphics->FillRectangle(pBrush, m_computedRectangleLeft, m_computedRectangleTop, m_computedRectangleWidth, m_computedRectangleHeight); pGraphics->Clear(LDraw::Color(255, 0, 0)); pGraphics->FillPath(brush, path); #endif } } #if 0//_WINDOWS double StrokeThickness; if (m_StrokeThickness) StrokeThickness = m_StrokeThickness->get_Value(); else StrokeThickness = 1; if (StrokeThickness > 0) { CLXUIElementImpl* Stroke = m_Stroke; if (Stroke) { LDraw::Brush* pBrush = Stroke->CreateBrush(this, 1, 1); if (pBrush) { LDraw::Pen pen(pBrush, StrokeThickness); pGraphics->DrawPath(pen, &path); delete pBrush; } } } #endif // pGraphics->SetSmoothingMode(oldSmoothingMode); //#elif AMIGA // pGraphics->FillRectangle(&LDraw::SolidBrush(LDraw::Color(255, 0, 0)), m_computedRectangleLeft, m_computedRectangleTop, m_computedRectangleWidth, m_computedRectangleHeight); //#endif } }