diff options
| author | Jonathan Tron <[email protected]> | 2015-07-04 12:11:27 +0200 |
|---|---|---|
| committer | Jonathan Tron <[email protected]> | 2015-07-04 12:20:57 +0200 |
| commit | f27b6415d0dfb1dada0e8e627b3db3bfc1f4f4f9 (patch) | |
| tree | 9b66f5bdde50813e0ef86429abb17a322caabb99 /lib/axlsx/drawing/pic.rb | |
| parent | bd29ee24cb49168122b303599ec70b7164b4a1dc (diff) | |
| parent | fba67564a9ae713dbb122b469ef9d66e9d496075 (diff) | |
| download | caxlsx-f27b6415d0dfb1dada0e8e627b3db3bfc1f4f4f9.tar.gz caxlsx-f27b6415d0dfb1dada0e8e627b3db3bfc1f4f4f9.zip | |
Merge branch 'master' of https://github.com/alankessler/axlsx into alankessler-master
Diffstat (limited to 'lib/axlsx/drawing/pic.rb')
| -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>' |
