That works! Cheers!
Now I am having fun with images made up from data from drawn NSViews. The only problem is that I get a black background for my images and cannot get rid of it
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
- (void)drawRect
NSRect)rect
{
NSRect xrect;
NSBezierPath* path;
[[NSColor clearColor] set];
path = [NSBezierPath bezierPathWithRect:rect];
[path fill];
xrect = NSMakeRect(<font color = blue>10</font>,<font color = blue>10</font>,<font color = blue>10</font>,<font color = blue>10</font>);
[[NSColor redColor] set];
NSRectFill(xrect);
}
-(NSImage*)imageData
{
return [[NSImage alloc] initWithData:[self dataWithPDFInsideRect:[self bounds]]];
}
</font>[/code]
in my back view and
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
backView = [[WSBackView alloc] initWithFrame:aRect];
image = [backView imageData];
[image compositeToPoint:NSMakePoint(<font color = blue>0</font>,<font color = blue>0</font>) operation:NSCompositeSourceOver];
</font>[/code]
in the drawRect of my visible view. I am stuck with a black background..
Any Ideas?
Jon.