summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2013-09-30 10:44:04 +0900
committerRandy Morgan <[email protected]>2013-09-30 10:44:04 +0900
commit3bf46a00d717d5e991166360bf4a2ece41cc3fbc (patch)
tree3f3e3120a7495bdecafd325c761f8fdfaf12574d /examples
parentebb1c30dded47746ba9d5ea834927031aa5e55e5 (diff)
downloadcaxlsx-3bf46a00d717d5e991166360bf4a2ece41cc3fbc.tar.gz
caxlsx-3bf46a00d717d5e991166360bf4a2ece41cc3fbc.zip
Fix image anchor swapping and update readme.
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/example.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/examples/example.rb b/examples/example.rb
index 8b11cb20..d8519a26 100755
--- a/examples/example.rb
+++ b/examples/example.rb
@@ -280,13 +280,23 @@ if examples.include? :images
wb.add_worksheet(:name => "Image with Hyperlink") do |sheet|
img = File.expand_path('../image1.jpeg', __FILE__)
# specifying the :hyperlink option will add a hyper link to your image.
+ #
# @note - Numbers does not support this part of the specification.
+
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
+ image.start_at 0, 0
+ end
+
+ # position in block
+ sheet.add_image(:image_src => img, :noSelect => true, :noMove => true, :hyperlink=>"http://axlsx.blogspot.com") do |image|
+ image.start_at 22, 14
+ image.end_at 23, 17
end
+ # all in one go
+ sheet.add_image(:image_src => img, :start_at => [15, 33], :end_at => [20, 37], :noSelect => true, :noMove => true, :hyperlink=>"http://axlsx.blogspot.com")
end
end
#```