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 04-28-2009, 08:02 PM   #1 (permalink)
Vishal
 
Join Date: Feb 2009
Location: Pune, India
Posts: 76
vishal is on a distinguished road
Default How to create duplicate copy of UIImage

Hi,

I am very new to iPhone SDK, so this might be very foolish question.

How to create duplicate copy of the UIImage. I am having the imageRef and creating one image from it. I want to create duplicate copy of that image. But my application is crashing while accessing the duplicate copy.

Is he creates the reference to the image when tried to create new image from same imageRef?

Is there any API to copy UIImage.

Vishal N
vishal is offline   Reply With Quote
Old 05-30-2009, 11:40 AM   #2 (permalink)
New Member
 
Join Date: May 2009
Posts: 1
anthony@abate.net is on a distinguished road
Default

Try this...

// Get the Core Graphics Reference to the Image
CGImageRef cgImage = [image CGImage];

// Make a new image from the CG Reference
UIImage *copyOfImage = [[UIImage alloc] initWithCGImage:cgImage];

... do stuff ...

// Dont forget to release your allocs when you're done with them!

[image release];
[copyOfImage release];
anthony@abate.net is offline   Reply With Quote
Old 08-23-2011, 10:13 AM   #3 (permalink)
Registered Member
 
Join Date: Mar 2011
Posts: 3
ort11 is on a distinguished road
Default Not a deep copy

Fyi, not an expert, but this does not seem to make a deep copy of the image.
ort11 is offline   Reply With Quote
Old 08-23-2011, 10:16 AM   #4 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

i hope that after 2 years he solved himself....

However it is another object with the same image....so basically it is a copy.
__________________
dany_dev is offline   Reply With Quote
Reply

Bookmarks

Tags
uiimage

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: 310
7 members and 303 guests
blueorb, givensur, guusleijsten, jbro, mer10, n00b, SLIC
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,113
Posts: 402,880
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

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