diff options
| author | Alan Kessler <[email protected]> | 2015-01-28 15:30:26 -0800 |
|---|---|---|
| committer | Alan Kessler <[email protected]> | 2015-01-28 15:30:26 -0800 |
| commit | e00899d292233b3fb886129ce01d042fdf0dd40b (patch) | |
| tree | 759d92012ad050e6309dd6e53e7cdc661baf382b | |
| parent | c24ec92ab6495b6b0c36e8e139d3d3ce350fc5c5 (diff) | |
| download | caxlsx-e00899d292233b3fb886129ce01d042fdf0dd40b.tar.gz caxlsx-e00899d292233b3fb886129ce01d042fdf0dd40b.zip | |
Make alpha option accessible for pictures 0 = transparent ... 100000 = opaque
| -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 571e9047..3e21fee9 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) + @alpha = options[:alpha] if options[:alpha] end # allowed file extenstions @@ -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 @alpha + str << "<a:alphaModFix amt=\"#{@alpha}\"/>" + 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>' |
