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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The Structure of Drawings 158<br />

Y-coordinate at which the color gradient begins, specified in hundredths of a<br />

millimeter<br />

StartIntensity (Short)<br />

intensity of StartColor as a percentage (in <strong>OpenOffice</strong>.<strong>org</strong> Basic, you can also specify<br />

values higher than 100 percent)<br />

EndIntensity (Short)<br />

intensity of EndColor as a percentage (in <strong>OpenOffice</strong>.<strong>org</strong> Basic, you can also specify<br />

values higher than 100 percent)<br />

StepCount (Short)<br />

number of color graduations which <strong>OpenOffice</strong>.<strong>org</strong> is to calculate for the gradients<br />

The following example demonstrates the use of color gradients with the aid of the<br />

com.sun.star.awt.Gradient<br />

structure:<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 />

Dim Gradient As New com.sun.star.awt.Gradient<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 />

Gradient.Style = com.sun.star.awt.GradientStyle.LINEAR<br />

Gradient.StartColor = RGB(255,0,0)<br />

Gradient.EndColor = RGB(0,255,0)<br />

Gradient.StartIntensity = 150<br />

Gradient.EndIntensity = 150<br />

Gradient.Angle = 450<br />

Gradient.StepCount = 100<br />

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

RectangleShape.FillGradient = Gradient

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

Saved successfully!

Ooh no, something went wrong!