Grab screen capture, how they do it ?
Grab screen capture, how they do it ?
- Subject: Grab screen capture, how they do it ?
- From: Bertrand Mansion <email@hidden>
- Date: Sat, 02 Nov 2002 22:19:10 +0100
Hi,
I am trying to have a transparent window where a user could draw on top of
it just like it is done in the 'Grab' application in selection mode. This
mode allows for drawing a rectangle of selection.
My problem is that when I set my window transparent, all clicks go through
just as if this window doesn't exist. But if I set it to, let's say,
whiteColor and alphaValue 0.1, the window is here and is clickable. But now
the problem is that every elements drawn can hardly be seen because of the
low alphaValue.
So, I am wondering how this is done in Grab. Do you think the app takes
screenshots on very short intervals and uses this image in a view so that
the user feels like she is really seeing the finder behind ?
Or are there any special parameters to set in the window object ?
Here is the code I use currently:
- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)aStyle
backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag
{
screenRect = [[NSScreen mainScreen] frame];
NSWindow* theWindow = [super initWithContentRect:screenRect
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO];
[theWindow setBackgroundColor: [NSColor lightGrayColor]];
[theWindow setOpaque:NO];
[theWindow setAlphaValue:0.5];
[theWindow setHasShadow: NO];
[theWindow makeKeyAndOrderFront:self];
return theWindow;
}
TIA,
Bertrand Mansion
Mamasam
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.