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.5.8 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.5.7 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.5.6 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.5.5 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.5.4 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.5.3 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.5.2 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.5.1 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.5.0 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.4.6 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.4.5 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.4.4 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.4.3 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.4.2 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.4.1 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.4.0 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.3.11 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.3.10 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.3.9 lib/sugarcube-nsdata/uiimage.rb
sugarcube-1.3.8 lib/sugarcube-nsdata/uiimage.rb