summaryrefslogtreecommitdiffhomepage
path: root/examples/sprk2012/images.rb
diff options
context:
space:
mode:
Diffstat (limited to 'examples/sprk2012/images.rb')
-rw-r--r--examples/sprk2012/images.rb19
1 files changed, 7 insertions, 12 deletions
diff --git a/examples/sprk2012/images.rb b/examples/sprk2012/images.rb
index d7fc768e..6e0b306d 100644
--- a/examples/sprk2012/images.rb
+++ b/examples/sprk2012/images.rb
@@ -1,14 +1,9 @@
-require 'axlsx'
-package = Axlsx::Package.new
-workbook = package.workbook
+$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../lib"
-workbook.add_worksheet(:name => "Image with Hyperlink") do |sheet|
- img = File.expand_path('../image1.jpeg', __FILE__)
- sheet.add_image(:image_src => img, :noSelect => true, :noMove => true, :hyperlink=>"http://axlsx.blogspot.com") do |image|
- image.width=720
- image.height=666
- image.hyperlink.tooltip = "Labeled Link"
- image.start_at 2, 2
+require 'axlsx'
+package = Axlsx::Package.new do |package|
+ package.workbook.add_worksheet(:name => "imagex") do |sheet|
+ img_path = File.expand_path('../../image1.jpeg', __FILE__)
+ sheet.add_image(:image_src => img_path, :width => 720, :height => 666, :start_at => [2,2])
end
-end
-
+end.serialize 'images.xlsx'