Re: how to change a Graphic ContourPolyPolygon

Fernand Vanrie <[email protected]> Thu, 06 Jan 2011 10:42:43 +0100
Newsgroups gmane.comp.openoffice.devel.api
Message-ID <[email protected]>
OK found it myself:

a ContourPolyPolygon is a bouble Array, with  a Array of plygons and 
Arrays of Point structures based on the size of the original graphic 
oGraphicobject.graphic)  who are needed to build the controur Polygon.
oPoly(Polypoints())
now it's easy to change the Polygon points to fit the new size of the 
new graphic.
sub test

     oPoly = thiscomponent.currentselection.contourpolypolygon(0)
    PolyPoints = oPoly(0)
   teller = ubound( PolyPoints())
for i = 0 to teller
   PolyPoints(i).x = int(PolyPoints(i).x*1.5) ' or whatever change we 
will to make
   PolyPoints(i).y = int(PolyPoints(i).y*1.5)
next
' passing back the values
oPoly(0) = PolyPoints()
thiscomponent.currentselection.contourpolypolygon(0)= oPoly()


hope it can serve others

Fernand

> Hallo,
>
> I Trie to preserve the Graphicobject ContourPolyPolygon after i 
> changed the Graphic behind this object. The original Contour is still 
> there but with the size , position off the old Graphic.
>
> How can i using BASIC, change this ContourPolyPolygon also named " 
> ::com::sun::star::drawing::PointSequenceSequence" and adapt the 
> contour to the new size and positions of the underling Graphic ?
>
> Thanks for any hint.
> Fernand
>