Back to Devexpress

GdiPlusImageRenderHook Class

wpf-devexpress-dot-xpf-dot-printing-b4c8071b.md

latest2.4 KB
Original Source

GdiPlusImageRenderHook Class

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

Declaration

csharp
public class GdiPlusImageRenderHook
vb
Public Class GdiPlusImageRenderHook

Remarks

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.

csharp
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);
}
vb
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

Inheritance

Object GdiPlusImageRenderHook

See Also

GdiPlusImageRenderHook Members

DevExpress.Xpf.Printing Namespace