tags:

views:

63

answers:

1

I am trying to make a custom selection box for an image view I created and I am trying to use strokeRect: from NSBezierPath but it always seems to be transparent. Called the method set to set the color the blackColor and then also tried using olorWithDeviceRed:green:blue:alpha: but no matter what I have tried the rectangle created always seems to be transparent. Is there a better method to use to draw an empty rectangle?

+1  A: 

Are you seeing the boundaries of your strokeRect:?

All +strokeRect: does is draw the outside edge defined by the rect. If you want to fill that rect as well you would need to call [NSBezierPath fillRect:rect]. In this case it will use the current fill color. Calling -set on a color sets the stroke and fill color but if you want to set it individually you'd call -setFill on your color object.

Ashley Clark