Tampilkan postingan dengan label Core Graphics. Tampilkan semua postingan
Tampilkan postingan dengan label Core Graphics. Tampilkan semua postingan

Jumat, 21 Mei 2010

Gradient Buttons Yet Again

I added two more button styles to the iPhone Gradient Buttons project and made stroke color and stroke weight configurable options. The two new styles look exactly like the old Black and White style, only the highlight state is a blue gradient. These simulate the style used in alert sheets in several Apple applications.

Screen shot 2010-05-21 at 4.29.17 PM.png

Some of the Core Graphics code was machine-generated and is in kind of rough shape, but it works. I'm thinking about refactoring the different styles methods into something shorter, perhaps a plist, or just C arrays with the different numeric values.

For some strange reason, when I try to use arrayWithObjects: instead of creating a mutable array and manually adding the colors one at a time, I get a NULL gradient back. I have no idea why, but it's working this way at least.

Anyone who wants to contribute, let me know, I'd be happy to add committers.

Rabu, 23 September 2009

Opacity - Export as Source Code

Okay, I don't ordinarily repost items covered by Daring Fireball since most of you probably read it anyway, but this one's just too cool and too relevant not to include. The vector art program Opacity now has the ability to export your graphic as source code, presumably as CoreGraphics calls that you can use in your Mac and iPhone applications.

Now, in most cases, you don't want resources contained in code - you should just store the graphic file as a resource in your application's bundle - but there are times when this would be hugely helpful, like when you want to animate the vector art, or when the specific appearance of the image depends on values only available at runtime.

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Lady Gaga, Salman Khan