GraphicsCache.DrawLine(Pen, Point, Point) Method
Draws a line on the current painting surface connecting two Point structures.
Namespace: DevExpress.Utils.Drawing
Assembly:
DevExpress.Utils.v23.2.dll
NuGet Packages:
DevExpress.Utils, DevExpress.Wpf.Core
Declaration
public void DrawLine(
Pen pen,
Point pt1,
Point pt2
)
Public Sub DrawLine(
pen As Pen,
pt1 As Point,
pt2 As Point
)
Parameters
Name |
Type |
Description |
pen |
Pen |
A Pen object specifying the Pen used to draw the line.
|
pt1 |
Point |
A Point structure that represents the first point to connect.
|
pt2 |
Point |
A Point structure that represents the second point to connect.
|
The following code snippets (auto-collected from DevExpress Examples) contain references to the DrawLine(Pen, Point, Point) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-grid-draw-empty-rows/CS/MyGridView/MyGridPainter.cs#L28
(rects.FixedRight.IsEmpty || x < rects.FixedRight.Left - 3)))
e.Cache.DrawLine(pen, new Point(x, er.Top), new Point(x, er.Bottom));
winforms-grid-hide-vertical-lines-between-certain-columns/CS/E3647/ColumnLineHelper.cs#L68
p2 = new Point(vi.ColumnsInfo[column].Bounds.Right - 1, ri.Bounds.Bottom - 2);
e.Cache.DrawLine(pen, p1, p2);
}
winforms-grid-print-custom-draw-content/CS/MyXtraGrid/Form1.cs#L40
e.Appearance.FillRectangle(e.Cache, rect);
e.Cache.DrawLine(e.Cache.GetPen(Color.Red, 3), new Point(rect.X, rect.Y), new Point(rect.Right, rect.Bottom));
e.Cache.DrawEllipse(e.Cache.GetPen(Color.Red, 3), rect);
winforms-grid-print-export-custom-painted-content/CS/MyXtraGrid/Form1.cs#L51
e.Appearance.FillRectangle(e.Cache, rect);
e.Cache.DrawLine(new Pen(Brushes.Red, 3), new Point(rect.X, rect.Y), new Point(rect.Right, rect.Bottom));
e.Cache.DrawEllipse(rect.X, rect.Y, rect.Width, rect.Height, Color.Red, 3);
winforms-treelist-implement-group-level-style-feature/CS/Q220534/Form1.cs#L31
Pen linePen = e.Cache.GetPen(tree.ViewInfo.PaintAppearance.HorzLine.BackColor);
e.Cache.DrawLine(linePen, e.Bounds.Location, new Point(e.Bounds.Right, e.Bounds.Y));
}
winforms-grid-draw-empty-rows/VB/MyGridView/MyGridPainter.vb#L32
If (column.Column IsNot Nothing AndAlso column.Column.Fixed <> DevExpress.XtraGrid.Columns.FixedStyle.None) OrElse ((rects.FixedLeft.IsEmpty OrElse x > rects.FixedLeft.Right) AndAlso (rects.FixedRight.IsEmpty OrElse x < rects.FixedRight.Left - 3)) Then
e.Cache.DrawLine(pen, New Point(x, er.Top), New Point(x, er.Bottom))
End If
winforms-grid-hide-vertical-lines-between-certain-columns/VB/E3647/ColumnLineHelper.vb#L72
p2 = New Point(vi.ColumnsInfo(column).Bounds.Right - 1, ri.Bounds.Bottom - 2)
e.Cache.DrawLine(pen, p1, p2)
Next column
winforms-grid-print-custom-draw-content/VB/MyXtraGrid/Form1.vb#L40
e.Appearance.FillRectangle(e.Cache, rect)
e.Cache.DrawLine(e.Cache.GetPen(Color.Red, 3), New Point(rect.X, rect.Y), New Point(rect.Right, rect.Bottom))
e.Cache.DrawEllipse(e.Cache.GetPen(Color.Red, 3), rect)
winforms-grid-print-export-custom-painted-content/VB/MyXtraGrid/Form1.vb#L51
e.Appearance.FillRectangle(e.Cache, rect)
e.Cache.DrawLine(New Pen(Brushes.Red, 3), New Point(rect.X, rect.Y), New Point(rect.Right, rect.Bottom))
e.Cache.DrawEllipse(rect.X, rect.Y, rect.Width, rect.Height, Color.Red, 3)
winforms-treelist-implement-group-level-style-feature/VB/Q220534/Form1.vb#L30
Dim linePen As Pen = e.Cache.GetPen(tree.ViewInfo.PaintAppearance.HorzLine.BackColor)
e.Cache.DrawLine(linePen, e.Bounds.Location, New Point(e.Bounds.Right, e.Bounds.Y))
End If
See Also