6 responses

  1. Hugo
    2012-06-07

    Hi Jeroen,

    What kind of license is your code under? I’d like to use a few pieces of it in some code of mine. But instead of drawing something on the face, I want to cut out the face and center it in a box. Since your AV setup is pretty good I’d love to use that.

    Reply

    • Jeroen Trappers
      2012-06-17

      MIT Licence. By the way. Most of the code you see here is based on the Apple Sample. So take into account that Licence.
      http://jtr.mit-license.org/

      Reply

  2. Manoel Costa
    2012-07-05

    I’m trying to save the current view as an image with this code:

    if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
    if ([[UIScreen mainScreen] scale] == 2.0) {
    UIGraphicsBeginImageContextWithOptions(self.previewView.bounds.size, YES, 2.0);
    } else {
    UIGraphicsBeginImageContext(self.previewView.bounds.size);
    }
    } else {
    UIGraphicsBeginImageContext(self.previewView.bounds.size);
    }

    [self.previewView.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    UIImageWriteToSavedPhotosAlbum(viewImage, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
    I just want to save a image of the whole thing that is displaying on the screen, the “live camera” plus the overlay image.

    But with this code, I’m getting a completely black image as output.

    Can you help me with this? Thank you so much 🙂

    Reply

    • Jeroen Trappers
      2012-07-06

      You should have a look a the original Apple Sample “SquareCam”. It shows how to save the image to the camera roll.

      Reply

  3. Manoel Costa
    2012-07-05

    Commenting again just to turn on the Notify me of follow-up comments by email…. option 🙂 THanks

    Reply

  4. sverre
    2013-02-28

    Cool thanks, I can use this… Have been playing around with putting “stuff” in face just like you, recently. I am planning to use SVGKit ( https://github.com/SVGKit/SVGKit ) to add a vector mask mask (no pun intended), instead of using raster graphics that could look bad when scaled. Just an idea.

    Reply

Leave a Reply

Back to top
mobile desktop