|
|
Works like a charm, thanks a lot again!
|
|
|
Call ClientToPage before scaling to find out the coordinates of your point in the page coordinate space. After scaling, call PageToclient to find out the new coordinates of your point in the coordinate space of the control. Now you can draw this point in any WPF-specific way. And this point will be in the same place as before relative to the page elements.
The coordinates of the point in the page coordinate space are the same regardless of the scale or rotation of the page.
|
|
|
Don't exactly know how to use this, but it won't be necessary I guess as I don't wanna draw the rectangle on the page directly. I would prefer to use like another layer and that's why I've been trying to use a canvas or grid instead, but thanks anyway. Maybe I'll try later on... Quote:Try ClientToPage / PageToClient to translate point between the coordinate space of the page and the control. In this case if I use PageToClient method, it seems to be the same as CalcActualRect meaning, that I can get these values from the CalcActualRect. I haven't got a lot of experience with such a computing so I might be wrong or just don't know how to use it properly. Could you lead me more please? Thanks!
|
|
|
Originally Posted by: nobody  I've been trying to figure out how to add a custom shape (like a zone, which purpose is highliting the selected place) on the pdf page in WPF. It's easy to do it in WinForms using PdfViewer.OnPaint method, but there is nothing like that in WPF if I'm right and please correct me if not. PdfViewer.OnRenderQuote: Is there any way how to bound the shape's size to the page (its content)?
Try ClientToPage / PageToClient to translate point between the coordinate space of the page and the control.
|
|
|
Hi there,
I've been trying to figure out how to add a custom shape (like a zone, which purpose is highliting the selected place) on the pdf page in WPF. It's easy to do it in WinForms using PdfViewer.OnPaint method, but there is nothing like that in WPF if I'm right and please correct me if not.
Therefore I've tried a numerous ways and did it by adding a shape in a grid or canvas which is fine, but the problem occured when started zooming the page. I used the methods such as PdfViewer.CalcActualRect etc. to get the coords of the page rect, then a difference between the shape rect and page rect and so on, but it still doesn't scale properly when zooming the page or resizing a window.
Is there any way how to bound the shape's size to the page (its content)? Or can you explain me a bit how it works please? I would really appreciate it!
Thanks
|
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close