How to make an iPhone button fill

I would like to use some of the custom controls that I use and thought some attractive fills should do the job (maybe part). Like padding on the background of iPhone buttons or Office 2007 ribbon (you may know a few more).

Edit: To clarify things, I don't need a simple gradient fill - there is a Windows API call for that. I'm more interested in how the whole effect is achieved. Here is a link to an article that shows how to do it in PhotoShop, but I want to do it in code.

In particular, the glossy gradient at the top ends in a curve around the middle of the button. I suppose this would need to be done separately and mixed in some way.

Any ideas?

+2


source to share


4 answers


The "glass" effect is obtained simply by creating a white ellipse about 4 times the tall one, placing it over the image so that it is "glazed" so that the bottom arc is centered on the image, and then alpha blending. I believe this delphi code example will be helpful in doing the final part.



+4


source


You are talking about gradient fills. You can get some code examples here to get started - search this page for "gradient" to find related sections.



+3


source


You can try http://www.tmssoftware.com/site/advsmoothbutton.asp . As far as I know, this control is included in the free Smooth Controls package since D2009. For other Delphi versions, you can buy the TAdvSmoothButton control itself or as part of a control pack.

+2


source


The easiest way to do this is perhaps by assembling images based on the size of the button. Create a base image and resize some layers on top of it, instead of trying to handle a complex gradient.

+1


source







All Articles