21.08.2013 Views

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The Structure of Drawings 161<br />

Page = Doc.drawPages(0)<br />

RectangleShape =<br />

Doc.createInstance("com.sun.star.drawing.RectangleShape")<br />

RectangleShape.Size = Size<br />

RectangleShape.Position = Point<br />

RectangleShape.FillStyle = com.sun.star.drawing.FillStyle.BITMAP<br />

RectangleShape.FillBitmapName = "Sky"<br />

RectangleShape.FillBitmapMode = com.sun.star.drawing.BitmapMode.REPEAT<br />

Page.add(RectangleShape)<br />

Transparency<br />

You can adjust the transparency of any fill that you apply. The simplest way to change the<br />

transparency of a drawing element is to use the FillTransparence property.<br />

The following example creates a red rectangle with a transparency of 50 percent.<br />

Dim Doc As Object<br />

Dim Page As Object<br />

Dim RectangleShape As Object<br />

Dim Point As New com.sun.star.awt.Point<br />

Dim Size As New com.sun.star.awt.Size<br />

Point.x = 1000<br />

Point.y = 1000<br />

Size.Width = 10000<br />

Size.Height = 10000<br />

Doc = StarDesktop.CurrentComponent<br />

Page = Doc.drawPages(0)<br />

RectangleShape =<br />

Doc.createInstance("com.sun.star.drawing.RectangleShape")<br />

RectangleShape.Size = Size<br />

RectangleShape.Position = Point<br />

RectangleShape.FillStyle = com.sun.star.drawing.FillStyle.SOLID<br />

RectangleShape.FillTransparence = 50<br />

RectangleShape.FillColor = RGB(255,0,0)<br />

Page.add(RectangleShape)<br />

To make the fill transparent, set the FillTransparence property to 100.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!