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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-02-2011, 03:36 AM   #1 (permalink)
iOS padawan
 
Hakimo's Avatar
 
Join Date: Apr 2011
Posts: 12
Hakimo is on a distinguished road
Default Getting Image on UIImageView

Hi, I'm currently making an app where the user takes a photo or select it from an album, then an overlay is placed over the image. The user can then scale, rotate and save the image.

For now, I have 2 xib files. The first one has thumbnails for overlay pictures to choose from. Clicking on on of them goes to another xib file where I have 2 UIImageViews. One for the overlay and one for the camera. Previously I just used interface builder to set an image at the attributes. But if have 20 overlays, it means I have to use 20 xibs. So I thought the best way is to add pictures through code so I can use this 2nd xib as a template for the overlays. Here's when I'm stuck. When I click on a thumbnail in the 1st xib file, how do tell the 2nd xib file to store an overlay in the UIImageView?

For the camera, I'm using
Code:
imageView.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
and it works fine. I can even save it to the album. I thought I could use the code below for the overlays but that didn't work.
Code:
UIImage *image = [UIImage imageNamed: @"char1.png"];
Hope someone can help. Thanks very much.

- Hakimo
__________________
www.hakimo-studio.com
www.lcgdi.com
"Learn and Play"
Facebook | Twitter
Our Apps : Pocket Ipin

Last edited by Hakimo; 06-02-2011 at 04:26 AM.
Hakimo is offline   Reply With Quote
Old 06-02-2011, 04:29 AM   #2 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

this will work only if char1.png is an image in your resources
Code:
UIImage *image = [UIImage imageNamed: @"char1.png"];
where are the images that you want to show?
__________________
dany_dev is offline   Reply With Quote
Old 06-02-2011, 11:30 PM   #3 (permalink)
iOS padawan
 
Hakimo's Avatar
 
Join Date: Apr 2011
Posts: 12
Hakimo is on a distinguished road
Default

Hi Dany_dev,

Yea the images are in the resources folder. I thought it would work too I must be doing something wrong with the logic. I have a button on the 1st xib and an UIimageview in the 2nd xib. How do I tell the 2nd xib to load an image after pressing a button on the 1st one?

Just in case I haven't mention this properly. I have two UIImageViews overlapping on the 2nd xib. One is for an overlay and the other is for the camera. For some reason the camera works since I'm using "UIImagePickerControllerOriginalImage" but I can't load the overlay

Thanks very much in advance.

- Hakimo
__________________
www.hakimo-studio.com
www.lcgdi.com
"Learn and Play"
Facebook | Twitter
Our Apps : Pocket Ipin
Hakimo is offline   Reply With Quote
Reply

Bookmarks

Tags
uiimageview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 333
5 members and 328 guests
Dnnake, iOS.Lover, jenniead38, pbart, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,663
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, LezB44
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:17 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0