It is currently Mon Apr 21, 2014 1:44 am




Post new topic Reply to topic  [ 8 posts ] 
 Scaling 
Author Message
General
General

Joined: Wed Apr 25, 2012 5:51 am
Posts: 383
Location: Terryville, CT
Post Scaling
I am trying to scale an indirect template path to fit a window. what is a good way of doing this?
I was thinking to make a tag to hold the width and height and write some code to make a scale factor and then manipulate this in some code to fit my window..
Is there a quicker, easier way to do this?

I just need the window to recognize the template size coming from the template path and scale it to fit on the screen.

I am also having some difficulty with my mouse events not triggering as they interact with some of my components. I tried making a blank label on the top layer of the template and put the event to trigger according to this...It works but if this is what must be done, I would like to link the label layout to the template window size and also keep it on the top layer so others cannot move it or change the size.

Any thoughts?


Mon Jun 11, 2012 6:12 am
Profile
General
General

Joined: Wed Apr 25, 2012 5:51 am
Posts: 383
Location: Terryville, CT
Post Re: Scaling
I've also noticed that by placing my label event handler layer inside a group component, it runs much slower than if I place the label inside the template which contains the group component. Why is this?


Mon Jun 11, 2012 7:01 am
Profile
Moderator
Moderator

Joined: Fri Mar 16, 2012 1:00 pm
Posts: 760
Location: Sacramento, CA
Post Re: Scaling
For the template to fit inside the window, make the window the size you want it , scale the template to the size you want, then adjust the Layout Constraints (Ctrl+L). Select Anchored, then anchor all 4 corners of the template inside the window.

_________________
Greg Simpson
Inductive Automation
Technical Support Rep


Mon Jun 11, 2012 7:16 am
Profile
General
General

Joined: Wed Apr 25, 2012 5:51 am
Posts: 383
Location: Terryville, CT
Post Re: Scaling
Greg.Simpson wrote:
For the template to fit inside the window, make the window the size you want it , scale the template to the size you want, then adjust the Layout Constraints (Ctrl+L). Select Anchored, then anchor all 4 corners of the template inside the window.


what does the anchoring get me for the sizing of the templates?
I'm thinking that I will need to make every template square sized so they are not stretching inside my popup.
I'm assuming there is no other way to do this.
As long as the template container fits inside the window, I dont really need to worry about anchoring them then, correct?

This seems fine but I just want to make sure I understand 100% on this.


Tue Jun 12, 2012 9:27 am
Profile
Moderator
Moderator

Joined: Fri Mar 16, 2012 1:00 pm
Posts: 760
Location: Sacramento, CA
Post Re: Scaling
By anchoring the template inside of the popup it will always maintain that distance to the sides of the popup. So if you make the popup bigger, the template will maintain that same distance to the sides of the popup, changing the scale with the popup.

And yes, if the template fits inside the window, you do not need to anchor it.

_________________
Greg Simpson
Inductive Automation
Technical Support Rep


Tue Jun 12, 2012 9:46 am
Profile
General
General

Joined: Wed Apr 25, 2012 5:51 am
Posts: 383
Location: Terryville, CT
Post Re: Scaling
Greg.Simpson wrote:
By anchoring the template inside of the popup it will always maintain that distance to the sides of the popup. So if you make the popup bigger, the template will maintain that same distance to the sides of the popup, changing the scale with the popup.

And yes, if the template fits inside the window, you do not need to anchor it.


Ah, okay now I fully understand why you said to anchor it..
It is that my templates are all different shapes and sizes and I am trying to call them all to display inside of a popup window without stretching the images out.
Square templates is how to do this I'm assuming.


Tue Jun 12, 2012 10:20 am
Profile
Moderator
Moderator

Joined: Fri Mar 16, 2012 1:00 pm
Posts: 760
Location: Sacramento, CA
Post Re: Scaling
I dont know how many templates your going to be displaying in your popups, or how much work this might be, but, you can find/make the template the size you would like to use, Ctrl+P, get the size, then adjust the other sizes accordingly. I understand what your saying about using square templates, to keep them all relatively the same size.

_________________
Greg Simpson
Inductive Automation
Technical Support Rep


Tue Jun 12, 2012 10:29 am
Profile
General
General

Joined: Wed Apr 25, 2012 5:51 am
Posts: 383
Location: Terryville, CT
Post Re: Scaling
thanks, I really don't think I can make my templates all the same size..
But, by squaring them up, I should be able to make them popup and not look wrong. the sizes are going to vary a lot but at least they will look larger than their size in the overall layout.

Thanks,
AJ


Tue Jun 12, 2012 10:56 am
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron