 |
 |
|
 |
01-21-2009, 04:11 PM
|
#1 (permalink)
|
|
Physique Architect
Join Date: Jan 2009
Location: Washougal, WA
Posts: 8
|
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
|
|
|
01-21-2009, 04:38 PM
|
#2 (permalink)
|
|
Large Member
Join Date: Aug 2008
Location: London/Peterborough
Posts: 411
|
Clipping
Have you looked at clipping properties in interface builder?
|
|
|
01-21-2009, 05:10 PM
|
#3 (permalink)
|
|
Physique Architect
Join Date: Jan 2009
Location: Washougal, WA
Posts: 8
|
Quote:
Originally Posted by QuantumDoja
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
|
|
|
01-26-2009, 03:16 PM
|
#4 (permalink)
|
|
Physique Architect
Join Date: Jan 2009
Location: Washougal, WA
Posts: 8
|
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
|
|
|
01-26-2009, 06:59 PM
|
#5 (permalink)
|
|
Registered Member
Join Date: Dec 2008
Posts: 429
|
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...
|
|
|
01-27-2009, 11:48 AM
|
#6 (permalink)
|
|
Physique Architect
Join Date: Jan 2009
Location: Washougal, WA
Posts: 8
|
Quote:
Originally Posted by lbendlin
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
|
|
|
01-27-2009, 11:57 AM
|
#7 (permalink)
|
|
Registered Member
Join Date: Dec 2008
Posts: 429
|
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» Advertisements |
» Online Users: 420 |
| 37 members and 383 guests |
| AdamSubach, aderrington, benoitr007, bensj, BrianSlick, Danneman, dev123, ErichGS, futurevilla216, GreatWizard, gustavo7sexton, gw1921, HemiMG, HowEver, iSDK, Jeremy1026, joelhull, lifeCoder45, mattiahalter, melodizzzy, mriphoneman, newchucky, Ovidius, Piequanna, pofak, qilin, Racker, rendezvouscp, riq, Sega dude, socals, timle8n1, Whitehk, ZunePod |
| Most users ever online was 965, 06-30-2010 at 04:26 AM. |
» Stats |
Members: 41,862
Threads: 49,770
Posts: 213,057
Top Poster: BrianSlick (3,139)
|
| Welcome to our newest member, futurevilla216 |
|