-
Notifications
You must be signed in to change notification settings - Fork 1
/
RoundPanelBrickExporter.cs
26 lines (24 loc) · 1.13 KB
/
RoundPanelBrickExporter.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
using DevExpress.Drawing;
using DevExpress.XtraPrinting;
using DevExpress.XtraPrinting.BrickExporters;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace DevExpress.XtraReports.CustomControls.RoundBordersControls {
public class RoundPanelBrickExporter : PanelBrickExporter {
RoundPanelBrick RoundedBrick { get { return Brick as RoundPanelBrick; } }
protected override void DrawBackground(IGraphics gr, RectangleF rect) {
if(RoundedBrick.BorderCornerRadius > 0) {
DXSmoothingMode oldSmoothingMode = gr.SmoothingMode;
try {
gr.SmoothingMode = DXSmoothingMode.AntiAlias;
RoundedBorderPaintHelper.DrawRoundedBackGround(gr, rect, Style, BrickPaint, RoundedBrick.BorderCornerRadius);
RoundedBorderPaintHelper.DrawRoundedBorders(gr, rect, Style, BrickPaint, RoundedBrick.BorderCornerRadius);
} finally {
gr.SmoothingMode = oldSmoothingMode;
}
return;
}
base.DrawBackground(gr, rect);
}
}
}