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

sdkIQ for iPhone
($4.99)

Your First iPhone App
($1.99)

iPhone Code Generator
($9.99)

Dual Matches
($0.99)

Calcuccino Programmers' Calculator
($2.99)

SDKtoday
(free)

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 01-21-2009, 04:11 PM   #1 (permalink)
Physique Architect
 
raggeddesign's Avatar
 
Join Date: Jan 2009
Location: Washougal, WA
Posts: 8
Default Portion of Image as Button Background

Hi,

I want the background image of a UIButton to only be a portion of a larger image. So if I had a large image, I want to specify ONLY the right corner 125x125 as the button image background (as an example) I will need to be able to specify the section of the image I want to use as the button background since it will change.

Does that make sense? Do you know how to do that?
__________________
Freaky hybrid of Metal Head and Computer Nerd
raggeddesign is offline   Reply With Quote
Old 01-21-2009, 04:38 PM   #2 (permalink)
Large Member
 
Join Date: Aug 2008
Location: London/Peterborough
Posts: 411
Default Clipping

Have you looked at clipping properties in interface builder?
QuantumDoja is offline   Reply With Quote
Old 01-21-2009, 05:10 PM   #3 (permalink)
Physique Architect
 
raggeddesign's Avatar
 
Join Date: Jan 2009
Location: Washougal, WA
Posts: 8
Default

Quote:
Originally Posted by QuantumDoja View Post
Have you looked at clipping properties in interface builder?
Clipping? Not sure where that is, I see a 'clip subviews' setting. Either way,
I would need to do this through code since the image may come from the users images.

Would you know how to specify the same request for a UIImageView? Having the imageView only show a specified portion of a larger image?

I'll do some searching on clipping and see if I can turn something up, any additional info would be very helpful!

Thanks.
__________________
Freaky hybrid of Metal Head and Computer Nerd
raggeddesign is offline   Reply With Quote
Old 01-26-2009, 03:16 PM   #4 (permalink)
Physique Architect
 
raggeddesign's Avatar
 
Join Date: Jan 2009
Location: Washougal, WA
Posts: 8
Default

bump....

Still looking for solution to this issue. I've been researching CGImage but its all still very new to me, not sure where to even look.

Anyone have ANY suggestions?
__________________
Freaky hybrid of Metal Head and Computer Nerd
raggeddesign is offline   Reply With Quote
Old 01-26-2009, 06:59 PM   #5 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 429
Default

Yes,CG is the way to go. Load the image into a CG context, transform as needed and then load the result into the button. There is even code for rounded corners...
lbendlin is offline   Reply With Quote
Old 01-27-2009, 11:48 AM   #6 (permalink)
Physique Architect
 
raggeddesign's Avatar
 
Join Date: Jan 2009
Location: Washougal, WA
Posts: 8
Default

Quote:
Originally Posted by lbendlin View Post
Yes,CG is the way to go. Load the image into a CG context, transform as needed and then load the result into the button. There is even code for rounded corners...
Thanks for pointing me in the right direction! Do you know of any good tutorials/resources to do any of the above things?
__________________
Freaky hybrid of Metal Head and Computer Nerd
raggeddesign is offline   Reply With Quote
Old 01-27-2009, 11:57 AM   #7 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 429
Default

this one helped me get starting
iPhone development - UIImage with round corners
lbendlin is offline   Reply With Quote
Reply

Bookmarks

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
» Stats
Members: 41,862
Threads: 49,770
Posts: 213,057
Top Poster: BrianSlick (3,139)
Welcome to our newest member, futurevilla216
Powered by vBadvanced CMPS v3.1.0

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