Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge with Master

  • Loading branch information...
commit 1f98889bd09e00a470a82fec4ecbbadd0795db01 2 parents 7b977ab + b31ebe9
Leonel Galan authored
View
6 ar-project.xcodeproj/project.pbxproj
@@ -141,9 +141,6 @@
DD0E2C1C157EC2B600F3AAF9 = {
isa = PBXGroup;
children = (
- CE7135EE159801B500ED347E /* ImageIO.framework */,
- CE7135EC1597FE3B00ED347E /* CoreMedia.framework */,
- CE7135E91597FE3000ED347E /* CoreVideo.framework */,
DD0E2C31157EC2B700F3AAF9 /* ar-project */,
DD0E2C2A157EC2B700F3AAF9 /* Frameworks */,
DD0E2C28157EC2B700F3AAF9 /* Products */,
@@ -161,6 +158,9 @@
DD0E2C2A157EC2B700F3AAF9 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ CE7135EE159801B500ED347E /* ImageIO.framework */,
+ CE7135EC1597FE3B00ED347E /* CoreMedia.framework */,
+ CE7135E91597FE3000ED347E /* CoreVideo.framework */,
DDD116FA1587C3F900490B53 /* MapKit.framework */,
DD847AD9157FD2C100855FEA /* CoreLocation.framework */,
DD0E2C6B157ECA1900F3AAF9 /* AVFoundation.framework */,
View
16 ar-project/ARViewController.m
@@ -113,7 +113,21 @@ -(IBAction)captureView:(id)sender
NSData *imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer];
UIImage *image = [[UIImage alloc] initWithData:imageData];
- _sharedPicture = image;
+ UIImage *overlay = imageView.image;
+
+ UIGraphicsBeginImageContext(image.size);
+
+ // Use existing opacity as is
+ [image drawInRect:CGRectMake(0,0,image.size.width,image.size.height)];
+
+ // Apply supplied opacity if applicable
+ [image drawInRect:CGRectMake(0,0,overlay.size.width,overlay.size.height) blendMode:kCGBlendModeNormal alpha:0.8];
+
+ UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
+
+ UIGraphicsEndImageContext();
+
+ _sharedPicture = newImage;
}];
[self showMessage];
}
Please sign in to comment.
Something went wrong with that request. Please try again.