PDA

View Full Version : INFO: Dynamically Resizing an Application at Runtime



Support
10-21-2002, 03:23 PM
<HTML><HEAD><TITLE>INFO: Dynamically Resizing an AutoPlay Application at Runtime</TITLE></HEAD><BODY><h3>INFO: Dynamically Resizing an AutoPlay Application at Runtime</h3><b>Document ID: IR04025</b><hr>The information in this article applies to:<ul><li>AutoPlay Media Studio 4.0</li></ul><hr><h3>SUMMARY</h3><p>This article provides information on dynamically resizing your AutoPlay application at runtime using AutoPlay Media studio 4.0.</p><h3>DISCUSSION</h3><p>In AutoPlay Media Studio 4.0, the user's screen resolution can be queried at runtime by using the <b>System.GetInformation</b> action. The two properties that are needed to get the screen resolution are:</p><ul><li><b>Horizontal Resolution</b> - The userís screen width in pixels.</li><li><b>Vertical Resolution</b> - The userís screen height in pixels.</li></ul><p>Here is an example of how you would store the horizontal and vertical resolution of the users screen in two variables:</p><pre><code>%HorizontalRez% = System.GetInformation ( "Horizontal Resolution")<br>%VerticalRez% = System.GetInformation ( "Horizontal Resolution")</code></pre><p>When working with screen resolution it is important to know what the possible options are. The three most common screen resolutions are: 640x480, 800x600, and 1024x768. According to <a href="http://www.websidestory.com" target="blank">www.websidestory.com</a>, 800x600 is the most common screen resolution, being used on about 50% of computers. The second most common is 1024x768, which accounts for about 30% of computers. 640x480 used to be the most popular screen resolution, but as monitors become larger the number of people using this resolution continues to decrease. Currently this number hovers around 5%.</p><p><b>Best Practice:</b> It is generally considered the best practice to design your AutoPlay application with the lowest common denominator in mind. This means that (for now) 640x480 is usually the size you should work with.</p><p>To force your AutoPlay application to be full screen on all systems select: <b>Project | Settings</b> from the menu to display the <i>Project Settings</i> dialog. Then on the Settings tab check the <b>Full screen</b> checkbox.</p><p>If the end user's screen resolution is greater than the <b>Page Size</b> you defined on the Settings tab of the <i>Project Settings</i> dialog, the application will be "banded" by the color defined as the <b>Background color</b> for the current page. This means that if an AutoPlay application was designed for 640 x 480 and was resized to 800 x 600, the "original" 640 x 480 application would appear in the center of the user's screen. The leftover area that surrounds the 640 x 480 would be the color defined as the <b>Background color</b> for the current page.</p><p>If you would like to dynamically resize your AutoPlay application at runtime, use the <b>Window.Move</b> action to set the width and height of your AutoPlay application. As with the <b>Full screen</b> checkbox your application will be "banded" with the <b>Background color</b> if it is sized larger then the <b>Page size</b>. It is important to remember that none of the elements (page backgrounds, objects) in your AutoPlay application will be resized at runtime, only the background will change. The perspective and positions of all elements will remain the same. This means that if you shrink your AutoPlay application using the <b>Window.Move</b> action certain elements may not be visible.</p><p>One last way to handle multiple screen resolutions is to create separate AutoPlay applications that are designed for the various screen resolutions as well as one main controller application. In this case, you would create an AutoPlay application that simply detects the user's screen resolution, launches another AutoPlay application that is sized appropriately and then closes down again. This main controller application would be the "first" AutoPlay application on the CD-ROM in that it would be the one in the root folder. The other AutoPlay applications would be located in sub-directories and launched from there.</p><h3>MORE INFORMATION</h3><p>For more information please see the following topic in the AutoPlay Media Studio 4.0 Help file:</p><li><b>Command Reference | Actions | System | Get Information</b></li><li><b>Command Reference | Actions | Window | Move</b></li><li><b>Command Reference | Project Settings</b></li><p>KEYWORDS: AutoPlay Media Studio 4.0, Screen Resolution, Resizing</p><hr><FONT SIZE=1>Last reviewed: October 30, 2002<br>Copyright © 2002 <A HREF="http://www.indigorose.com" target="blank">Indigo Rose Corporation</a>. All rights reserved.<br></FONT></BODY></HTML>