Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-15-2009, 11:17 AM   #14 (permalink)
shadyrip
Registered Member
 
Join Date: Apr 2009
Posts: 8
shadyrip is on a distinguished road
Default

Quote:
Originally Posted by DenVog View Post
I've been doing pretty much everything I can in IB, so I guess I'll have to learn something new on top of the new thing I'm already trying to learn.

I found a couple different ways to add an image on top of the picker. Not sure if one is more correct or efficient than the other.
Code:
UIImageView *cameraOverlay = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"overlay-image.png"]];
[picker.view sendSubviewToBack:cameraOverlay];
[cameraOverlay release];
This one does allow precise positioning of the image:
Code:
// x-coordinate, y-coordinate, width, height
CGRect cameraOverlayRect = CGRectMake(160,240,47,47);
UIImageView *cameraOverlay = [[UIImageView alloc] initWithFrame:cameraOverlayRect];
[cameraOverlay setImage:[UIImage imageNamed:@"overlay-image.png"]];
// supposed to enhance performance by explicitly stating opaque
cameraOverlay.opaque = YES;
[picker.view addSubview:cameraOverlay];
// Tells it to bring the subview to top of view layers, but don't think it's needed
[picker.view bringSubviewToFront:cameraOverlay];
[cameraOverlay release];
Now on to step 2. Any examples or pointers are appreciated.
First of all, this code helped me a lot understanding what I want to thank you.

I wonder if u guys can give me a hint to modify this sample code for my app needs.

Instead of assigning directly an image in addition to the camera I want to add programatically and image from an existing imageView. Is that clear enough to understand my point ?

It's in this line I guess I need to change something : initWithImage:[UIImage imageNamed:@"overlay-image.png"]];
shadyrip is offline   Reply With Quote
 

» Advertisements
» Online Users: 395
15 members and 380 guests
7twenty7, baja_yu, buggen, BumChinBooth, ChrisYates, dylanreich, evilmatt10, givensur, MarkC, Mnashmi, networ, QuantumDoja, teebee74, TheStalker, za1407
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,636
Threads: 94,101
Posts: 402,818
Top Poster: BrianSlick (7,990)
Welcome to our newest member, samdanielblr
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:33 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.