![]() Void pdfViewer1_MouseMove(object sender, MouseEventArgs e)ĮndPosition = pdfViewer1.GetDocumentPosition(e.Location) StartPosition = pdfViewer1.GetDocumentPosition(e.Location) ![]() Void pdfViewer1_MouseDown(object sender, MouseEventArgs e) PdfViewer1.MouseUp += pdfViewer1_MouseUp PdfViewer1.MouseMove += pdfViewer1_MouseMove PdfViewer1.MouseDown += pdfViewer1_MouseDown View Example: How to custom draw in PDF Viewer This example also shows how to draw a rectangle using the Graphics.FillRectangle method. The start and end client points are obtained using the document position in the PdfViewer.GetClientPoint method. To draw a filled rectangle, the RectangleF.FromLTRB method is called in the Paint event handler. The PDF Viewer gets the mouse position relative to the document by calling the PdfViewer.GetDocumentPosition method in the MouseDown (when the left mouse is pressed) and MouseMove event handlers (when the mouse is moving). 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 can draw graphics in the PDF document in the Control.Paint event handler.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |