21.08.2013 Views

OpenOffice.org BASIC Guide - OpenOffice.org wiki

OpenOffice.org BASIC Guide - OpenOffice.org wiki

OpenOffice.org BASIC Guide - 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.

AdjustBlue (Short)<br />

blue value as a percentage (negative values are also permitted)<br />

Gamma (Short)<br />

gamma value of a graphic<br />

Transparency (Short)<br />

transparency of a graphic as a percentage<br />

GraphicColorMode (enum)<br />

The Structure of Drawings<br />

color mode, for example, standard, gray stages, black and white (default value in accordance with<br />

com.sun.star.drawing.ColorMode)<br />

The following example shows how to insert a page into a graphics object.<br />

Dim Doc As Object<br />

Dim Page As Object<br />

Dim GraphicObjectShape 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 ' specifications, insignificant because latter<br />

coordinates are binding<br />

Point.y = 1000<br />

Size.Width = 10000<br />

Size.Height = 10000<br />

Doc = ThisComponent<br />

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

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

GraphicObjectShape.Size = Size<br />

GraphicObjectShape.Position = Point<br />

GraphicObjectShape.GraphicURL = "file:///c:/test.jpg"<br />

GraphicObjectShape.AdjustBlue = -50<br />

GraphicObjectShape.AdjustGreen = 5<br />

GraphicObjectShape.AdjustBlue = 10<br />

GraphicObjectShape.AdjustContrast = 20<br />

GraphicObjectShape.AdjustLuminance = 50<br />

GraphicObjectShape.Transparency = 40<br />

GraphicObjectShape.GraphicColorMode = com.sun.star.drawing.ColorMode.STANDARD<br />

Page.add(GraphicObjectShape)<br />

This code inserts the test.jpg graphic and adapts its appearance using the Adjust properties. In this example,<br />

the graphics are depicted as 40 percent transparent with no other color conversions do not take place<br />

(GraphicColorMode = STANDARD).<br />

Editing Drawing Objects<br />

Grouping Objects<br />

In many situations, it is useful to group several individual drawing objects together so that they behave as a single<br />

large object.<br />

The following example combines two drawing objects:<br />

Dim Doc As Object<br />

Dim Page As Object<br />

Dim Square As Object<br />

Dim Circle As Object<br />

Dim Shapes As Object<br />

Dim Group As Object<br />

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

Chapter 8 · Drawings and Presentations 125

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

Saved successfully!

Ooh no, something went wrong!