1
votes

Here is the UI Mock up: enter image description here

The blue background is the screen, and the red is a NSWindow, and I would like to build a NSView? (Yellow) that is on top of the NSWindow. The NSView is basically transparent, so that it can shows the live information behind the red NSWindow. What is the best way to implement the NSView? Any suggestions? Thanks.

***One more remarks, the Yellow view is not only need to transparent, but also need to use for analysis. So, if I can get the raw data or transfer it to NSImage will be great.

1
What do you mean by saying the view is "basically" transparent? Is it fully transparent, or does it have some visible content of its own?JWWalker
What I want to do is apply a filter on the yellow view, so that the user can drag the red window to see how's the filter effect doing on the user interface.DNB5brims

1 Answers

1
votes

My 2 cents. Let your view be an NSImageView. You can draw the background to be clear

- (void)drawRect:(NSRect)rect
{
    [[NSColor clearColor] set];
    NSRectFill(rect);
}


You could then convert whatever you draw in there into an image by using [NSBitmapImageRep initWithFocussedViewRect:]. Would something like that work?