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-29-2010, 04:12 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 2
jndeveloper is on a distinguished road
Question UIImageView Resized by user?

In my application the user must be able to change the size of a UIImageView via a UISlider (sliding to the left makes it smaller, sliding it to the right makes it larger). Is this possible? If so, knowledge of sample code would be most helpful. If a UISlider is not possible, I am open to any other method.

Thank you.
jndeveloper is offline   Reply With Quote
Old 07-02-2010, 04:32 AM   #2 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 43
ashishjraval is on a distinguished road
Thumbs up

Quote:
Originally Posted by jndeveloper View Post
In my application the user must be able to change the size of a UIImageView via a UISlider (sliding to the left makes it smaller, sliding it to the right makes it larger). Is this possible? If so, knowledge of sample code would be most helpful. If a UISlider is not possible, I am open to any other method.

Thank you.
ya it is possible with slider.
In your slider IB action you just add this code

Quote:
CGFloat newValue = slider.value;
translation = CGAffineTransformMakeScale(newValue, newValue) ;


transformation = CGAffineTransformConcat(scale, rotate);

Finaltransformation = CGAffineTransformConcat(transformation, translation);
myimg.transform = Finaltransformation;

Last edited by ashishjraval; 07-02-2010 at 04:36 AM.
ashishjraval is offline   Reply With Quote
Old 07-02-2010, 04:36 AM   #3 (permalink)
almostfunnydev
iPhone Dev SDK Supporter
 
rocotilos's Avatar
 
Join Date: Oct 2009
Age: 34
Posts: 3,015
rocotilos is on a distinguished road
Default

set the image property to ScaleToFit.

then

myImage.frame = CGRectMake(160,240,myImage.frame.size.width*mySlid er.value,myImage.frame.size.height*mySlider.value) ;

slider value maybe u can adjust so that it is 1 in the middle. so 1 is the initial size. minimum maybe 0.5 and max is 1.5.

try that.

(or what ashishjraval posted is good too)

Last edited by rocotilos; 07-02-2010 at 04:39 AM.
rocotilos is offline   Reply With Quote
Reply

Bookmarks

Tags
resize, scale, uiimageview, uislider, user

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: 327
7 members and 320 guests
anothermine, Chickenrig, Domele, givensur, michaelhansen, PixelInteractive, Sloshmonster
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,892
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

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