<?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: How to crop with AS3</title> <atom:link href="http://blog.stroep.nl/2009/05/how-to-crop/feed/" rel="self" type="application/rss+xml" /><link>http://blog.stroep.nl/2009/05/how-to-crop/</link> <description>Just a collection of random works - Mark Knol</description> <lastBuildDate>Thu, 02 Feb 2012 00:51:33 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Matt</title><link>http://blog.stroep.nl/2009/05/how-to-crop/#comment-71648</link> <dc:creator>Matt</dc:creator> <pubDate>Sat, 06 Aug 2011 13:12:50 +0000</pubDate> <guid isPermaLink="false">http://blog.stroep.nl/?p=510#comment-71648</guid> <description>Thanks for offering this code.  Much apprciated-Matt</description> <content:encoded><![CDATA[<p>Thanks for offering this code.  Much apprciated</p><p>-Matt</p> ]]></content:encoded> </item> <item><title>By: Swaroop</title><link>http://blog.stroep.nl/2009/05/how-to-crop/#comment-62687</link> <dc:creator>Swaroop</dc:creator> <pubDate>Wed, 20 Apr 2011 04:52:59 +0000</pubDate> <guid isPermaLink="false">http://blog.stroep.nl/?p=510#comment-62687</guid> <description>Hi Mark,Thanks a lot for reply.In my scenario I cant mask the image. Complete image should be visible to user.  There is another transparent movieclip having irregular shape in it. I am placing this movieclip on my main image. User will drag, scale and rotate the image, so that some part of image will fit in that irregular shape.When I call the crop function, I am getting a bitmap but it is having white background. This white background is coming because my shape is not at 0,0 (x,y) inside movieclip. When I place the shape at 0,0 location inside the movieclip, I get what I want but I dont want to keep shape at 0,0 inside movieclip.Please help.</description> <content:encoded><![CDATA[<p>Hi Mark,</p><p>Thanks a lot for reply.</p><p>In my scenario I cant mask the image. Complete image should be visible to user.  There is another transparent movieclip having irregular shape in it. I am placing this movieclip on my main image. User will drag, scale and rotate the image, so that some part of image will fit in that irregular shape.</p><p>When I call the crop function, I am getting a bitmap but it is having white background. This white background is coming because my shape is not at 0,0 (x,y) inside movieclip. When I place the shape at 0,0 location inside the movieclip, I get what I want but I dont want to keep shape at 0,0 inside movieclip.</p><p>Please help.</p> ]]></content:encoded> </item> <item><title>By: Mark</title><link>http://blog.stroep.nl/2009/05/how-to-crop/#comment-62645</link> <dc:creator>Mark</dc:creator> <pubDate>Tue, 19 Apr 2011 13:55:35 +0000</pubDate> <guid isPermaLink="false">http://blog.stroep.nl/?p=510#comment-62645</guid> <description>Hi Swaroop, you should mask the image with the custom shape and then use the crop function I guess..</description> <content:encoded><![CDATA[<p>Hi Swaroop, you should mask the image with the custom shape and then use the crop function I guess..</p> ]]></content:encoded> </item> <item><title>By: Swaroop</title><link>http://blog.stroep.nl/2009/05/how-to-crop/#comment-62619</link> <dc:creator>Swaroop</dc:creator> <pubDate>Tue, 19 Apr 2011 07:35:58 +0000</pubDate> <guid isPermaLink="false">http://blog.stroep.nl/?p=510#comment-62619</guid> <description>I want to crop image in irregular shape.
How can I acheive this.Thanks in Advance.</description> <content:encoded><![CDATA[<p>I want to crop image in irregular shape.<br /> How can I acheive this.</p><p>Thanks in Advance.</p> ]]></content:encoded> </item> <item><title>By: Mark</title><link>http://blog.stroep.nl/2009/05/how-to-crop/#comment-53986</link> <dc:creator>Mark</dc:creator> <pubDate>Wed, 02 Feb 2011 08:57:06 +0000</pubDate> <guid isPermaLink="false">http://blog.stroep.nl/?p=510#comment-53986</guid> <description>Hi Cal, how do you call the crop function?</description> <content:encoded><![CDATA[<p>Hi Cal, how do you call the crop function?</p> ]]></content:encoded> </item> <item><title>By: Cal</title><link>http://blog.stroep.nl/2009/05/how-to-crop/#comment-53947</link> <dc:creator>Cal</dc:creator> <pubDate>Tue, 01 Feb 2011 23:28:04 +0000</pubDate> <guid isPermaLink="false">http://blog.stroep.nl/?p=510#comment-53947</guid> <description>Hi, I tried this but got these errors:1120:  Access of undefined property _x.
1120:  Access of undefined property _y.I imported the Matrix class.  Why do you think it&#039;s throwing this error?</description> <content:encoded><![CDATA[<p>Hi, I tried this but got these errors:</p><p>1120:  Access of undefined property _x.<br /> 1120:  Access of undefined property _y.</p><p>I imported the Matrix class.  Why do you think it&#8217;s throwing this error?</p> ]]></content:encoded> </item> <item><title>By: inzam</title><link>http://blog.stroep.nl/2009/05/how-to-crop/#comment-48559</link> <dc:creator>inzam</dc:creator> <pubDate>Thu, 13 Jan 2011 05:22:40 +0000</pubDate> <guid isPermaLink="false">http://blog.stroep.nl/?p=510#comment-48559</guid> <description>if you want crop any image, than i will suggest you to visit the link below
http://www.raiseitsolutions.com/forum/viewtopic.php?f=4&amp;t=2
if you visit this link, you will know how to crop an image easily
thank you very much. :)</description> <content:encoded><![CDATA[<p>if you want crop any image, than i will suggest you to visit the link below<br /> <a href="http://www.raiseitsolutions.com/forum/viewtopic.php?f=4&#038;t=2" rel="nofollow">http://www.raiseitsolutions.com/forum/viewtopic.php?f=4&#038;t=2</a><br /> if you visit this link, you will know how to crop an image easily<br /> thank you very much. <img src='http://blog.stroep.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: T3P</title><link>http://blog.stroep.nl/2009/05/how-to-crop/#comment-42831</link> <dc:creator>T3P</dc:creator> <pubDate>Wed, 22 Dec 2010 18:37:35 +0000</pubDate> <guid isPermaLink="false">http://blog.stroep.nl/?p=510#comment-42831</guid> <description>And this one, crop and resize.../**
*
* @param	$target
* @param	$source
* @param	$cropArea
* @param	$colorTransform
* @param	$blendMode
* @param	$smoothing
* @return
*/
public static function transform( $target:BitmapData, $source:BitmapData, $cropArea:Rectangle=null, $colorTransform:ColorTransform=null, $blendMode:String=null, $smoothing:Boolean=true ):BitmapData{
if( $target==null &#124;&#124; $source==null ) return null ;
//
$cropArea= ($cropArea)? $cropArea : $source.rect ;
//
var matrix :Matrix= new Matrix();
matrix.a= $target.width/$cropArea.width ;
matrix.d= $target.height/$cropArea.height ;
matrix.tx= -$cropArea.x*matrix.a ;
matrix.ty= -$cropArea.y*matrix.d ;
//
$target.draw( $source, matrix, $colorTransform, $blendMode, $target.rect, $smoothing ) ;
return $target ;
}</description> <content:encoded><![CDATA[<p>And this one, crop and resize&#8230;</p><p>/**<br /> *<br /> * @param	$target<br /> * @param	$source<br /> * @param	$cropArea<br /> * @param	$colorTransform<br /> * @param	$blendMode<br /> * @param	$smoothing<br /> * @return<br /> */<br /> public static function transform( $target:BitmapData, $source:BitmapData, $cropArea:Rectangle=null, $colorTransform:ColorTransform=null, $blendMode:String=null, $smoothing:Boolean=true ):BitmapData{<br /> if( $target==null || $source==null ) return null ;<br /> //<br /> $cropArea= ($cropArea)? $cropArea : $source.rect ;<br /> //<br /> var matrix :Matrix= new Matrix();<br /> matrix.a= $target.width/$cropArea.width ;<br /> matrix.d= $target.height/$cropArea.height ;<br /> matrix.tx= -$cropArea.x*matrix.a ;<br /> matrix.ty= -$cropArea.y*matrix.d ;<br /> //<br /> $target.draw( $source, matrix, $colorTransform, $blendMode, $target.rect, $smoothing ) ;<br /> return $target ;<br /> }</p> ]]></content:encoded> </item> </channel> </rss>
