Created
July 9, 2009 20:18
-
-
Save leandroo/143967 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Adobe Air/Flex - Transformando o componente Image em ByteArray para salvar como tipo BLOB no banco de dados */ | |
private function imageToByteArray(img:Image):ByteArray { | |
var bmd:BitmapData = new BitmapData(img.width, img.height, true); | |
bmd.draw(img); | |
var jpg:JPEGEncoder = new JPEGEncoder(); | |
return jpg.encode(bmd); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment