locked
Relative Scaling and Positioning.

    Question

  • Say I have a control, and I added other controls (in this case a Canvas) and I also have other controls within it (Images). Now when the screen is resized or the Canvas resize, the images' size and position stayed the same (see image below). Edit: I used C++ and XAML.

    A natural question then arise. Is there a way to scale/position child controls base on parent controls?


    Sunday, February 2, 2014 4:17 AM

Answers

  • Fixed everything by wrapping my Primitive Controls (there's a lot of tiers of Controls) with ViewBox, setting Stretch="Uniform".
    • Marked as answer by JoeyAndres Sunday, February 2, 2014 11:17 AM
    Sunday, February 2, 2014 11:16 AM

All replies

  • Yes, you can do this.

    How will depend on which language (VB.Net? C++? JavaScript?) and UI (HTML? Xaml? DirectX?) you are using. Let us know which and we can get you to the right forum.

    --Rob

    Sunday, February 2, 2014 5:36 AM
    Moderator
  • I used c++. UI is XAML.
    Sunday, February 2, 2014 7:04 AM
  • Fixed everything by wrapping my Primitive Controls (there's a lot of tiers of Controls) with ViewBox, setting Stretch="Uniform".
    • Marked as answer by JoeyAndres Sunday, February 2, 2014 11:17 AM
    Sunday, February 2, 2014 11:16 AM