wpf-devexpress-dot-xpf-dot-printing-b4c8071b.md
A service enabling you to customize the GDI+ rendering process before creating report documents.
Namespace : DevExpress.Xpf.Printing
Assembly : DevExpress.Xpf.Printing.v25.2.dll
NuGet Package : DevExpress.Wpf.Printing
public class GdiPlusImageRenderHook
Public Class GdiPlusImageRenderHook
All Graphics objects are passed through the GdiPlusImageRenderHook service and can be customized. To add the service to a report’s Printing System, use the PrintingSystemBase.AddService method.
The following example illustrates how to use the GdiPlusImageRenderHook class to adjust the quality of text rendering in a report document.
using DevExpress.Xpf.Printing;
// ...
private void Button_Click(object sender, System.Windows.RoutedEventArgs e) {
XtraReport1 report = new XtraReport1();
report.PrintingSystem.AddService(typeof(GdiPlusImageRenderHook),
new DelegateGdiPlusImageRenderHook(graphics => {
graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;
}));
PrintHelper.ShowPrintPreview(this, report);
}
Imports DevExpress.Xpf.Printing
' ...
Private Sub Button_Click(sender As Object, e As System.Windows.RoutedEventArgs)
Dim report As New XtraReport1()
report.PrintingSystem.AddService(GetType(GdiPlusImageRenderHook), _
New DelegateGdiPlusImageRenderHook(Function(graphics)
graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit
End Function))
PrintHelper.ShowPrintPreview(Me, report)
End Sub
Object GdiPlusImageRenderHook
See Also