Tech
Forums
Jobs
Books
Events
Live
Interviews Prep
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
Get the center of visible part of a transformed image
F Scheltens
Jan 13 2017 5:51 PM
214
Reply
Hi,
i have made a control that zooms an image in and out, using an example i found online as a basis. It is a class which is subclassed from Border and applies transforms to its child. It zooms and pans its child by applying a RenderScaleTransform for zooming in and out, and a RenderTranslateTransform for panning.
When using the mouse this works really well. But when I use a keyboard I am unable to make it zoom in and out with the center of the visible part of the image as origin.
How do I correctly calculate the coordinates that are the middle of the visible part of the image?
I have attached the project folders to this post. The zoomborder is in a library. Project with a client and example image is included. (Solution file is in the Zoomborder folder)
Attachment:
2017-01-07_ZoomBorder.zip
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Want to create Resume Parser
How to access all header text of gridview to other gridview