Sharing a generated image

I would like to create a feature that allows people to share an image on Facebook/Twitter etc. However I want this image to be one that I generated in-app. So probably some base64 encoded kind of thing. I'm planning to generate the image through HTML5 canvas. I want users to be able to share the generated image without it having been saved to the photo library.

Is this possible? If so, how would I do this? I've browsed some docs but didn't find this scenario.

Re: Sharing a generated image

I have also saved the image with the help of HTML5 canvas. And i want to share that image to my social sharing apps installed in my BB device. i have tried so many invocation codes but all are not working. Please share your sample code..