This repository has been archived by the owner on Sep 25, 2023. It is now read-only.
/
Form1.cs
61 lines (48 loc) · 1.86 KB
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.XtraPrinting;
// ...
namespace LineBrickAndDrawLine {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e) {
printControl1.PrintingSystem = ps;
}
private void btnDrawLine_Click(object sender, EventArgs e) {
// Prepare for creating a document.
ps.Begin();
BrickGraphics gr = ps.Graph;
gr.Modifier = BrickModifier.Detail;
// Draw a line with the specified coordinates, foreground color and thickness.
LineBrick brick = gr.DrawLine(new PointF(0, 0), new PointF(200, 200), Color.Red, 5);
// Change the line style to dash-dot-dot.
brick.LineStyle = System.Drawing.Drawing2D.DashStyle.DashDotDot;
// Hide brick borders.
brick.BorderWidth = 0;
// Finish creating the document.
ps.End();
}
private void btnDrawBrick_Click(object sender, EventArgs e) {
// Prepare for creating a document.
ps.Begin();
BrickGraphics gr = ps.Graph;
gr.Modifier = BrickModifier.Detail;
// Create a new line brick.
LineBrick brick = new LineBrick();
// Specify its properties.
brick.Rect = new RectangleF(0, 0, 200, 200);
brick.LineDirection = DevExpress.XtraReports.UI.LineDirection.BackSlant;
brick.ForeColor = Color.Red;
brick.LineWidth = 5;
brick.LineStyle = System.Drawing.Drawing2D.DashStyle.DashDotDot;
brick.BorderWidth = 0;
// Draw this brick.
gr.DrawBrick(brick);
// Finish creating the document.
ps.End();
}
}
}