Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GdiPlusImageRenderHook Class

A service enabling you to customize the GDI+ rendering process before creating report documents.

Namespace: DevExpress.Xpf.Printing

Assembly: DevExpress.Xpf.Printing.v24.2.dll

NuGet Package: DevExpress.Wpf.Printing

#Declaration

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.

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

#Inheritance

Object
GdiPlusImageRenderHook
See Also