How create thumbnail from NSImage?

I did searches on the Internet but could not find a definitive answer. The best thing I get is CGImageSourceCreateThumbnailAtIndex API function. But I don't know how create CGImageSource out of an NSImage object. Thanks for any suggestions.

How create thumbnail from NSImage?
 
 
Q