in reply to Win32::OLE PowerPoint Shapes
Which is not exactly in line with yours, but is close enough for MS work.With myDocument.Shapes.AddShape(Type:=msoShapeRectangle, _ Top:=144, Left:=144, Width:=72, Height:=72) .Name = "Red Square" .Fill.ForeColor.RGB = RGB(255, 0, 0) .Line.DashStyle = msoLineDashDot End With
What caught my eye is the use of a VB function cleverly called RGB. Referencing the docs, one finds function RGB converts three arguments into a LONG representing the color. Here's a snippet from my VB's immediate window test cases.
This function, at least, seems to perform as documented.print RGB(0,0,0) 0 print RGB(255,255,255) 16777215 print RGB(255,0,0) 255 print RGB(0,255,0) 65280 print RGB(0,0,255) 16711680
Armed with this knowledge, I constructed a Perl example that strives to curve-fit the MS function.
As you can see, the Perl function fits the VB data well within the expected error.sub RGB { my ($red,$green,$blue) = @_; return $red + 256 * $green + 65536 * $blue; } print RGB(0,0,0) . "\n"; print RGB(255,255,255) . "\n"; print RGB(255,0,0) . "\n"; print RGB(0,255,0) . "\n"; print RGB(0,0,255) . "\n";
There is no guarantee that our Perl port of VB's RGB function will solve your problem, but it should provide a good jumping-off point.0 16777215 255 65280 16711680
<Oobject name="tongue" method="in-cheek" comment="intended with best regards =)"/>
--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.
|
|---|