Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to custom draw in PDF Viewer

$
0
0
The PDF Viewer can draw graphics in the PDF document in the Control.Paint event handler.

In this example, the filled rectangle is drawn at any document space when you hold down the left mouse button and move it. 

The PDF Viewer gets the mouse position relative to the PDF Viewer by calling the PdfViewer.GetDocumentPosition method in the MouseDown (when the left mouse is pressed), and  MouseMove event handlers (when the mouse is moving).

To draw a filled rectangle in the PDF document, the RectangleF.FromLTRB method is called in the Paint event handler. The start and end client points are obtained using the document position in the PdfViewer.GetClientPoint method. 

This example also shows how to draw a rectangle using the Graphics.FillRectangle method.

Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>