Sha256: ee95d3d603bbc987acfa08a09cb3396cb841f1c4ac32b7fd2538c231111a2ae8

Contents?: true

Size: 280 Bytes

Versions: 89

Compression:

Stored size: 280 Bytes

Contents

class UIImage

  # @return [NSData] an NSData object in PNG or JPG format
  def nsdata(format=:png, compression=0.9)
    case format
    when :png, :PNG
      UIImagePNGRepresentation(self)
    when :jpg, :JPG
      UIImageJPEGRepresentation(self, compression)
    end
  end

end

Version data entries

89 entries across 89 versions & 1 rubygems

Version Path
sugarcube-1.3.7 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.3.6 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.3.5 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.3.4 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.3.3 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.3.2 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.3.1 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.3.0 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.1.0 lib/sugarcube-nsdata/uiimage.rb