<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Scaling a DisplayObject to fit to a container&#8217;s dimensions</title>
	<atom:link href="http://blog.anselmbradford.com/2008/06/30/scaling-a-displayobject-to-fit-to-a-containers-dimensions/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.anselmbradford.com/2008/06/30/scaling-a-displayobject-to-fit-to-a-containers-dimensions/</link>
	<description>wrangling the Internet's wildest</description>
	<lastBuildDate>Tue, 07 Sep 2010 17:22:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: ASP Coder</title>
		<link>http://blog.anselmbradford.com/2008/06/30/scaling-a-displayobject-to-fit-to-a-containers-dimensions/comment-page-1/#comment-987</link>
		<dc:creator>ASP Coder</dc:creator>
		<pubDate>Wed, 17 Jun 2009 01:25:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=27#comment-987</guid>
		<description>Here is the equivalent structure in VBScript:

Save the dimensions of the image in a database when it is uploaded to the site using an upload script or something. Set the dimensions of your container as a variable, then you can turn this into a function and call it whenever you need it.

	If Container_H / Container_W &gt; Img_H / Img_W Then
		Img_Resize_Percentage = Container_W / Img_W
	Else
		Img_Resize_Percentage = Container_H / Img_H
	End If
	

	&#039; resize the image
	&#039; set image width
	New_Width = round(Img_W * Img_Resize_Percentage)
	
	&#039; set Image Height
	New_Height = round(Img_H * Img_Resize_Percentage)</description>
		<content:encoded><![CDATA[<p>Here is the equivalent structure in VBScript:</p>
<p>Save the dimensions of the image in a database when it is uploaded to the site using an upload script or something. Set the dimensions of your container as a variable, then you can turn this into a function and call it whenever you need it.</p>
<p>	If Container_H / Container_W &gt; Img_H / Img_W Then<br />
		Img_Resize_Percentage = Container_W / Img_W<br />
	Else<br />
		Img_Resize_Percentage = Container_H / Img_H<br />
	End If</p>
<p>	&#8216; resize the image<br />
	&#8216; set image width<br />
	New_Width = round(Img_W * Img_Resize_Percentage)</p>
<p>	&#8216; set Image Height<br />
	New_Height = round(Img_H * Img_Resize_Percentage)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lee Probert</title>
		<link>http://blog.anselmbradford.com/2008/06/30/scaling-a-displayobject-to-fit-to-a-containers-dimensions/comment-page-1/#comment-3</link>
		<dc:creator>Lee Probert</dc:creator>
		<pubDate>Tue, 12 Aug 2008 16:38:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=27#comment-3</guid>
		<description>Dude, you just saved me a days work. This shit always frys my brain and frustrates me because I know there&#039;s always a simple solution ... and there it is. Thanks.</description>
		<content:encoded><![CDATA[<p>Dude, you just saved me a days work. This shit always frys my brain and frustrates me because I know there&#8217;s always a simple solution &#8230; and there it is. Thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
