Nigel Barber @mindbrix
scalable assets
BITMAPS ARE FROM MARS       Vectors are from Venus  • Smoother work flow  • Efficiency  • Save time  • Future proof
Vectors, vectors, everywhere  • Fonts    • Character Viewer    • Apple Symbols (glyph variants)  • The web    • thenounpro...
A sample work ow • Create in Illustrator   • Renderer is not Quartz • Save a copy as EPS   • Edge to edge   • Huge files (©...
Rendering • iOS - UIImage+PDF  • https://github.com/mindbrix/UIImage-PDF  •   +(UIImage   *)   imageWithPDFNamed:(NSString...
One PDF, many sizes...
One PDF, many sizes
Nigel Barber @mindbrix
#indieApps
Upcoming SlideShare
Loading in …5
×

Scalable Assets Presentation

2,139 views

Published on

These are the slides for a presentation I gave on creating vector scalable assets for iOS apps.

The accompanying code is at https://github.com/mindbrix/UIImage-PDF

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,139
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
9
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Scalable Assets Presentation

  1. 1. Nigel Barber @mindbrix
  2. 2. scalable assets
  3. 3. BITMAPS ARE FROM MARS Vectors are from Venus • Smoother work flow • Efficiency • Save time • Future proof
  4. 4. Vectors, vectors, everywhere • Fonts • Character Viewer • Apple Symbols (glyph variants) • The web • thenounproject.com • Google: filetype:eps • Your pencil • straight edge and compass
  5. 5. A sample work ow • Create in Illustrator • Renderer is not Quartz • Save a copy as EPS • Edge to edge • Huge files (© Adobe) • Convert to PDF • Preview does use Quartz • Small files (e.g. 400K → 8K ≈ 50x less)
  6. 6. Rendering • iOS - UIImage+PDF • https://github.com/mindbrix/UIImage-PDF • +(UIImage *) imageWithPDFNamed:(NSString *)resourceName atSize:(CGSize)size; • +(UIImage *) imageWithPDFNamed:(NSString *)resourceName atWidth:(CGFloat)width; • +(UIImage *) imageWithPDFNamed:(NSString *)resourceName atHeight:(CGFloat)height; • +(UIImage *) originalSizeImageWithPDFNamed:(NSString *)resourceName; • OS X -(NSImage *)pdfImageNamed:(NSString *)name atWidth:(float)width { NSString *pdfPath = [[ NSBundle mainBundle ] pathForResource:name ofType:@"pdf" ]; NSPDFImageRep *pdfRep = [ NSPDFImageRep imageRepWithContentsOfFile: pdfPath ]; float pdfAspect = pdfRep.bounds.size.width / pdfRep.bounds.size.height; NSImage *pdfImage = [[[ NSImage alloc ] init ] autorelease ]; pdfImage.scalesWhenResized = YES; pdfImage.size = NSMakeSize( width, width / pdfAspect ); [ pdfImage addRepresentation: pdfRep ]; return pdfImage; }
  7. 7. One PDF, many sizes...
  8. 8. One PDF, many sizes
  9. 9. Nigel Barber @mindbrix
  10. 10. #indieApps

×