# Template Canvas Scaling

**URL:** <https://forum.inductiveautomation.com/t/template-canvas-scaling/14046>\
**Category:** Ignition\
**Created:** [April 13, 2017, 4:53pm UTC](https://forum.inductiveautomation.com/t/template-canvas-scaling/14046 "2017-04-13T16:53:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zacslade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacslade/32/3587_2.png) [@zacslade](https://forum.inductiveautomation.com/u/zacslade)\
**Post date:** [April 13, 2017, 4:53pm UTC](https://forum.inductiveautomation.com/t/template-canvas-scaling/14046/1 "2017-04-13T16:53:18Z")

</div>

Hi All,

I have a window with a template canvas on it, and several objects randomly placed in the canvas. When the user resizes the window with the template canvas on it, scrollbars appear because the contents of the canvas haven’t scaled with the window. Is there any way around this?

I want to determine the size and position of each template myself, relative to the designer-size of the window, so I don’t think that the canvas layout manager is right for me. However, I am open to the notion that I don’t fully understand the layout manager.

Thanks!  
Zac

---

<div class="post-metadata">

**Author:** ![systemparadox](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@systemparadox](https://forum.inductiveautomation.com/u/systemparadox)\
**Post date:** [January 26, 2018, 12:42pm UTC](https://forum.inductiveautomation.com/t/template-canvas-scaling/14046/2 "2018-01-26T12:42:14Z")

</div>

I am wondering this too. Is there any way to supply positions to the canvas in designer-coordinates and have the template canvas scale up/down appropriately?

---

<div class="post-metadata">

**Author:** ![zacslade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacslade/32/3587_2.png) [@zacslade](https://forum.inductiveautomation.com/u/zacslade)\
**Post date:** [January 26, 2018, 10:28pm UTC](https://forum.inductiveautomation.com/t/template-canvas-scaling/14046/3 "2018-01-26T22:28:05Z")

</div>

Yo, thanks for the bump. For that project, in lieu of answers, we ended up making it so that the user couldn't resize the window. Then we figured out the use-cases for different window sizes and programmatically resized the window and repopulated the canvas appropriately.

This forum thread is worth looking at, though. Looking into the topics discussed here might help you find a method that suits you.

> [@How to maintain aspect ratio in a resizeable popup window?](http://forum.inductiveautomation.com/t/how-to-maintain-aspect-ratio-in-a-resizeable-popup-window/14614):
>
> I’m trying to create a popup window that will contain an IP Camera Viewer object in it. What I’d like to do is set the popup window to be resizeable and maintain its aspect ratio when resized so that the camera viewer also maintains the correct aspect ratio. I could just set the layout mode of the IP Camera View to relative, and check the “Maintain Aspect Ratio” option, but that will leave me with blank space in the popup around the object if I resize it. I’d rather that the window itself mainta…

---

<div class="post-metadata">

**Author:** ![zacslade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacslade/32/3587_2.png) [@zacslade](https://forum.inductiveautomation.com/u/zacslade)\
**Post date:** [January 26, 2018, 10:32pm UTC](https://forum.inductiveautomation.com/t/template-canvas-scaling/14046/4 "2018-01-26T22:32:52Z")

</div>

Also check out this more recent thread:

> [@Adding a listener for window size change](http://forum.inductiveautomation.com/t/adding-a-listener-for-window-size-change/16758):
>
> Since the size of a window is not a bindable property, I can not use it as a property change event for when the size of my window changes. I came across a post which suggested adding a listener would do the job: [The aforementioned useful post](http://forum.inductiveautomation.com/t/propertychange-event-when-window-change-it-size/11369/4) Although the links to explain the java listener were very good and comprehensive, I could not work out how to add it to my window. I believe it needs to be added in the custom method section. But could you please show me a basic example of how one would a…

which asked my question in a much more intelligent way. If you could fire a property change event on window resize, you could repopulate the canvas to suit it.
