[api-dev] how to change a Graphic ContourPolyPolygon

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[api-dev] how to change a Graphic ContourPolyPolygon

Fernand Vanrie
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

Reply | Threaded
Open this post in threaded view
|

[api-dev] Re: how to change a Graphic ContourPolyPolygon

Fernand Vanrie
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
>