Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5973119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:45:18+00:00 2026-05-22T20:45:18+00:00

In a wpf control with zoom functionality I calculate from the MouseWheelEventArgs how to

  • 0

In a wpf control with zoom functionality I calculate from the MouseWheelEventArgs how to scale the drawing canvas to implement the zoom effect.

Point mouse = e.GetPosition(myCanvas);
Matrix m = myCanvas.RenderTransform.Value;

if (e.Delta > 0)
{
    f = 1.1;
}
else
{
    f = 1.0 / 1.1;
}

m.ScaleAtPrepend(f, f, mouse.X, mouse.Y);
myCanvas.RenderTransform = new MatrixTransform(m);

I would like to know the actual size of one of the circles on the canvas. However Width, ActualWidth and such stay the same while zooming in and out (16.0). How would you determine (calculate?) the size of the circle that a user actually sees on his or her screen?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:45:19+00:00Added an answer on May 22, 2026 at 8:45 pm

    MatrixTransform has a method TransformBounds for this. You feed it with original bounding box of the image (I think in your case 0,0,width,height will do) and it will return you its resulting bounding box.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The WPF control WindowsFormsHost inherits from IDisposable. If I have a complex WPF visual
I need to host WPF control inside IE, therefore I'm trying to implement IHTMLPainter
I have a customized WPF control that is derived from UserControl. In the Resources
I have a WPF Control and I want to drop a specific file from
I've got a WPF Control that exposes one of it's children (from it's ControlTemplate)
I need a zooming mechanism. So I found one on Zoom control to WPF
How to update a WPF Control from the TPL Task? Fine so I tried
I'm creating a custom WPF control which derives from Grid. It's a Chess board
I have a WPF control, that has a list of Investors, and in the
If you have a WPF control library which you wanted to license to developers,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.