EnzoXenon has asked for the wisdom of the Perl Monks concerning the following question:
Now I'm trying to add a routine to make a polyline ... (so I can draw arbitrary and not just mso Shapes) and I coded it like this:sub add_line { my ($self, $options) = @_; return unless $self->slide; $options = {} unless ref $options eq 'HASH'; my $new_line = $self->slide->Shapes->AddLine($options->{x1}, $option +s->{y1}, $options->{x2}, $options->{y2}); $new_line->{Line}{ForeColor}{RGB}=RGB($options->{forecolor}) if(defi +ned $options->{forecolor}); $new_line->{Line}{Weight}=$options->{weight} if(defined $options->{w +eight}); $new_line->{Line}{Pattern}=$options->{pattern} if(defined $options-> +{pattern}); return $new_line; }
Which does not work. The argument needed by the microsoft routine AddPolyline is something called a "SafeArrayOfPoints" in the docos.sub add_polyline { my ($self, $options) = @_; return unless $self->slide; $options = {} unless ref $options eq 'HASH'; my $new_poly=$self->slide->Shapes->AddPolyline($options->{points}); $new_poly->{Line}{ForeColor}{RGB}=RGB($options->{forecolor}) if(defi +ned $options->{forecolor}); $new_poly->{Line}{Weight}=$options->{weight} if(defined $options->{w +eight}); $new_poly->{Line}{Pattern}=$options->{pattern} if(defined $options-> +{pattern}); if(defined $options->{fillcolor}) { $new_poly->{Fill}{ForeColor}{RGB}=RGB($options->{fillcolor}); } else { $new_poly->{Fill}{Transparency}=1; } return $new_poly; }
https://documentation.help/Microsoft-PowerPoint-Visual-Basic/ppmthAddPolyline1.htm
I've tried an array, a two-dimensional array, and array reference ... nothing works.
Can anyone help?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PowerPoint.pm extension for AddPolyline not working
by Corion (Patriarch) on Jun 14, 2023 at 07:33 UTC | |
by EnzoXenon (Acolyte) on Jun 14, 2023 at 12:15 UTC | |
|
Re: PowerPoint.pm extension for AddPolyline not working
by EnzoXenon (Acolyte) on Jun 14, 2023 at 02:34 UTC |