Class: OSX::NSImage

Inherits:
Object
  • Object
show all
Defined in:
lib/CocoaMagick.rb

Instance Method Summary collapse

Instance Method Details

#writePNG(filename) ⇒ Object



26
27
28
29
30
# File 'lib/CocoaMagick.rb', line 26

def writePNG(filename)
  bits = OSX::NSBitmapImageRep.alloc.initWithData(self.TIFFRepresentation)
  data = bits.representationUsingType_properties(OSX::NSPNGFileType, nil)
  data.writeToFile_atomically(filename, false)
end