Get Updates By E-mail 

Article Written By:
Johann Dowa

How To Draw Objects With Holes Using CoreGraphics

  •  
  •  
  •  
  •  
  •  

Sometimes you will want to draw a more complex shape in an app that doesn’t use OpenGL, and you don’t want to load in the graphics from a file, and this can be done using CoreGraphics.

A situation that can arise is the drawing of one shape within another shape. The easiest way to do this is simply to draw the shape on top of the other shape, but this typically will not give the most efficient performance.

Also, there could be a situation when you want the user to see the background through the shape that you are drawing, and if that background is changing simply drawing shapes over top of each other isn’t going to cut it.

For those situations Matt Gallagher from Cocoa With Love has created a tutorial explaining 5 different techniques for drawing a shape with a hole in core graphics.

For more information on CoreGraphics check out our Resources for Learning Core Graphics and review of  the Core Animation Simplified book.

Please Click Here To Share This Article With Others By Re-Tweeting It.

[Source: Cocoa With Love]


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments