Occurs when the component paints itself, before painting the content of pages.
property OnBeforePaint: TSRVPOnPaint;
This event allows drawing additional information in this component.
This event allows drawing only beyond the area specified in ARect parameter, because any drawing inside this area will be overridden. This event may be considered redundant, because OnAfterPaint allows drawing both inside and outside of this area.
Since a clipping region is ARect, you need to create a new clipping region to draw outside ARect.
procedure TForm1.SRVPreview1BeforePaint(Sender: TObject; ACanvas: TCanvas;
// creating a clipping region for drawing anywhere in SRVPreview1
HRgn := CreateRectRgn(0, 0, SRVPreview1.Width, SRVPreview1.Height);
// <drawing here>
// restoring the original region
HRgn := CreateRectRgn(ARect.Left, ARect.Top, ARect.Right, ARect.Bottom);