flex project convert img to base64 code for canvas