Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB
My Carrier: Sprint
Accepted Solution

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.

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Developer
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Sharing a generated image

I had a discussion with Phil about just this subject last week in Amsterdam

 

We eventually worked out that the only way to do it was the messy workaround as it currently stands

 

See here for the other way round method (works with uploads too)

 

Our conclusion was that the only viable method was doing the work on a server at present

 

It's a bit of a hack but has all the possibilities of working

 

You can Base64 stuff easy enough on the device but you need to get at the raw data (that's the issue)




Click the like button if you find my posts useful!
Developer
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB
My Carrier: Sprint

Re: Sharing a generated image

I managed to do it by creating a HTML5 Canvas, saving the image to a designated location/filename and then using that saved image through the sharing framework. Works like a charm!

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Developer
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Re: Sharing a generated image

Yes I had the same issue. In one case I'm sending the Base64 to some PHP with Ajax then downloading the file generated with PHP to file system and then using the saved file to set wallpaper.

@Marco could you share the bit of code where you save the Base64 directly to the file system? Would be a huge help!
_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Highlighted
Developer
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB
My Carrier: Sprint

Re: Sharing a generated image

New Developer
Posts: 8
Registered: ‎11-18-2014
My Device: BB Z10
My Carrier: test

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..