Hello I have an NSGradient which I had hoped to drawin to the rect using the following code:
[g drawInRect:[self bounds] angle:90];
However the issue is to get the PDF data using the below produces a black color rather than the gradient.
[myView dataWithPDFInsideRect:myView.bounds];
My solution currently is to create an NSImage from the gradient drawn on a rect – and draw the image – but obviously the performance of drawing this is bad – especially when changing colours.
I am trying to use the gradient as a background which you can change the colors with objects drawn on top.
Is there a better way to draw a gradient which works with dataWithPDFInsideRect?
I’m sure there musy be an efficient way but i’m obviously looking in the wrong direction!