This doesn’t do anything:
NSImage* testImage = [[NSImage alloc] initWithSize:NSMakeSize(2.0,2.0)];
[testImage lockFocus];
[[NSImage imageNamed:@"testImage"] drawAtPoint:NSMakePoint(1.0,1.0) fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0];
[testImage unlockFocus];
[levelView setImage:testImage];
…but this does:
[levelView setImage:[NSImage imageNamed:@"testImage"]];
Seems to me if the latter produces visible results, so should the former. I assume I’m making a stupid mistake somewhere?
Let’s call [NSImage imageNamed:@”testImage”] sourceImage.
testImage will be 2×2 pixels. Since you’re drawing sourceImage at (1,1), 1 pixel up and one pixel right of the origin, 3 of your four pixels are necessarily still going to be clear. The top right pixel will be the same as the bottom left pixel of sourceImage. If that’s clear, you aren’t going to see anything.