コード例 #1
0
ファイル: PieSlice.cs プロジェクト: intille/mitessoftware
 /// <summary>
 ///   Draws the outer periphery of the pie slice.
 /// </summary>
 /// <param name="graphics">
 ///   <c>Graphics</c> object used to draw the surface.
 /// </param>
 /// <param name="pen">
 ///   <c>Pen</c> used to draw outline.
 /// </param>
 /// <param name="brush">
 ///   <c>Brush</c> used to fill the quadrilateral.
 /// </param>
 /// <param name="boundingRect">
 ///   Bounding rectangle that is used to draw the top surface of the 
 ///   pie slice.
 /// </param>
 /// <param name="startAngle">
 ///   Start angle (in degrees) of the periphery section.
 /// </param>
 /// <param name="endAngle">
 ///   End angle (in degrees) of the periphery section.
 /// </param>
 /// <param name="pointStart">
 ///   Point representing the start of the periphery.
 /// </param>
 /// <param name="pointEnd">
 ///   Point representing the end of the periphery.
 /// </param>
 protected void DrawCylinderSurfaceSection(GraphicsPlus graphics, PenPlus pen, BrushPlus brush, float startAngle, float endAngle, GpPointF pointStart, GpPointF pointEnd)
 {
     GraphicsPath path = CreatePathForCylinderSurfaceSection(startAngle, endAngle, pointStart, pointEnd);
     graphics.FillPath(brush, path);
     graphics.DrawPath(pen, path);
 }
コード例 #2
0
 /// <summary>
 ///   Draws the <c>Quadrilateral</c> with <c>Graphics</c> provided.
 /// </summary>
 /// <param name="graphics">
 ///   <c>Graphics</c> used to draw.
 /// </param>
 /// <param name="pen">
 ///   <c>Pen</c> used to draw outline.
 /// </param>
 /// <param name="brush">
 ///   <c>Brush</c> used to fill the inside. 
 /// </param>
 public void Draw(GraphicsPlus graphics, PenPlus pen, BrushPlus brush)
 {
     graphics.FillPath(brush, m_path);
     graphics.DrawPath(pen, m_path);
 }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: misiek/foo
        private void TestGdiPlus(GraphicsPlus graphics)
        {
            graphics.DrawImage(bmp, 0, 0, ClientRectangle.Width, ClientRectangle.Height);

            PenPlus pen;

            graphics.SetSmoothingMode(SmoothingMode.SmoothingModeAntiAlias);

            pen= new PenPlus(Color.Black, 15);
            pen.SetEndCap(LineCap.LineCapRound);
            pen.SetStartCap(LineCap.LineCapRound);

            pen.SetWidth(3);

            pen.SetColor(Color.FromArgb(0x7f7f7f7f));
            pen.SetWidth(40);
            graphics.DrawLine(pen, 20, 20, ClientRectangle.Right - 20, ClientRectangle.Bottom - 20);
            graphics.DrawLine(pen, ClientRectangle.Right - 20, 20, 20, ClientRectangle.Bottom - 20);

            SmoothingMode mode = graphics.GetSmoothingMode();
            graphics.SetSmoothingMode(SmoothingMode.SmoothingModeAntiAlias);
            foreach(GraphicsPath p in allPaths)
                graphics.DrawPath(penWrite, p);
            graphics.SetSmoothingMode(mode);
            pen.Dispose();
        }