in reply to Re: PowerPoint.pm extension for AddPolyline not working
in thread PowerPoint.pm extension for AddPolyline not working

Corion ... thank you very much!

Here's what I put into the PowerPoint module per your guidance on Win32::OLE::Variant (which I looked up on CPAN afterward ... because I should learn how to read)

# Get the points my @points=@{ $options->{points} }; # Create the Win32::OLE::Variant my $pointlist = Win32::OLE::Variant->new(VT_ARRAY | VT_R4 , 4, 2); # Convert points to Win32::OLE::Variant for my $index (0 .. 3) { # Add x $pointlist->Put( $index, 0, shift(@points) ); # Add y $pointlist->Put( $index, 1, shift(@points) ); } my $new_poly=$self->slide->Shapes->AddPolyline($pointlist);
So I could make the call into the function simple ...
# Add filled Triangle $PPT->add_polyline( {'points' => [$pptpoints[0], $pptpoints[1 +], $pptpoints[2], $pptpoints[3], $pptpoints[4], $pptpoints[5], $pptpo +ints[0], $pptpoints[1]], 'fillcolor' => &convert2RGBvalues($fill), 'weight' => $weight/px2pt, 'forecolor' => &convert2RGBvalues($color) } +);
Meaning the user will only have to define a list of three coordinate pairs in perl to make a triangle in PowerPoint.

EXCELLENT!