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 6539701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:53:24+00:00 2026-05-25T10:53:24+00:00

I have created a custom class derived from Canvas, which contain elements which will

  • 0

I have created a custom class derived from Canvas, which contain elements which will be derived from Visual. The canvas also contains a grid which i have created by creating lines.

Now for zooming, i remove everything from the canvas, resize the canvas (which is placed inside ScrollViewer), and redraw everything that is on it. Is there a better way to implement zoom, something that is provided, which allows me to scroll and zoom, and somehow create a viewport, that i can move and resize (for scrolling and zooming)? Because my concern is that soon there will be complex shapes, curves and points placed on the canvas, and maybe by the thousands, and things will get pretty slow if i use the approach that i am using currently.

Please tell if there is a better way.

  • 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-25T10:53:24+00:00Added an answer on May 25, 2026 at 10:53 am

    If you don’t want to affect the layout, then I would suggest you to use RenderTransform instead of LayoutTransform. So something like this:

    <Canvas>
        <Canvas.RenderTransform>
            <ScaleTransform ScaleX="1" ScaleY="1"/>
        </Canvas.RenderTransform>
        <!--- other controls -->
    </Canvas>
    

    You may also would like to use RenderTransformOrigin dependency property of UIElement, and you can do zoom-in and out, from code behind changing the value of ScaleX and ScaleY.

    By the way, you also would like to read these before doing what you want to do:

    • RenderTransform vs. LayoutTransform (Petzold’s blog)
    • LayoutTransform vs. RenderTransform in WPF
    • LayoutTransform vs. RenderTransform
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my own custom control derived from System.Windows.Forms.TreeView which is present on the
I have created a custom even class which is pretty basic. But when calling
I have created a custom dialog for Visual Studio Setup Project using the steps
If have created a custom role within SqlServer which I added to the db__denydatareader
I have created a simple Asp.Net custom control which automatically combines all the correct
I'm trying to create a custom control - a button - which will have
I created a custom ToggleButton class, ToggleButtonEx, that extends ToggleButton. ToggleButtonEx contains some dependency
I have created a custom class for my Android project called Sounds I want
I have created a custom myViewController class and it has the default view ,
I have created an ArrayList (Java) of my custom class objects with a size

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.