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 11-06-2010, 08:10 AM   #1 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 19
sripriya_222 is on a distinguished road
Default How to incline UIImageView in Iphone

Hi, I have displayed a series of images in a coverflow effect.

But, now i want them in an inclined format, so that they have to appear as ray emerging from a point.

Can anyone please give me any suggestions, or any samples regarding my query.

Thanks in advance.
sripriya_222 is offline   Reply With Quote
Old 11-06-2010, 09:20 AM   #2 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by sripriya_222 View Post
Hi, I have displayed a series of images in a coverflow effect.

But, now i want them in an inclined format, so that they have to appear as ray emerging from a point.

Can anyone please give me any suggestions, or any samples regarding my query.

Thanks in advance.
You need to be more specific about what you want to do.

Do you want the images to follow a straight line, or an arc? Do you want them to start out small (point-sized) and grow as you progress from the starting point to the end point? Do you want them evenly spaced or grouped more closely at the origin and wider at the end point?

Are you looking for the images to animate automatically, or do you want the user to be able to slide with his/her finger to make the images animate? What should happen when you get to the end of the list of images? Should it circle back to the beginning again, or stop?

There are a lot of details to think through, and those details will drive your design and implementation.

It seems to me that if you already implemented a cover flow effect, you should be able to adapt the animation code you wrote to give you a ray effect. There are a number of similarities.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 11-08-2010, 12:32 AM   #3 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 19
sripriya_222 is on a distinguished road
Default

Hi Duncan,
Thank you for your response and suggestions.

I want the user to be able to slide with his/her finger to make the images animate.When it reaches end i want to stop.

I have added an sample image attachment, so that you can have an idea what i am asking. Please kindly suggest me on it.


wall2v2-Nov2010 copy 2.jpg
sripriya_222 is offline   Reply With Quote
Old 11-08-2010, 05:07 AM   #4 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by sripriya_222 View Post
Hi Duncan,
Thank you for your response and suggestions.

I want the user to be able to slide with his/her finger to make the images animate.When it reaches end i want to stop.

I have added an sample image attachment, so that you can have an idea what i am asking. Please kindly suggest me on it.


Attachment 2448
I can't see your image.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 11-08-2010, 05:13 AM   #5 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 19
sripriya_222 is on a distinguished road
Default

Quote:
Originally Posted by Duncan C View Post
I can't see your image.
i had uploaded again..
wall2v2-Nov2010 copy 2.jpg
sripriya_222 is offline   Reply With Quote
Old 11-08-2010, 05:19 AM   #6 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by sripriya_222 View Post
i had uploaded again..
Attachment 2450
Still can't see it.

In any case, I haven't done what you describe, so I would have to do a bunch of reading and design something.

If you are willing to target iOS 3.2 or greater, using gesture recognizers (UIGestureRecognizer) to handle touches is probably the way to go.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 11-08-2010, 05:22 AM   #7 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 19
sripriya_222 is on a distinguished road
Default

Quote:
Originally Posted by sripriya_222 View Post
i had uploaded again..
Attachment 2450
Duncan, u can see the image in the following link.

How to incline UIImageView in Iphone - Stack Overflow
sripriya_222 is offline   Reply With Quote
Old 11-08-2010, 08:19 AM   #8 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by sripriya_222 View Post
Duncan, u can see the image in the following link.

How to incline UIImageView in Iphone - Stack Overflow
Ok,

I can see it at the external link.

Here's a quick-and-dirty way to get that look, off the top of my head.

Create an image in Photoshop that's the full size of the screen, with the background you want and the "ray" as transparent pixels. Save that as a PNG with alpha. Let's call this the "ray mask", because it will mask everything but the ray of images.

Add the ray image to your view controller.

Then, in code, create UIImageView objects for each of the images you want in your ray.

Add each image in your ray using the insertSubview:belowSubview: method, and place the images below the ray mask image so they get clipped by the ray mask.

You'll need to write code that changes the transform on your image views so they are smaller at the beginning of the ray and bigger at the end. Look at the function CGAffineTransformMakeScale. You can change the center property of each image to make it move along the ray.

I'd suggest creating a float imagePosition that would be zero when the object is at the beginning of the ray and 1 when it is at the end position. You can use that value directly in your call to CGAffineTransformMakeScale to set the transform of your objects. You'll need to write code that calculates center points based on that value. Something like this:

Code:
CGFloat start_x, start_y, end_x, end_y, delta_x, delta_y;

//First, set the starting and ending points to the correct x/y 
//values for the start/end of your ray.

delta_x = end_x - start_x;
delta_y = end_y - start_y;

CGPoint imageCenter;
image_center.x = start_x + delta_x * imagePosition;
image_center.y = start_y + delta_y * imagePosition;
an_image.center = image_center;

CGAffineTransform image_transform = CGAffineTransformMakeScale(imagePosition, imagePosition);
an_image.transform = image_transform;
Obviously, the above not fully fleshed out. You'll need to manage a whole array of images rather than just one, and write logic that figures out how many images to place on the ray at once, and how to space them out along the ray. The code I posted should at least get your started.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 11-08-2010, 11:05 PM   #9 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 19
sripriya_222 is on a distinguished road
Default

Quote:
Originally Posted by Duncan C View Post
Ok,

I can see it at the external link.

Here's a quick-and-dirty way to get that look, off the top of my head.

Create an image in Photoshop that's the full size of the screen, with the background you want and the "ray" as transparent pixels. Save that as a PNG with alpha. Let's call this the "ray mask", because it will mask everything but the ray of images.

Add the ray image to your view controller.

Then, in code, create UIImageView objects for each of the images you want in your ray.

Add each image in your ray using the insertSubview:belowSubview: method, and place the images below the ray mask image so they get clipped by the ray mask.

You'll need to write code that changes the transform on your image views so they are smaller at the beginning of the ray and bigger at the end. Look at the function CGAffineTransformMakeScale. You can change the center property of each image to make it move along the ray.

I'd suggest creating a float imagePosition that would be zero when the object is at the beginning of the ray and 1 when it is at the end position. You can use that value directly in your call to CGAffineTransformMakeScale to set the transform of your objects. You'll need to write code that calculates center points based on that value. Something like this:

Code:
CGFloat start_x, start_y, end_x, end_y, delta_x, delta_y;

//First, set the starting and ending points to the correct x/y 
//values for the start/end of your ray.

delta_x = end_x - start_x;
delta_y = end_y - start_y;

CGPoint imageCenter;
image_center.x = start_x + delta_x * imagePosition;
image_center.y = start_y + delta_y * imagePosition;
an_image.center = image_center;

CGAffineTransform image_transform = CGAffineTransformMakeScale(imagePosition, imagePosition);
an_image.transform = image_transform;
Obviously, the above not fully fleshed out. You'll need to manage a whole array of images rather than just one, and write logic that figures out how many images to place on the ray at once, and how to space them out along the ray. The code I posted should at least get your started.
Thank you, Duncan,
I will try in the way you said.
Can you tell me how to display image in parallelogram shape?

Last edited by sripriya_222; 11-09-2010 at 02:19 AM.
sripriya_222 is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone, uiimageview, uiscrollview

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: 349
10 members and 339 guests
7twenty7, chiataytuday, condor304, Creativ, Domele, dreamdash3, laureix68, LEARN2MAKE, mistergreen2011, Paul Slocum
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,660
Threads: 94,119
Posts: 402,896
Top Poster: BrianSlick (7,990)
Welcome to our newest member, laureix68
Powered by vBadvanced CMPS v3.1.0

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