This repository has been archived by the owner on May 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tae Won Ha
committed
Oct 26, 2014
1 parent
d4c6d6a
commit 4a22e33
Showing
7 changed files
with
74 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Tae Won Ha — @hataewon | ||
* | ||
* http://taewon.de | ||
* http://qvacua.com | ||
* | ||
* See LICENSE | ||
*/ | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
|
||
@interface ProxyView : NSView | ||
|
||
- (IBAction)updateScreenshot:(id)sender; | ||
- (void)drawRect:(NSRect)dirtyRect; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Tae Won Ha — @hataewon | ||
* | ||
* http://taewon.de | ||
* http://qvacua.com | ||
* | ||
* See LICENSE | ||
*/ | ||
|
||
#import "ProxyView.h" | ||
#import "LTScreenCaptureHelper.h" | ||
|
||
|
||
@implementation ProxyView { | ||
LTScreenCaptureHelper *_helper; | ||
NSImage *_image; | ||
} | ||
|
||
- (IBAction)updateScreenshot:(id)sender { | ||
_image = [LTScreenCaptureHelper defaultHelper].screenAsImage; | ||
|
||
self.needsDisplay = YES; | ||
|
||
#ifdef DEBUG | ||
[_image.TIFFRepresentation writeToFile:@"/tmp/shot.tiff" atomically:NO]; | ||
#endif | ||
} | ||
|
||
- (void)drawRect:(NSRect)dirtyRect { | ||
// [_image drawAtPoint:dirtyRect.origin fromRect:screenRect operation:NSCompositeSourceOver fraction:1]; | ||
[_image drawInRect:self.frame fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1]; | ||
} | ||
|
||
@end |