1 package Excel::Template::Element::Image;
7 @ISA = qw(Excel::Template::Element);
9 use Excel::Template::Element;
16 my ($row, $col, $path, $offset, $scale) = map {
17 $context->get($self, $_)
18 } qw( ROW COL PATH OFFSET SCALE );
21 if ( $offset =~ /^\s*([\d.]+)\s*,\s*([\d.]+)/ ) {
26 if ( $scale =~ /^\s*([\d.]+)\s*,\s*([\d.]+)/ ) {
30 $context->active_worksheet->insert_bitmap(
31 $row, $col, $path, @offsets, @scales,
48 Excel::Template::Element::Image - Excel::Template::Element::Image
52 To insert an image into the worksheet
60 L<ELEMENT|Excel::Template::Element>
64 This will consume one column in the current row.
72 <image path="/Some/Full/Path" />
73 <image path="/Some/Full/Path" offset="2,5" />
74 <image path="/Some/Full/Path" scale="2,0.4" />
75 <image path="/Some/Full/Path" offset="4,0" scale="0,2" />
77 Please see L<Spreadsheet::WriteExcel/> for more information about the offset and scaling options as well as any other restrictions that might be in place. This node does B<NOT> perform any sort of validation upon your parameters. You are assumed to know what you are doing.
79 Note that the offset and scaling values are "X,Y". You I<must> provide both values, even if the Y value is 0. If you provide a 0 value for either scaling option, L<Spreadsheet::WriteExcel/> will default that to 1.
83 Rob Kinyon (rob.kinyon@gmail.com)