Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Objective-C
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
DrawingTest.xcodeproj
DrawingTest
.gitignore
Readme.md

Readme.md

Drawing Test

This is a little toy interface to test this NSImage method

- (void)drawInRect:(NSRect)dstRect 
          fromRect:(NSRect)srcRect 
          operation:(NSCompositingOperation)op 
          fraction:(CGFloat)delta

It provides slider controls to alter dstRect and srcRect interactively and view the effects immediately.

Two source images are provided and the method is sent to each.

The drawing context is a new NSImage which combines the results. This image is then drawn in an NSView:

- (void) drawRect:(NSRect)dirtyRect
{
    [NSColor blackColor];
    NSFrameRect(self.bounds);
    if (self.combinedImage) {
        [self.combinedImage drawInRect:self.bounds
                              fromRect:NSZeroRect
                             operation:NSCompositeSourceOver
                              fraction:1.0];
    }
}
Something went wrong with that request. Please try again.