Instead of using copyPixels, try something
like this… This function crops the bitmapData to the width and
height with respect to the center of the image. public function centerAndCrop( bitmapData :
BitmapData, cWidth : Number, cHeight : Number ) : BitmapData { if(cWidth >
bitmapData.width) cWidth = bitmapData.width; if(cHeight >
bitmapData.height) cHeight = bitmapData.height; if(cWidth < 1 ||
cHeight < 1) return bitmapData var translateMatrix :
Matrix = new Matrix(); var xOffset : Number
= -Math.abs((bitmapData.width - cWidth)/2); var yOffset : Number
= -Math.abs((bitmapData.height - cHeight)/2); translateMatrix.identity(); translateMatrix.translate(xOffset,
yOffset); var returnBitmapData
: BitmapData = new BitmapData(cWidth, cHeight, true); returnBitmapData.draw(bitmapData,
translateMatrix); return
returnBitmapData; } Hope that helps. -Andy _____________________________________ Andrew Trice Cynergy Systems, Inc. Blog: http://www.cynergysystems.com/blogs/page/andrewtrice Email: [EMAIL PROTECTED] Office: 866-CYNERGY From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of learner hello ,
-- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___ |