Created
November 6, 2017 15:09
-
-
Save sonburn/aa6d17566c0a38d8400ab8ebbd14e3d4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function createViewWithImage(context,file,frame) { | |
var imageView = NSView.alloc().initWithFrame(frame), | |
imagePath = context.plugin.urlForResourceNamed(file).path(), | |
image = NSImage.alloc().initByReferencingFile(imagePath); | |
imageView.setWantsLayer(1); | |
imageView.layer().setBackgroundColor(CGColorCreateGenericRGB(255,255,255,1)); | |
imageView.layer().contents = image; | |
return imageView; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment