Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Take Picture then Add Overlay

Does anyone know how I would go about taking an image with the iPhone camera (or using one from the device) and then overylaying some information (semi-transparent background + some text) and then save the new image to the device?

I have seen this done in other apps, but wasn't sure how to go about it with Titanium.

I have looked at kitchen sink, and there is an overlay example you can add to the camera view, but that doesn't get saved over the image, it's just a frame during taking the picture.

Any help or direction on this would be appreciated.

— asked August 6th 2010 by Randy Hall
  • camera
  • caption
  • image
  • iphone
  • overlay
  • photo
  • picture
  • watermark

3 Answers

  • "toImage()" is your friend : you can get a copy of each view with this method… Create a view with your image, add your text, and save it with "view.toImage()"

    — answered August 10th 2010 by Joel Bohrer
    1 Comment
    • Thanks, Joel. I will give this a try. I had no idea toImage() existed. Sounds like it might do exactly what I need.

      — commented August 10th 2010 by Randy Hall
  • Perhaps you can try opening the camera in one view, and then your own label/stuff in another view attached to the camera view (and with a higher z-index). Tried that?

    — answered August 7th 2010 by Clifton Labrum
    1 Comment
    • But, how would I capture that merged image? It's basically a screenshot?

      — commented August 7th 2010 by Randy Hall
  • Ive tried with view.toImage() and works great!!!

    — answered January 16th 2012 by Adrian Gomez
    • could you provide the code please ?
      I cant find any examples of this function and Im really looking into using it.
      thaks in advance

      — commented February 15th 2012 by Julien Gattegno
    • Yes pleaze .. I need the same function. I need an example.


      — commented July 23rd 2013 by Franck Neuer
    • Yes please, I'm just doing the same

      — commented June 5th 2014 by Edgar Hernández
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.