diff options
| author | Jonathan Tron <[email protected]> | 2015-07-04 12:11:27 +0200 |
|---|---|---|
| committer | Jonathan Tron <[email protected]> | 2015-07-04 12:11:27 +0200 |
| commit | 462d134fcf7c6f9c1fad0684f508629397bbf981 (patch) | |
| tree | faaae806fedf169a0f0375f8bc78606f6a28e27c /lib | |
| parent | f3945035e60fdeeebde6145b55c0ee100ce821db (diff) | |
| parent | fba67564a9ae713dbb122b469ef9d66e9d496075 (diff) | |
| download | caxlsx-462d134fcf7c6f9c1fad0684f508629397bbf981.tar.gz caxlsx-462d134fcf7c6f9c1fad0684f508629397bbf981.zip | |
Merge branch 'master' of https://github.com/alankessler/axlsx into alankessler-master
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/drawing/pic.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/axlsx/drawing/pic.rb b/lib/axlsx/drawing/pic.rb index a1e8483a..d38d2b6d 100644 --- a/lib/axlsx/drawing/pic.rb +++ b/lib/axlsx/drawing/pic.rb @@ -23,6 +23,7 @@ module Axlsx start_at(*options[:start_at]) if options[:start_at] yield self if block_given? @picture_locking = PictureLocking.new(options) + @opacity = (options[:opacity] * 100000).round if options[:opacity] #accepts value beween 0..1 end # allowed mime types @@ -171,7 +172,11 @@ module Axlsx picture_locking.to_xml_string(str) str << '</xdr:cNvPicPr></xdr:nvPicPr>' str << '<xdr:blipFill>' - str << ('<a:blip xmlns:r ="' << XML_NS_R << '" r:embed="' << relationship.Id << '"/>') + str << ('<a:blip xmlns:r ="' << XML_NS_R << '" r:embed="' << relationship.Id << '">') + if @opacity + str << "<a:alphaModFix amt=\"#{@opacity}\"/>" + end + str << '</a:blip>' str << '<a:stretch><a:fillRect/></a:stretch></xdr:blipFill><xdr:spPr>' str << '<a:xfrm><a:off x="0" y="0"/><a:ext cx="2336800" cy="2161540"/></a:xfrm>' str << '<a:prstGeom prst="rect"><a:avLst/></a:prstGeom></xdr:spPr></xdr:pic>' |
