Difference between revisions of "NL/Documentation/BASIC Guide/Structure of Drawings"

From Apache OpenOffice Wiki
Jump to: navigation, search
m
(25 intermediate revisions by 2 users not shown)
Line 10: Line 10:
 
== Pagina's ==
 
== Pagina's ==
  
{{Documentation/Tip|Een document van Draw (of Impress) wordt samengesteld uit pagina's, ook wel dia's genoemd. Wat hier is beschreven is ook van toepassing op documenten van Impress.}}
+
{{Tip|Een document van Draw (of Impress) wordt samengesteld uit pagina's, ook wel dia's genoemd. Wat hier is beschreven is ook van toepassing op documenten van Impress.}}
  
{{OOo}} kent geen beperking in het aantal pagina's in een document voor een tekening. U kunt elke pagina afzonderlijk ontwerpen. Er is ook geen limiet aan het aantal tekenelementen dat u kunt toevoegen aan een pagina.
+
{{AOo}} kent geen beperking in het aantal pagina's in een document voor een tekening. U kunt elke pagina afzonderlijk ontwerpen. Er is ook geen limiet aan het aantal tekenelementen dat u kunt toevoegen aan een pagina.
  
 
De pagina's van een document voor een tekening zijn beschikbaar via de DrawPages container <tt>DrawPages</tt>. U kunt individuele pagina's echter benaderen via hun nummer of hun naam. Als een document slechts één pagina heeft en die is genaamd '''Dia 1''', dan zijn de volgende voorbeelden identiek.
 
De pagina's van een document voor een tekening zijn beschikbaar via de DrawPages container <tt>DrawPages</tt>. U kunt individuele pagina's echter benaderen via hun nummer of hun naam. Als een document slechts één pagina heeft en die is genaamd '''Dia 1''', dan zijn de volgende voorbeelden identiek.
Line 18: Line 18:
 
'''Voorbeeld 1: toegang door middel van het nummer (nummering begint met 0)'''
 
'''Voorbeeld 1: toegang door middel van het nummer (nummering begint met 0)'''
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
 
Dim Pagina As Object
 
Dim Pagina As Object
Line 24: Line 24:
 
Doc = ThisComponent
 
Doc = ThisComponent
 
Pagina = Doc.DrawPages(0)
 
Pagina = Doc.DrawPages(0)
</source>
+
</syntaxhighlight>
  
{{Documentation/Note|De uitdrukking <code>Doc.DrawPages(0)</code> is een vereenvoudiging voor BASIC van de aanroep van de API : <code>Doc.getDrawPages.getByIndex(0)</code>}}
+
{{Note|De uitdrukking <code>Doc.DrawPages(0)</code> is een vereenvoudiging voor BASIC van de aanroep van de API : <code>Doc.getDrawPages.getByIndex(0)</code>}}
  
 
'''Voorbeeld 2: toegang door middel van de naam'''
 
'''Voorbeeld 2: toegang door middel van de naam'''
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
 
Dim Pagina As Object
 
Dim Pagina As Object
Line 36: Line 36:
 
Doc = ThisComponent
 
Doc = ThisComponent
 
Pagina = Doc.DrawPages.getByName("Dia 1")
 
Pagina = Doc.DrawPages.getByName("Dia 1")
</source>
+
</syntaxhighlight>
  
 
In voorbeeld 1 wordt de pagina benaderd via zijn nummer (nummering begint bij 0). In het tweede voorbeeld wordt de pagina benaderd via zijn naam en de methode <tt>getByName</tt>.
 
In voorbeeld 1 wordt de pagina benaderd via zijn nummer (nummering begint bij 0). In het tweede voorbeeld wordt de pagina benaderd via zijn naam en de methode <tt>getByName</tt>.
Line 56: Line 56:
 
Het volgende voorbeeld stelt de paginagrootte van een net geopend document voor een tekening in op 20 × 20 centimeter met een paginamarge van 0,5 centimeter:
 
Het volgende voorbeeld stelt de paginagrootte van een net geopend document voor een tekening in op 20 × 20 centimeter met een paginamarge van 0,5 centimeter:
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
 
Dim Pagina As Object
 
Dim Pagina As Object
Line 70: Line 70:
 
Pagina.Width = 20000
 
Pagina.Width = 20000
 
Pagina.Height = 20000
 
Pagina.Height = 20000
</source>
+
</syntaxhighlight>
  
 
=== Hernoemen van pagina's ===
 
=== Hernoemen van pagina's ===
  
{{Documentation/Caution|Indien een nieuwe pagina wordt ingevoegd in een document voor ene tekening met meerdere pagina's, zullen alle daarop volgende pagina's die  '''niet''' zijn hernoemd automatisch hun standaard naam zien veranderen, bijv. '''Dia 3''' zal wordne gewijzigd naar '''Dia 4''', etc. Dit automatisch hernoemen werkt ook omgekeerd wanneer een pagina wordt verwijderd.
+
{{Warn|Indien een nieuwe pagina wordt ingevoegd in een document voor een tekening met meerdere pagina's, zullen alle daarop volgende pagina's die  '''niet''' zijn hernoemd automatisch hun standaard naam zien veranderen, bijv. '''Dia 3''' zal worden gewijzigd naar '''Dia 4''', etc. Dit automatisch hernoemen werkt ook omgekeerd wanneer een pagina wordt verwijderd.
  
 
De enige manier om een vaste naam voor de pagina te verkrijgen is door de pagina te hernoemen, via de gebruikersinterface of door programmeren.}}
 
De enige manier om een vaste naam voor de pagina te verkrijgen is door de pagina te hernoemen, via de gebruikersinterface of door programmeren.}}
Line 80: Line 80:
 
Een pagina verschaft de methoden <code>getName</code> en <code>setName</code> om zijn naam te lezen en aan te passen. BASIC kan beide methoden afhandelen als een eigenschap <code>Name</code>. Hier hernoemen we de eerste pagina van het document voor de tekening.
 
Een pagina verschaft de methoden <code>getName</code> en <code>setName</code> om zijn naam te lezen en aan te passen. BASIC kan beide methoden afhandelen als een eigenschap <code>Name</code>. Hier hernoemen we de eerste pagina van het document voor de tekening.
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
 
Dim Pagina As Object
 
Dim Pagina As Object
Line 87: Line 87:
 
Pagina = Doc.DrawPages(0)
 
Pagina = Doc.DrawPages(0)
 
Pagina.Name = "Eerste"
 
Pagina.Name = "Eerste"
</source>
+
</syntaxhighlight>
  
=== Pagina's maken en verwijderen ===
+
=== Maken en verwijderen van pagina's ===
  
The <tt>DrawPages</tt> container of a <tt>drawing</tt> document is also used to create and delete individual pages. The following example uses the <tt>hasByName</tt> method to check if a page called '''MyPage''' exists. If it does, the method determines a corresponding object reference by using the <tt>getByName</tt> method and then saves the reference in a variable in <tt>Page</tt>. If the corresponding page does not exist, it is created and inserted in the drawing document by the <tt>insertNewByIndex</tt> method. The argument of the method is the position, counted from 0, of the ''existing'' page after which the new page will be inserted. Then the new page is renamed.
+
De container <tt>DrawPages</tt> van een document voor een <tt>tekening</tt> wordt ook gebruikt om individuele pagina's te maken en te verwijderen. Het volgende voorbeeld gebruikt de methode <tt>hasByName</tt> om te controleren of een pagina, genaamd '''MijnPagina''', bestaat. Als die bestaat bepaalt de methode een overeenkomstige verwijzing naar het object met behulp van de methode <tt>getByName</tt> en slaat dan de verwijzing op in een variabele in <tt>Pagina</tt>. Als de overeenkomende pagina niet bestaat, wordt die gemaakt en ingevoegd in het document voor de tekening door middel van de methode <tt>insertNewByIndex</tt>. Het argument van de methode is de positie, geteld vanaf 0, van de ''bestaande'' pagina achter welke de nieuwe pagina zal worden ingevoegd. Dan wordt de nieuwe pagina hernoemd.
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
Dim Page As Object
+
Dim Pagina As Object
  
 
Doc = ThisComponent
 
Doc = ThisComponent
  
If Doc.Drawpages.hasByName("MyPage") Then
+
If Doc.Drawpages.hasByName("MijnPagina") Then
   Page = Doc.Drawpages.getByName("MyPage")
+
   Pagina = Doc.Drawpages.getByName("MijnPagina")
 
Else
 
Else
   Page = Doc.Drawpages.insertNewByIndex(2)
+
   Pagina = Doc.Drawpages.insertNewByIndex(2)
   Page.Name = "MyPage" ' you should always rename a new page
+
   Pagina.Name = "MijnPagina" ' u zou een nieuwe pagina altijd moeten hernoemen
   ' MyPage is the fourth page of the document, i.e. position 3
+
   ' MijnPagina is de vierde pagina van het document, d.i. positie 3
 
End If
 
End If
</source>
+
</syntaxhighlight>
  
The <tt>hasByName</tt> and <tt>getByName</tt> methods are obtained from the <idl>com.sun.star.container.XNameAccess</idl> interface.  
+
De methoden <tt>hasByName</tt> en <tt>getByName</tt> worden verkregen uit de interface <idl>com.sun.star.container.XNameAccess</idl>.  
  
The <tt>insertNewByIndex</tt> method is obtained from the <idl>com.sun.star.drawing.XDrawPages</idl> interface.
+
De methode <tt>insertNewByIndex</tt> wordt verkregen uit de interface <idl>com.sun.star.drawing.XDrawPages</idl>.
The same interface provides the method <code>remove</code> to delete (remove) a page:
+
Dezelfde interface verschaft de methode <code>remove</code> om een pagina te verwijderen (wissen):
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
 +
Dim Pagina As Object
 
   
 
   
 
Doc = ThisComponent
 
Doc = ThisComponent
  
If Doc.Drawpages.hasByName("MyPage") Then
+
If Doc.Drawpages.hasByName("MijnPagina") Then
   Page = Doc.Drawpages.getByName("MyPage")
+
   Pagina = Doc.Drawpages.getByName("MijnPagina")
   Doc.Drawpages.remove(Page)
+
   Doc.Drawpages.remove(Pagina)
 
End If
 
End If
</source>
+
</syntaxhighlight>
  
=== Duplicating a Page ===
+
=== Dupliceren van een pagina ===
  
A copy of a given page is created, not from the DrawPages container, but from the drawing document itself with the method <code>duplicate</code>. The copy is created at the next position after the original page, with a default name.
+
Een kopie van een bepaalde pagina wordt gemaakt, niet vanuit de container DrawPages, maar vanuit het document voor de tekening zelf met de methode <code>duplicate</code>. De kopie wordt gemaakt op de volgende positie nà de originele pagina, met een standaard naam.
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
Dim Page As Object, ClonedPage As Object
+
Dim Pagina As Object, KopiePagina As Object
 
   
 
   
 
Doc = ThisComponent
 
Doc = ThisComponent
Page = Doc.Drawpages.getByName("MyPage")
+
Pagina = Doc.Drawpages.getByName("MijnPagina")
ClonedPage = Doc.duplicate(Page)
+
KopiePagina = Doc.duplicate(Pagina)
ClonedPage.Name = "MyCopy" ' you should always rename a new page
+
KopiePagina.Name = "MijnKopie" ' u zou een nieuwe pagina altijd moeten hernoemen
</source>
+
</syntaxhighlight>
  
=== Moving a Page ===
+
=== Verplaatsen van een pagina ===
  
The API does not provide a method to change the position of a page inside a drawing document.
+
De API verschaft geen methode om de positie van een pagina binnen het document voor een tekening te wijzigen.
  
 +
== Elementaire eigenschappen van tekenobjecten ==
  
== Elementary Properties of Drawing Objects ==
+
Tekenobjecten bestaan uit vormen (rechthoeken, cirkels, enzovoort), lijnen en tekstobjecten. Deze delen allemaal een aantal algemene mogelijkheden en ondersteunen de service <tt>com.sun.star.drawing.Shape</tt>. Deze service definieert de eigenschappen <tt>Size</tt> en <tt>Position</tt> van een tekenobject.
  
Drawing objects include shapes (rectangles, circles, and so on), lines, and text objects. All of these share a number of common features and support the <tt>com.sun.star.drawing.Shape</tt> service. This service defines the <tt>Size</tt> and <tt>Position</tt> properties of a drawing object.
+
{{AOo}} BASIC biedt ook diverse andere services waardoor u dergelijke eigenschappen kunt wijzigen, zoals opmaak of vulling toepassen. De opties voor de opmaak die beschikbaar zijn hangen af van het type tekenobject.
  
{{OOo}} Basic also offers several other services through which you can modify such properties, as formatting or apply fills. The formatting options that are available depend on the type of drawing object.
+
Het volgende voorbeeld maakt een rechthoek en voegt die in een document voor een tekening in:
  
The following example creates and inserts a rectangle in a drawing document:
+
<syntaxhighlight lang="oobas">
 
+
<source lang="oobas">
+
 
Dim Doc As Object
 
Dim Doc As Object
Dim Page As Object
+
Dim Pagina As Object
Dim RectangleShape As Object
+
Dim RechthoekVorm As Object
Dim Point As New com.sun.star.awt.Point
+
Dim Punt As New com.sun.star.awt.Point
Dim Size As New com.sun.star.awt.Size
+
Dim Grootte As New com.sun.star.awt.Size
  
 
Doc = ThisComponent
 
Doc = ThisComponent
Page = Doc.DrawPages(0)
+
Pagina = Doc.DrawPages(0)
  
Point.x = 1000
+
Punt.x = 1000
Point.y = 1000
+
Punt.y = 1000
Size.Width = 10000
+
Grootte.Width = 10000
Size.Height = 10000
+
Grootte.Height = 10000
  
RectangleShape = Doc.createInstance("com.sun.star.drawing.RectangleShape")
+
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RectangleShape.Size = Size
+
RechthoekVorm.Size = Grootte
RectangleShape.Position = Point
+
RechthoekVorm.Position = Punt
  
Page.add(RectangleShape)
+
Pagina.add(RechthoekVorm)
</source>
+
</syntaxhighlight>
  
The <tt>Point</tt> and <tt>Size</tt> structures with the point of origin (left hand corner) and the size of the drawing object are then initialized. The lengths are specified in hundredths of a millimeter.
+
De structuren <tt>Punt</tt> en <tt>Grootte</tt>, met het punt van origine (linkerbovenhoek) en de grootte van het tekenobject, worden geïnitialiseerd. De lengten worden gespecificeerd in honderdsten van een millimeter.
  
The program code then uses the <tt>Doc.createInstance</tt> call to create the rectangle drawing object as specified by the <idl>com.sun.star.drawing.RectangleShape</idl> service. At the end, the drawing object is assigned to a page using a <tt>Page.add</tt> call.
+
De programmacode gebruikt dan de aanroep <tt>Doc.createInstance</tt> om een rechthoekig tekenobject te maken, zoals gespecificeerd door de service <idl>com.sun.star.drawing.RectangleShape</idl>. Aan het einde wordt het tekenobject toegewezen aan de pagina met behulp van een aanroep <tt>Pagina.add</tt>.
  
=== Fill Properties ===
+
=== Eigenschappen voor vulling ===
  
This section describes four services and in each instance the sample program code uses a rectangle shape element that combines several types of formatting. Fill properties are combined in the <idl>com.sun.star.drawing.FillProperties</idl> service.
+
Dit gedeelte beschrijft vier services en in elk geval gebruikt de programmacode van het voorbeeld een element met een rechthoekige vorm die verschillende vormen van opmaak combineert. Eigenschappen voor vulling worden gecombineerd in de service <idl>com.sun.star.drawing.FillProperties</idl>.
  
{{OOo}} recognizes four main types of formatting for a fill area. The simplest variant is a single-color fill. The options for defining color gradients and hatches let you create other colors into play. The fourth variant is the option of projecting existing graphics into the fill area.
+
{{AOo}} herkent vier hoofdtypen van opmaak voor een gebied dat gevuld moet worden. De eenvoudigste variant is een enkelkleurige vulling. De opties voor het definiëren van kleurverlopen en arceringen stellen u in staat ook andere kleuren te gebruiken. De vierde variant is de optie van het projecteren van bestaande afbeeldingen in het gebied om te vullen.
  
The fill mode of a drawing object is defined using the <tt>FillStyle</tt> property. The permissible values are defined in <idl>com.sun.star.drawing.FillStyle</idl>.
+
De modus vulling van een tekenobject wordt gedefinieerd met behulp van de eigenschap <tt>FillStyle</tt>. De toegestane waarden worden gedefinieerd in <idl>com.sun.star.drawing.FillStyle</idl>.
  
=== Single Color Fills ===
+
=== Vullingen met één kleur ===
  
The main property for single-color fills is:
+
De belangrijkste eigenschap voor enkelkleurige vullingen is:
  
;<tt>FillColor (Long)</tt>:fill color of area
+
;<tt>FillColor (Long)</tt>:kleur voor de vulling van het gebied
  
To use the fill mode, you must the <tt>FillStyle</tt> property to the <tt>SOLID</tt> fill mode.
+
U moet de eigenschap <tt>FillStyle</tt> instellen op de modus voor vulling <tt>SOLID</tt> om die modus voor vulling te kunnen gebruiken.
  
The following example creates a rectangle shape and fills it with red (RGB value 255, 0, 0):
+
Het volgende voorbeeld maakt een rechthoekige vorm en vult die met rood (RGB waarde 255, 0, 0):
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
Dim Page As Object
+
Dim Pagina As Object
Dim RectangleShape As Object
+
Dim RechthoekVorm As Object
Dim Point As New com.sun.star.awt.Point
+
Dim Punt As New com.sun.star.awt.Point
Dim Size As New com.sun.star.awt.Size
+
Dim Grootte As New com.sun.star.awt.Size
  
Point.x = 1000
+
Punt.x = 1000
Point.y = 1000
+
Punt.y = 1000
Size.Width = 10000
+
Grootte.Width = 10000
Size.Height = 10000
+
Grootte.Height = 10000
  
 
Doc = ThisComponent
 
Doc = ThisComponent
Page = Doc.DrawPages(0)
+
Pagina = Doc.DrawPages(0)
  
RectangleShape = Doc.createInstance("com.sun.star.drawing.RectangleShape")
+
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RectangleShape.Size = Size
+
RechthoekVorm.Size = Grootte
RectangleShape.Position = Point
+
RechthoekVorm.Position = Punt
  
RectangleShape.FillStyle = com.sun.star.drawing.FillStyle.SOLID
+
RechthoekVorm.FillStyle = com.sun.star.drawing.FillStyle.SOLID
RectangleShape.FillColor = RGB(255,0,0)
+
RechthoekVorm.FillColor = RGB(255,0,0)
  
Page.add(RectangleShape)
+
Pagina.add(RechthoekVorm)
</source>
+
</syntaxhighlight>
  
=== Color Gradient ===
+
=== Kleurverloop ===
  
If you set the <tt>FillStyle</tt> property to <tt>GRADIENT</tt>, you can apply a color gradient to any fill area of a {{OOo}} document.
+
Als u de eigenschap <tt>FillStyle</tt> instelt op <tt>GRADIENT</tt>, kunt u een kleurverloop toepassen op elk vulgebied in een document van {{OOo}}.
  
If you want to apply a predefined color gradient, you can assign the associated name of the <tt>FillTransparenceGradientName</tt> property. To define your own color gradient, you need to complete a <idl>com.sun.star.awt.Gradient</idl> structure to assign the <tt>FillGradient</tt> property. This property provides the following options:
+
Indien u een vooraf gedefinieerd kleurverloop wilt toepassen, kunt u de bijbehorende naam toewijzen aan de eigenschap <tt>FillTransparenceGradientName</tt>. Om uw eigen kleurverloop te definiëren, moet u een structuur <idl>com.sun.star.awt.Gradient</idl> completeren om de  eigenschap <tt>FillGradient</tt> aan toe te wijzen. Deze eigenschap verschaft de volgende opties:
  
;<tt>Style (Enum)</tt>:type of gradient, for example, linear or radial (default values in accordance with <idl>com.sun.star.awt.GradientStyle</idl>)
+
;<tt>Style (Enum)</tt>:type kleurverloop, bijvoorbeeld, lineair of radiaal (standaard waarden overeenkomend met <idl>com.sun.star.awt.GradientStyle</idl>)
;<tt>StartColor (Long)</tt>:start color of color gradient
+
;<tt>StartColor (Long)</tt>:beginkleur van kleurverloop
;<tt>EndColor (Long)</tt>:end color of color gradient
+
;<tt>EndColor (Long)</tt>:eindkleur van kleurverloop
;<tt>Angle (Short)</tt>:angle of color gradient in tenths of a degree
+
;<tt>Angle (Short)</tt>:hoek van het kleurverloop in tienden van graden
;<tt>XOffset (Short)</tt>:X-coordinate at which the color gradient starts, specified in hundredths of a millimeter
+
;<tt>XOffset (Short)</tt>:X-coördinaat waarop het kleurverloop begint, gespecificeerd in 100-en of a millimeter
;<tt>YOffset (Short)</tt>:Y-coordinate at which the color gradient begins, specified in hundredths of a millimeter
+
;<tt>YOffset (Short)</tt>:Y-coördinaat waarop het kleurverloop begint, gespecificeerd in 100-en of a millimeter
;<tt>StartIntensity (Short)</tt>:intensity of <tt>StartColor</tt> as a percentage (in {{OOo}} Basic, you can also specify values higher than 100 percent)
+
;<tt>StartIntensity (Short)</tt>:intensiteit van <tt>StartColor</tt> als een percentage (in {{OOo}} BASIC kunt u ook waarden specificeren die groter zijn dan 100 procent)
;<tt>EndIntensity (Short)</tt>:intensity of <tt>EndColor</tt> as a percentage (in {{OOo}} Basic, you can also specify values higher than 100 percent)
+
;<tt>EndIntensity (Short)</tt>:intensiteit van <tt>EndColor</tt> als een percentage (in {{OOo}} BASIC kunt u ook waarden specificeren die groter zijn dan 100 procent)
;<tt>StepCount (Short)</tt>:number of color graduations which {{OOo}} is to calculate for the gradients
+
;<tt>StepCount (Short)</tt>:aantal gradaties van kleuren dat {{OOo}} moet berekenen voor de verlopen
  
The following example demonstrates the use of color gradients with the aid of the <idl>com.sun.star.awt.Gradient</idl> structure:
+
Het volgende voorbeeld demonstreert het gebruik van kleurverlopen met behulp van de structuur <idl>com.sun.star.awt.Gradient</idl>:
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
Dim Page As Object
+
Dim Pagina As Object
Dim RectangleShape As Object
+
Dim RechthoekVorm As Object
Dim Point As New com.sun.star.awt.Point
+
Dim Punt As New com.sun.star.awt.Point
Dim Size As New com.sun.star.awt.Size
+
Dim Grootte As New com.sun.star.awt.Size
Dim Gradient As New com.sun.star.awt.Gradient  
+
Dim Kleurverloop As New com.sun.star.awt.Gradient  
  
Point.x = 1000
+
Punt.x = 1000
Point.y = 1000
+
Punt.y = 1000
Size.Width = 10000
+
Grootte.Width = 10000
Size.Height = 10000
+
Grootte.Height = 10000
  
 
Doc = ThisComponent
 
Doc = ThisComponent
Page = Doc.DrawPages(0)
+
Pagina = Doc.DrawPages(0)
  
RectangleShape = Doc.createInstance("com.sun.star.drawing.RectangleShape")
+
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RectangleShape.Size = Size
+
RechthoekVorm.Size = Grootte
RectangleShape.Position = Point
+
RechthoekVorm.Position = Punt
Gradient.Style = com.sun.star.awt.GradientStyle.LINEAR
+
Kleurverloop.Style = com.sun.star.awt.GradientStyle.LINEAR
Gradient.StartColor = RGB(255,0,0)
+
Kleurverloop.StartColor = RGB(255,0,0)
Gradient.EndColor = RGB(0,255,0)
+
Kleurverloop.EndColor = RGB(0,255,0)
Gradient.StartIntensity = 150   
+
Kleurverloop.StartIntensity = 150   
Gradient.EndIntensity = 150
+
Kleurverloop.EndIntensity = 150
Gradient.Angle = 450
+
Kleurverloop.Angle = 450
Gradient.StepCount = 100
+
Kleurverloop.StepCount = 100
  
RectangleShape.FillStyle = com.sun.star.drawing.FillStyle.GRADIENT
+
RechthoekVorm.FillStyle = com.sun.star.drawing.FillStyle.GRADIENT
RectangleShape.FillGradient = Gradient
+
RechthoekVorm.FillGradient = Kleurverloop
  
Page.add(RectangleShape)
+
Pagina.add(RechthoekVorm)
</source>
+
</syntaxhighlight>
  
This example creates a linear color gradient (<tt>Style = LINEAR</tt>). The gradient starts with red (<tt>StartColor</tt>) in the top left corner, and extends at a 45 degree angle (<tt>Angle</tt>) to green (<tt>EndColor</tt>) in the bottom right corner. The color intensity of the start and end colors is 150 percent (<tt>StartIntensity</tt> and <tt>EndIntensity</tt>) which results in the colors seeming brighter than the values specified in the <tt>StartColor</tt> and <tt>EndColor</tt> properties. The color gradient is depicted using a hundred graduated individual colors (<tt>StepCount</tt>).
+
Dit voorbeeld maakt een lineair kleurverloop (<tt>Style = LINEAR</tt>). Het kleurverloop begint met rood (<tt>StartColor</tt>) in de linkerbovenhoek en breidt zich uit in een hoek van 45 graden (<tt>Angle</tt>) tot groen (<tt>EndColor</tt>) in de rechter benedenhoek. De kleurintensiteit van de begin- en eindkleur is 150
 +
procent (<tt>StartIntensity</tt> en <tt>EndIntensity</tt>) welke er in resulteren dat de kleuren helderder lijken dan de waarden, gespecificeerd in de eigenschappen <tt>StartColor</tt> en <tt>EndColor</tt>. Het kleurverloop wordt weergegeven door middel van honderd gegradueerde individuele kleuren (<tt>StepCount</tt>).
  
=== Hatches ===
+
=== Arceringen ===
  
To create a hatch fill, the <tt>FillStyle</tt> property must be set to <tt>HATCH</tt>. The program code for defining the hatch is very similar to the code for color gradients. Again an auxiliary structure, in this case <idl>com.sun.star.drawing.Hatch</idl>, is used to define the appearance of hatches. The structure for hatches has the following properties:
+
De eigenschap <tt>FillStyle</tt> moet worden ingesteld op <tt>HATCH</tt> om een vulling met arcering te maken. De programmacode voor het definiëren van de arcering lijkt veel op de code voor kleurverlopen. Opnieuw wordt een hulp-structuur, in dit geval <idl>com.sun.star.drawing.Hatch</idl>, gebruikt om het uiterlijk van de arcering te definiëren. De structuur voor arceringen heeft de volgende eigenschappen:
  
;<tt>Style (Enum)</tt>:type of hatch: simple, squared, or squared with diagonals (default values in accordance with <tt>com.sun.star.awt.HatchStyle</tt>)
+
;<tt>Style (Enum)</tt>:type arcering: eenvoudig, vierkant of vierkant met diagonalen (standaard waarden die overeenkomen met <tt>com.sun.star.awt.HatchStyle</tt>)
;<tt>Color (Long)</tt>:color of lines
+
;<tt>Color (Long)</tt>:kleur van de lijnen
;<tt>Distance (Long)</tt>:distance between lines in hundredths of a millimeter
+
;<tt>Distance (Long)</tt>:afstand tussen de lijnen in 100-en van een millimeter
;<tt>Angle (Short)</tt>:angle of hatch in tenths of a degree
+
;<tt>Angle (Short)</tt>:hoek van de arcering in tienden van graden
  
The following example demonstrates the use of a hatch structure:
+
Het volgende voorbeeld demonstreert het gebruik van een structuur voor arcering:
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
Dim Page As Object
+
Dim Pagina As Object
Dim RectangleShape As Object
+
Dim RechthoekVorm As Object
Dim Point As New com.sun.star.awt.Point
+
Dim Punt As New com.sun.star.awt.Point
Dim Size As New com.sun.star.awt.Size
+
Dim Grootte As New com.sun.star.awt.Size
Dim Hatch As New com.sun.star.drawing.Hatch
+
Dim Arcering As New com.sun.star.drawing.Hatch
  
Point.x = 1000
+
Punt.x = 1000
Point.y = 1000
+
Punt.y = 1000
Size.Width = 10000
+
Grootte.Width = 10000
Size.Height = 10000
+
Grootte.Height = 10000
  
 
Doc = ThisComponent
 
Doc = ThisComponent
Page = Doc.DrawPages(0)
+
Pagina = Doc.DrawPages(0)
  
RectangleShape = Doc.createInstance("com.sun.star.drawing.RectangleShape")
+
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RectangleShape.Size = Size
+
RechthoekVorm.Size = Grootte
RectangleShape.Position = Point
+
RechthoekVorm.Position = Punt
  
RectangleShape.FillStyle = com.sun.star.drawing.FillStyle.HATCH
+
RechthoekVorm.FillStyle = com.sun.star.drawing.FillStyle.HATCH
  
Hatch.Style = com.sun.star.drawing.HatchStyle.SINGLE
+
Arcering.Style = com.sun.star.drawing.HatchStyle.SINGLE
Hatch.Color = RGB(64,64,64)
+
Arcering.Color = RGB(64,64,64)
Hatch.Distance = 20
+
Arcering.Distance = 20
Hatch.Angle = 450
+
Arcering.Angle = 450
  
RectangleShape.FillHatch = Hatch
+
RechthoekVorm.FillHatch = Hatch
  
Page.add(RectangleShape)
+
Pagina.add(RechthoekVorm)
</source>
+
</syntaxhighlight>
  
This code creates a simple hatch structure (<tt>HatchStyle = SINGLE</tt>) whose lines are rotated 45 degrees (<tt>Angle</tt>). The lines are dark gray (<tt>Color</tt>) and are spaced is 0.2 millimeters (<tt>Distance</tt>) apart.
+
Deze code maakt een eenvoudige structuur voor arcering (<tt>HatchStyle = SINGLE</tt>) waarvan de lijnen gedraaid zijn onder een hoek van 45 graden (<tt>Angle</tt>). De lijnen zijn donkergrijs (<tt>Color</tt>) en liggen 0,2 millimeter (<tt>Distance</tt>) uit elkaar.
  
=== Bitmaps ===
+
=== Afbeeldingen ===
  
To use bitmap projection as a fill, you must set the <tt>FillStyle</tt> property to <tt>BITMAP</tt>. If the bitmap is already available in {{OOo}}, you just need to specify its name in the <tt>FillBitMapName</tt> property and its display style (simple, tiled, or elongated) in the <tt>FillBitmapMode</tt> property (default values in accordance with <idl>com.sun.star.drawing.BitmapMode</idl>).
+
U moet de eigenschap <tt>FillStyle</tt> instellen op <tt>BITMAP</tt> om een projectie van een afbeelding te gebruiken als vulling. Als de afbeelding al beschikbaar is in {{AOo}}, hoeft u alleen de naam te specificeren in de eigenschap <tt>FillBitMapName</tt> en zijn manier van zijn weergave (eenvoudig, getegeld of vergroot) in de eigenschap <tt>FillBitmapMode</tt> (standaardwaarden overeenkomend met <idl>com.sun.star.drawing.BitmapMode</idl>).
  
If you want to use an external bitmap file, you can specify its URL in the <tt>FillBitmapURL</tt> property.
+
Als u een extern afbeeldingsbestand wilt gebruiken, kunt u de URL daarvan specificeren in de eigenschap <tt>FillBitmapURL</tt>.
  
The following example creates a rectangle and tiles the Sky bitmap that is available in {{OOo}} to fill the area of the rectangle:
+
Het volgende voorbeeld maakt een rechthoek en tegelt de afbeelding Sky, die beschikbaar is in {{AOo}}, om het gebied van de rechthoek te vullen:
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
Dim Page As Object
+
Dim Pagina As Object
Dim RectangleShape As Object
+
Dim RechthoekVorm As Object
Dim Point As New com.sun.star.awt.Point
+
Dim Punt As New com.sun.star.awt.Point
Dim Size As New com.sun.star.awt.Size
+
Dim Grootte As New com.sun.star.awt.Size
  
Point.x = 1000
+
Punt.x = 1000
Point.y = 1000
+
Punt.y = 1000
Size.Width = 10000
+
Grootte.Width = 10000
Size.Height = 10000
+
Grootte.Height = 10000
  
 
Doc = ThisComponent
 
Doc = ThisComponent
 
Page = Doc.DrawPages(0)
 
Page = Doc.DrawPages(0)
  
RectangleShape = Doc.createInstance("com.sun.star.drawing.RectangleShape")
+
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RectangleShape.Size = Size
+
RechthoekVorm.Size = Grootte
RectangleShape.Position = Point
+
RechthoekVorm.Position = Punt
  
RectangleShape.FillStyle = com.sun.star.drawing.FillStyle.BITMAP
+
RechthoekVorm.FillStyle = com.sun.star.drawing.FillStyle.BITMAP
RectangleShape.FillBitmapName = "Sky"
+
RechthoekVorm.FillBitmapName = "Sky"
RectangleShape.FillBitmapMode = com.sun.star.drawing.BitmapMode.REPEAT
+
RechthoekVorm.FillBitmapMode = com.sun.star.drawing.BitmapMode.REPEAT
  
Page.add(RectangleShape)
+
Pagina.add(RechthoekVorm)
</source>
+
</syntaxhighlight>
  
=== Transparency ===
+
=== Transparantie ===
  
You can adjust the transparency of any fill that you apply. The simplest way to change the transparency of a drawing element is to use the <tt>FillTransparence</tt> property.
+
U kunt de transparantie aanpassen van elke vulling die u toepast. De eenvoudigste manier om de transparantie van een teken-element te veranderen is door de eigenschap <tt>FillTransparence</tt> te gebruiken.
  
The following example creates a red rectangle with a transparency of 50 percent.
+
Het volgende voorbeeld maakt een rode rechthoek met een transparantie van 50 procent.
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
Dim Page As Object
+
Dim Pagina As Object
Dim RectangleShape As Object
+
Dim RechthoekVorm As Object
Dim Point As New com.sun.star.awt.Point
+
Dim Punt As New com.sun.star.awt.Point
Dim Size As New com.sun.star.awt.Size
+
Dim Grootte As New com.sun.star.awt.Size
  
Point.x = 1000
+
Punt.x = 1000
Point.y = 1000
+
Punt.y = 1000
Size.Width = 10000
+
Grootte.Width = 10000
Size.Height = 10000
+
Grootte.Height = 10000
  
 
Doc = ThisComponent
 
Doc = ThisComponent
Page = Doc.DrawPages(0)
+
Pagina = Doc.DrawPages(0)
  
RectangleShape = Doc.createInstance("com.sun.star.drawing.RectangleShape")
+
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RectangleShape.Size = Size
+
RechthoekVorm.Size = Grootte
RectangleShape.Position = Point
+
RechthoekVorm.Position = Punt
  
RectangleShape.FillStyle = com.sun.star.drawing.FillStyle.SOLID
+
RechthoekVorm.FillStyle = com.sun.star.drawing.FillStyle.SOLID
RectangleShape.FillTransparence = 50
+
RechthoekVorm.FillTransparence = 50
RectangleShape.FillColor = RGB(255,0,0)
+
RechthoekVorm.FillColor = RGB(255,0,0)
 
   
 
   
Page.add(RectangleShape)
+
Pagina.add(RechthoekVorm)
</source>
+
</syntaxhighlight>
  
To make the fill transparent, set the <tt>FillTransparence</tt> property to 100.
+
Stel de eigenschap <tt>FillTransparence</tt> in op 100 om de vulling transparant te maken.
  
In addition to the <tt>FillTransparence</tt> property, the <idl>com.sun.star.drawing.FillProperties</idl> service also provides the <tt>FillTransparenceGradient</tt> property. This is used to define a gradient that specifies the transparency of a fill area.
+
In aanvulling op de eigenschap <tt>FillTransparence</tt> verschaft de service <idl>com.sun.star.drawing.FillProperties</idl> ook de
 +
eigenschap <tt>FillTransparenceGradient</tt>. Deze wordt gebruikt om een kleurverloop te definiëren dat de transparantie van een gebied voor de vulling specificeert.
  
=== Line Properties ===
+
=== Lijneigenschappen ===
  
All drawing objects that can have a border line support the <idl>com.sun.star.drawing.LineStyle</idl> service. Some of the properties that this service provides are:
+
Alle tekenobjecten die een randlijn kunnen hebben ondersteunen de service <idl>com.sun.star.drawing.LineStyle</idl>. Enkele van de eigenschappen die deze service verschaft zijn:
  
;<tt>LineStyle (Enum)</tt>:line type (default values in accordance with <idl>com.sun.star.drawing.LineStyle</idl>)
+
;<tt>LineStyle (Enum)</tt>:type lijn (standaardwaarden overeenkomend met <idl>com.sun.star.drawing.LineStyle</idl>)
;<tt>LineColor (Long)</tt>:line color
+
;<tt>LineColor (Long)</tt>:kleur van de lijn
;<tt>LineTransparence (Short)</tt>:line transparency
+
;<tt>LineTransparence (Short)</tt>:transparantie van de lijn
;<tt>LineWidth (Long)</tt>:line thickness in hundredths of a millimeter
+
;<tt>LineWidth (Long)</tt>:dikte van de lijn in 100-en van een millimeter
;<tt>LineJoint (Enum)</tt>:transitions to connection points (default values in accordance with <idl>com.sun.star.drawing.LineJoint</idl> )
+
;<tt>LineJoint (Enum)</tt>:transities naar verbindingspunten (standaard waarden overeenkomend met <idl>com.sun.star.drawing.LineJoint</idl> )
  
The following example creates a rectangle with a solid border (<tt>LineStyle = SOLID</tt>) that is 5 millimeters thick (<tt>LineWidth</tt>) and 50 percent transparent. The right and left-hand edges of the line extend to their points of intersect with each other (<tt>LineJoint = MITER</tt>) to form a right-angle.
+
Het volgende voorbeeld maakt een rechthoek met een doorlopende randlijn (<tt>LineStyle = SOLID</tt>) die 5 millimeter dik is (<tt>LineWidth</tt>) en 50 procent transparant. De rechter en linker-uiteinden van de lijn breiden zich uit tot het ontmoetingspunt met elkaar (<tt>LineJoint = MITER</tt>) om een rechte hoek te vormen.
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
Dim Page As Object
+
Dim Pagina As Object
Dim RectangleShape As Object
+
Dim RechthoekVorm As Object
Dim Point As New com.sun.star.awt.Point
+
Dim Punt As New com.sun.star.awt.Point
Dim Size As New com.sun.star.awt.Size
+
Dim Grootte As New com.sun.star.awt.Size
  
Point.x = 1000
+
Punt.x = 1000
Point.y = 1000
+
Punt.y = 1000
Size.Width = 10000
+
Grootte.Width = 10000
Size.Height = 10000
+
Grootte.Height = 10000
  
 
Doc = ThisComponent
 
Doc = ThisComponent
Page = Doc.DrawPages(0)
+
Pagina = Doc.DrawPages(0)
  
RectangleShape = Doc.createInstance("com.sun.star.drawing.RectangleShape")
+
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RectangleShape.Size = Size
+
RechthoekVorm.Size = Grootte
RectangleShape.Position = Point
+
RechthoekVorm.Position = Punt
  
RectangleShape.LineColor = RGB(128,128,128)
+
RechthoekVorm.LineColor = RGB(128,128,128)
RectangleShape.LineTransparence = 50
+
RechthoekVorm.LineTransparence = 50
RectangleShape.LineWidth = 500
+
RechthoekVorm.LineWidth = 500
RectangleShape.LineJoint = com.sun.star.drawing.LineJoint.MITER   
+
RechthoekVorm.LineJoint = com.sun.star.drawing.LineJoint.MITER   
  
RectangleShape.LineStyle = com.sun.star.drawing.LineStyle.SOLID
+
RechthoekVorm.LineStyle = com.sun.star.drawing.LineStyle.SOLID
  
Page.add(RectangleShape)
+
Pagina.add(RechthoekVorm)
</source>
+
</syntaxhighlight>
  
In addition to the listed properties, the <idl>com.sun.star.drawing.LineStyle</idl> service provides options for drawing dotted and dashed lines. For more information, see the {{OOo}} API reference.
+
In aanvulling op de vermelde eigenschappen, verschaft de service <idl>com.sun.star.drawing.LineStyle</idl> opties voor het tekenen van lijnen met punten en streepjes. Voor meer informatie, zie de verwijzing naar de API van {{OOo}}.
  
=== Text Properties (Drawing Objects) ===
+
=== Eigenschappen voor tekst (tekenobjecten) ===
  
The <idl>com.sun.star.style.CharacterProperties</idl> and <idl>com.sun.star.style.ParagraphProperties</idl> services can format text in drawing objects. These services relate to individual characters and paragraphs and are described in detail in [[Documentation/BASIC Guide/Text Documents|Text Documents]].
+
De services <idl>com.sun.star.style.CharacterProperties</idl> en <idl>com.sun.star.style.ParagraphProperties</idl> kunnen tekst opmaken in tekenobjecten. Deze services relateren aan de individuele tekens en alinea's en worden in detail beschreven in [[NL/Documentation/BASIC Guide/Text Documents|Tekstdocumenten]].
  
The following example inserts text in a rectangle and formats the font <idl>com.sun.star.style.CharacterProperties</idl> service.
+
Het volgende voorbeeld voegt een tekst in in een rechthoek en maakt de service voor het lettertype <idl>com.sun.star.style.CharacterProperties</idl> op.
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
Dim Page As Object
+
Dim Pagina As Object
Dim RectangleShape As Object
+
Dim RechthoekVorm As Object
Dim Point As New com.sun.star.awt.Point
+
Dim Punt As New com.sun.star.awt.Point
Dim Size As New com.sun.star.awt.Size
+
Dim Grootte As New com.sun.star.awt.Size
Point.x = 1000
+
Punt.x = 1000
Point.y = 1000
+
Punt.y = 1000
Size.Width = 10000
+
Grootte.Width = 10000
Size.Height = 10000
+
Grootte.Height = 10000
 
Doc = ThisComponent
 
Doc = ThisComponent
Page = Doc.DrawPages(0)
+
Pagina = Doc.DrawPages(0)
  
RectangleShape = Doc.createInstance("com.sun.star.drawing.RectangleShape")
+
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RectangleShape.Size = Size
+
RechthoekVorm.Size = Grootte
RectangleShape.Position = Point
+
RechthoekVorm.Position = Punt
  
Page.add(RectangleShape)
+
Pagina.add(RechthoekVorm)
  
RectangleShape.String = "This is a test"
+
RechthoekVorm.String = "Dit is een test"
RectangleShape.CharWeight = com.sun.star.awt.FontWeight.BOLD
+
RechthoekVorm.CharWeight = com.sun.star.awt.FontWeight.BOLD
RectangleShape.CharFontName = "Arial"
+
RechthoekVorm.CharFontName = "Arial"
</source>
+
</syntaxhighlight>
  
This code uses the <tt>String</tt>-property of the rectangle to insert the text and the <tt>CharWeight</tt> and <tt>CharFontName</tt> properties from the <idl>com.sun.star.style.CharacterProperties</idl> service to format the text font.
+
Deze code gebruikt de eigenschap <tt>String</tt> van de rechthoek om de tekst in te voegen en de eigenschappen <tt>CharWeight</tt> en <tt>CharFontName</tt> uit de service <idl>com.sun.star.style.CharacterProperties</idl> om het lettertype van de tekst op te maken.
  
The text can only be inserted after the drawing object has been added to the drawing page. You can also use the <idl>com.sun.star.drawing.Text</idl> service to position and format text in drawing object. The following are some of the important properties of this service:
+
De tekst kan alleen worden ingevoegd nadat het tekenobject is toegevoegd aan de tekenpagina. U kunt ook de service <idl>com.sun.star.drawing.Text</idl> gebruiken om de tekst te positioneren en op te maken in het tekenobject. Hier volgen enkele van de belangrijkste eigenschappen van deze service:
  
;<tt>TextAutoGrowHeight (Boolean)</tt>:adapts the height of the drawing element to the text it contains
+
;<tt>TextAutoGrowHeight (Boolean)</tt>:past de hoogte van het tekenelement aan aan de tekst die het bevat
;<tt>TextAutoGrowWidth (Boolean)</tt>:adapts the width of the drawing element to the text it contains
+
;<tt>TextAutoGrowWidth (Boolean)</tt>:past de breedte van het tekenelement aan aan de tekst die het bevat
;<tt>TextHorizontalAdjust (Enum)</tt>:horizontal position of text within the drawing element (default values in accordance with <idl>com.sun.star.drawing.TextHorizontalAdjust</idl>)
+
;<tt>TextHorizontalAdjust (Enum)</tt>:horizontale positie van de tekst binnen het tekenelement (standaard waarden overeenkomend met <idl>com.sun.star.drawing.TextHorizontalAdjust</idl>)
;<tt>TextVerticalAdjust (Enum)</tt>:vertical position of text within the drawing element (default values in accordance with <idl>com.sun.star.drawing.TextVerticalAdjust</idl>)
+
;<tt>TextVerticalAdjust (Enum)</tt>:verticale positie van de tekst binnen het tekenelement (standaard waarden overeenkomend met <idl>com.sun.star.drawing.TextVerticalAdjust</idl>)
;<tt>TextLeftDistance (Long)</tt>:left-hand distance between drawing element and text in hundredths of a millimeter
+
;<tt>TextLeftDistance (Long)</tt>:afstand links tussen het tekenelement en de tekst in 100-en van een millimeter
;<tt>TextRightDistance (Long)</tt>:right-hand distance between drawing element and text in hundredths of a millimeter
+
;<tt>TextRightDistance (Long)</tt>:afstand rechts tussen het tekenelement en de tekst in 100-en van een millimeter
;<tt>TextUpperDistance (Long)</tt>:upper distance between drawing element and text in hundredths of a millimeter
+
;<tt>TextUpperDistance (Long)</tt>:afstand boven tussen het tekenelement en de tekst in 100-en van een millimeter
;<tt>TextLowerDistance (Long)</tt>:lower distance between drawing element and text in hundredths of a millimeter
+
;<tt>TextLowerDistance (Long)</tt>:afstand onder tussen het tekenelement en de tekst in 100-en van een millimeter
  
The following example demonstrates use of the named properties.
+
Het volgende voorbeeld demonstreert het gebruik van de genoemde eigenschappen.
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
Dim Page As Object
+
Dim Pagina As Object
Dim RectangleShape As Object
+
Dim RechthoekVorm As Object
Dim Point As New com.sun.star.awt.Point
+
Dim Punt As New com.sun.star.awt.Point
Dim Size As New com.sun.star.awt.Size
+
Dim Grootte As New com.sun.star.awt.Size
  
Point.x = 1000
+
Punt.x = 1000
Point.y = 1000
+
Punt.y = 1000
Size.Width = 10000
+
Grootte.Width = 10000
Size.Height = 10000
+
Grootte.Height = 10000
  
 
Doc = ThisComponent
 
Doc = ThisComponent
Page = Doc.DrawPages(0)
+
Pagina = Doc.DrawPages(0)
  
RectangleShape = Doc.createInstance("com.sun.star.drawing.RectangleShape")
+
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RectangleShape.Size = Size
+
RechthoekVorm.Size = Grootte
RectangleShape.Position = Point
+
RechthoekVorm.Position = Punt
  
Page.add(RectangleShape)
+
Pagina.add(RechthoekVorm)
  
RectangleShape.String = "This is a test"  ' May only take place after Page.add!
+
RechthoekVorm.String = "Dit is een test"  ' Kan alleen plaatsvinden na Pagina.add!
  
RectangleShape.TextVerticalAdjust = com.sun.star.drawing.TextVerticalAdjust.TOP
+
RechthoekVorm.TextVerticalAdjust = com.sun.star.drawing.TextVerticalAdjust.TOP
RectangleShape.TextHorizontalAdjust = com.sun.star.drawing.TextHorizontalAdjust.LEFT
+
RechthoekVorm.TextHorizontalAdjust = com.sun.star.drawing.TextHorizontalAdjust.LEFT
  
RectangleShape.TextLeftDistance = 300
+
RechthoekVorm.TextLeftDistance = 300
RectangleShape.TextRightDistance = 300
+
RechthoekVorm.TextRightDistance = 300
RectangleShape.TextUpperDistance = 300
+
RechthoekVorm.TextUpperDistance = 300
RectangleShape.TextLowerDistance = 300
+
RechthoekVorm.TextLowerDistance = 300
</source>
+
</syntaxhighlight>
  
This code inserts a drawing element in a page and then adds text to the top left corner of the drawing object using the <tt>TextVerticalAdjust</tt> and <tt>TextHorizontalAdjust</tt> properties. The minimum distance between the text edge of the drawing object is set to three millimeters.
+
Deze code voegt een tekenelement in op een pagina en voegt dan tekst toe aan de linkerbovenhoek van het tekenobject met behulp van de eigenschappen <tt>TextVerticalAdjust</tt> en <tt>TextHorizontalAdjust</tt>. De minimum afstand tussen de tekst en de rand van het teken-object is ingesteld op drie millimeters
  
=== Shadow Properties ===
+
=== Eigenschappen voor schaduw ===
  
You can add a shadow to most drawing objects with the <idl>com.sun.star.drawing.ShadowProperties</idl> service. The properties of this service are:
+
U kunt een schaduw toevoegen aan de meeste teken-objecten met de
 +
service <idl>com.sun.star.drawing.ShadowProperties</idl>. De eigenschappen van deze service zijn:
  
;<tt>Shadow (Boolean)</tt>:activates the shadow
+
;<tt>Shadow (Boolean)</tt>:activeert de schaduw
;<tt>ShadowColor (Long)</tt>:shadow color
+
;<tt>ShadowColor (Long)</tt>:kleur van de schaduw
;<tt>ShadowTransparence (Short)</tt>:transparency of the shadow
+
;<tt>ShadowTransparence (Short)</tt>:transparantie van de schaduw
;<tt>ShadowXDistance (Long)</tt>:vertical distance of the shadow from the drawing object in hundredths of a millimeter
+
;<tt>ShadowXDistance (Long)</tt>:verticale afstand van de schaduw tot het tekenobject in 100-en van een millimeter
;<tt>ShadowYDistance (Long)</tt>:horizontal distance of the shadow from the drawing object in hundredths of a millimeter
+
;<tt>ShadowYDistance (Long)</tt>:horizontale afstand van de schaduw tot het tekenobject in 100-en van een millimeter
  
The following example creates a rectangle with a shadow that is vertically and horizontally offset from the rectangle by 2 millimeters. The shadow is rendered in dark gray with 50 percent transparency.
+
Het volgende voorbeeld maakt een rechthoek met een schaduw die verticaal en horizontaal buiten de rechthoek steekt tot 2 millimeters. De schaduw wordt uitgevoerd in donkergrijs met 50 procent transparantie.
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
Dim Page As Object
+
Dim Pagina As Object
Dim RectangleShape As Object
+
Dim RechthoekVorm As Object
Dim Point As New com.sun.star.awt.Point
+
Dim Punt As New com.sun.star.awt.Point
Dim Size As New com.sun.star.awt.Size
+
Dim Grootte As New com.sun.star.awt.Size
  
Point.x = 1000
+
Punt.x = 1000
Point.y = 1000
+
Punt.y = 1000
Size.Width = 10000
+
Grootte.Width = 10000
Size.Height = 10000
+
Grootte.Height = 10000
  
 
Doc = ThisComponent
 
Doc = ThisComponent
Page = Doc.DrawPages(0)
+
Pagina = Doc.DrawPages(0)
  
RectangleShape = Doc.createInstance("com.sun.star.drawing.RectangleShape")
+
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RectangleShape.Size = Size
+
RechthoekVorm.Size = Grootte
RectangleShape.Position = Point
+
RechthoekVorm.Position = Punt
  
RectangleShape.Shadow = True
+
RechthoekVorm.Shadow = True
RectangleShape.ShadowColor = RGB(192,192,192)
+
RechthoekVorm.ShadowColor = RGB(192,192,192)
RectangleShape.ShadowTransparence = 50
+
RechthoekVorm.ShadowTransparence = 50
RectangleShape.ShadowXDistance = 200  
+
RechthoekVorm.ShadowXDistance = 200  
RectangleShape.ShadowYDistance = 200
+
RechthoekVorm.ShadowYDistance = 200
  
Page.add(RectangleShape)
+
Pagina.add(RechthoekVorm)
</source>
+
</syntaxhighlight>
  
== An Overview of Various Drawing Objects ==
+
== Een overzicht van de verschillende tekenobjecten ==
  
=== Rectangle Shapes ===
+
=== Rechthoekige vormen ===
  
Rectangle shape objects (<idl>com.sun.star.drawing.RectangleShape</idl>) support the following services for formatting objects:
+
Objecten met een rechthoekige vorm  (<idl>com.sun.star.drawing.RectangleShape</idl>) ondersteunen de volgende services voor het opmaken van objecten:
  
;<tt>Fill properties</tt>:<idl>com.sun.star.drawing.FillProperties</idl>
+
;<tt>Eigenschappen voor vulling</tt>:<idl>com.sun.star.drawing.FillProperties</idl>
;<tt>Line properties</tt>:<idl>com.sun.star.drawing.LineProperties</idl>
+
;<tt>Eigenschappen voor lijnen</tt>:<idl>com.sun.star.drawing.LineProperties</idl>
;<tt>Text properties</tt>:<idl>com.sun.star.drawing.Text</idl> (with <idl>com.sun.star.style.CharacterProperties</idl> and <idl>com.sun.star.style.ParagraphProperties</idl>)
+
;<tt>Eigenschappen voor tekst</tt>:<idl>com.sun.star.drawing.Text</idl> (met <idl>com.sun.star.style.CharacterProperties</idl> en <idl>com.sun.star.style.ParagraphProperties</idl>)
;<tt>Shadow properties</tt>:<idl>com.sun.star.drawing.ShadowProperties</idl>
+
;<tt>Eigenschappen voor schaduw</tt>:<idl>com.sun.star.drawing.ShadowProperties</idl>
;<tt>CornerRadius (Long)</tt>:radius for rounding corners in hundredths of a millimeter
+
;<tt>CornerRadius (Long)</tt>:radius voor het afronden van hoeken in 100-en van een millimeter
  
=== Circles and Ellipses ===
+
=== Cirkels en ellipsem ===
  
The Service <idl>com.sun.star.drawing.EllipseShape</idl> service is responsible for circles and ellipses and supports the following services:
+
De service <idl>com.sun.star.drawing.EllipseShape</idl> is verantwoordelijk voor cirkels en ellipsen en ondersteunt de volgende services:
  
;<tt>Fill properties</tt>:<idl>com.sun.star.drawing.FillProperties</idl>
+
;<tt>Eigenschappen voor vulling</tt>:<idl>com.sun.star.drawing.FillProperties</idl>
;<tt>Line properties</tt>:<idl>com.sun.star.drawing.LineProperties</idl>
+
;<tt>Eigenschappen voor lijnen</tt>:<idl>com.sun.star.drawing.LineProperties</idl>
;<tt>Text properties</tt>:<idl>com.sun.star.drawing.Text</idl> (with <idl>com.sun.star.style.CharacterProperties</idl> and <idl>com.sun.star.style.ParagraphProperties</idl>)
+
;<tt>Eigenschappen voor tekst</tt>:<idl>com.sun.star.drawing.Text</idl> (met <idl>com.sun.star.style.CharacterProperties</idl> en <idl>com.sun.star.style.ParagraphProperties</idl>)
;<tt>Shadow properties</tt>:<idl>com.sun.star.drawing.ShadowProperties</idl>
+
;<tt>Eigenschappen voor schaduw</tt>:<idl>com.sun.star.drawing.ShadowProperties</idl>
  
In addition to these services, circles and ellipses also provide these properties:
+
In aanvulling op deze services, verschaffen cirkels en ellipsen ook deze eigenschappen:
  
;<tt>CircleKind (Enum)</tt>:type of circle or ellipse (default values in accordance with <idl>com.sun.star.drawing.CircleKind</idl> )
+
;<tt>CircleKind (Enum)</tt>:type cirkel of ellips (standaard waarden die overeenkomen met <idl>com.sun.star.drawing.CircleKind</idl> )
;<tt>CircleStartAngle (Long)</tt>:start angle in tenths of a degree (only for circle or ellipse segments)
+
;<tt>CircleStartAngle (Long)</tt>:beginhoek in tienden van graden (alleen voor segmenten van cirkel of ellips)
;<tt>CircleEndAngle (Long)</tt>:end angle in tenths of a degree (only for circle or ellipse segments)
+
;<tt>CircleEndAngle (Long)</tt>:eindhoek in tienden van graden (alleen voor segmenten van cirkel of ellips)
  
The <tt>CircleKind</tt> property determines if an object is a complete circle, a circular slice, or a section of a circle. The following values are available:
+
De eigenschap <tt>CircleKind</tt> bepaalt of een object een complete cirkel is, een cirkelsegment of een sector van een cirkel. De volgende waarden zijn beschikbaar:
  
;<idl>com.sun.star.drawing.CircleKind.FULL</idl>:full circle or full ellipse
+
;<idl>com.sun.star.drawing.CircleKind.FULL</idl>:volledige cirkel of volledige ellips
;<idl>com.sun.star.drawing.CircleKind.CUT</idl>:section of circle (partial circle whose interfaces are linked directly to one another)
+
;<idl>com.sun.star.drawing.CircleKind.CUT</idl>:cirkelsegment (gedeeltelijk cirkel waarvan de interfaces direct aan elkaar gekoppeld zijn)
;<idl>com.sun.star.drawing.CircleKind.SECTION</idl>:circle slice
+
;<idl>com.sun.star.drawing.CircleKind.SECTION</idl>:cirkelsegment
;<idl>com.sun.star.drawing.CircleKind.ARC</idl>:angle (not including circle line)
+
;<idl>com.sun.star.drawing.CircleKind.ARC</idl>:hoek (niet inclusief de rand van de cirkel)
  
The following example creates a circular slice with a 70 degree angle (produced from difference between start angle of 20 degrees and end angle of 90 degrees)
+
Het volgende voorbeeld maakt een cirkelsegment met een 70 graden hoek (geproduceerd uit het verschil van de starthoek van 20 graden en de eindhoek van 90 graden):
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
Dim Page As Object
+
Dim Pagina As Object
Dim EllipseShape As Object
+
Dim EllipsVorm As Object
Dim Point As New com.sun.star.awt.Point
+
Dim Punt As New com.sun.star.awt.Point
Dim Size As New com.sun.star.awt.Size
+
Dim Grootte As New com.sun.star.awt.Size
  
Point.x = 1000
+
Punt.x = 1000
Point.y = 1000
+
Punt.y = 1000
Size.Width = 10000
+
Grootte.Width = 10000
Size.Height = 10000
+
Grootte.Height = 10000
  
 
Doc = ThisComponent
 
Doc = ThisComponent
Page = Doc.DrawPages(0)
+
Pagina = Doc.DrawPages(0)
  
EllipseShape = Doc.createInstance("com.sun.star.drawing.EllipseShape")
+
EllipsVorm = Doc.createInstance("com.sun.star.drawing.EllipseShape")
EllipseShape.Size = Size
+
EllipsVorm.Size = Grootte
EllipseShape.Position = Point
+
EllipsVorm.Position = Punt
  
EllipseShape.CircleStartAngle = 2000
+
EllipsVorm.CircleStartAngle = 2000
EllipseShape.CircleEndAngle = 9000
+
EllipsVorm.CircleEndAngle = 9000
EllipseShape.CircleKind =  com.sun.star.drawing.CircleKind.SECTION
+
EllipsVorm.CircleKind =  com.sun.star.drawing.CircleKind.SECTION
  
Page.add(EllipseShape)
+
Pagina.add(EllipsVorm)
</source>
+
</syntaxhighlight>
  
=== Lines ===
+
=== Lijnen ===
  
{{OOo}} provides the <idl>com.sun.star.drawing.LineShape</idl> service for line objects. Line objects support all of the general formatting services with the exception of areas. The following are all of the properties that are associated with the <tt>LineShape</tt> service:
+
{{OOo}} verschaft de service <idl>com.sun.star.drawing.LineShape</idl> voor lijn-objecten. Lijn-objecten ondersteunen alle algemene opmaak-services met uitzondering van die van gebieden. Hieronder volgen alle eigenschappen die zijn verbonden met de service <tt>LineShape</tt>:
  
;<tt>Line properties</tt>:<idl>com.sun.star.drawing.LineProperties</idl>
+
;<tt>Eigenschappen voor lijnen</tt>:<idl>com.sun.star.drawing.LineProperties</idl>
;<tt>Text properties</tt>:<idl>com.sun.star.drawing.Text</idl> (with <idl>com.sun.star.style.CharacterProperties</idl> and <idl>com.sun.star.style.ParagraphProperties</idl>)
+
;<tt>Eigenschappen voor tekst</tt>:<idl>com.sun.star.drawing.Text</idl> (met <idl>com.sun.star.style.CharacterProperties</idl> en <idl>com.sun.star.style.ParagraphProperties</idl>)
;<tt>Shadow properties</tt>:<idl>com.sun.star.drawing.ShadowProperties</idl>
+
;<tt>Eigenschappen voor schaduw</tt>:<idl>com.sun.star.drawing.ShadowProperties</idl>
  
The following example creates and formats a line with the help of the named properties. The origin of the line is specified in the <tt>Location</tt> property, whereas the coordinates listed in the <tt>Size</tt> property specify the end point of the line.
+
Het volgende voorbeeld maakt een lijn en maakt die op met de hulp van de genoemde eigenschappen. De oorsprong van de lijn wordt gespecificeerd in de eigenschap <tt>Location</tt>, waarbij de coördinaten opgesomd in de eigenschap <tt>Size</tt>, het eindpunt van de lijn aangeven.
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
Dim Page As Object
+
Dim Pagina As Object
Dim LineShape As Object
+
Dim LijnVorm As Object
Dim Point As New com.sun.star.awt.Point
+
Dim Punt As New com.sun.star.awt.Point
Dim Size As New com.sun.star.awt.Size
+
Dim Grootte As New com.sun.star.awt.Size
  
Point.x = 1000
+
Punt.x = 1000
Point.y = 1000
+
Punt.y = 1000
Size.Width = 10000
+
Grootte.Width = 10000
Size.Height = 10000
+
Grootte.Height = 10000
  
 
Doc = ThisComponent
 
Doc = ThisComponent
Page = Doc.DrawPages(0)
+
Pagina = Doc.DrawPages(0)
 
   
 
   
LineShape = Doc.createInstance("com.sun.star.drawing.LineShape")
+
LijnVorm = Doc.createInstance("com.sun.star.drawing.LineShape")
LineShape.Size = Size
+
LijnVorm.Size = Grootte
LineShape.Position = Point
+
LijnVorm.Position = Punt
  
Page.add(LineShape)
+
Pagina.add(LijnVorm)
</source>
+
</syntaxhighlight>
  
=== Polypolygon Shapes ===
+
=== Veelhoekige vormen ===
  
{{OOo}} also supports complex polygonal shapes through the <idl>com.sun.star.drawing.PolyPolygonShape</idl> service. Strictly speaking, a PolyPolygon is not a simple polygon but a multiple polygon. Several independent lists containing corner points can therefore be specified and combined to form a complete object.
+
{{AOo}} ondersteunt ook complexe veelhoekige vormen door de service <idl>com.sun.star.drawing.PolyPolygonShape</idl>. Strikt gesproken is een PolyPolygoon niet een eenvoudige veelhoek, maar een meervoudige veelhoek. Verschillende onafhankelijke lijsten die hoekpunten bevatten kunnen daardoor worden gespecificeerd en gecombineerd om een compleet object te vormen.
  
As with rectangle shapes, all the formatting properties of drawing objects are also provided for polypolygons:
+
Net als met rechthoekige vormen worden alle eigenschappen voor opmaak van teken-objecten ook verschaft voor meervoudige veelhoeken:
  
;<tt>Fill properties</tt>:<idl>com.sun.star.drawing.FillProperties</idl>
+
;<tt>Eigenschappen voor vulling</tt>:<idl>com.sun.star.drawing.FillProperties</idl>
;<tt>Line properties</tt>:<idl>com.sun.star.drawing.LineProperties</idl>
+
;<tt>Eigenschappen voor lijnen</tt>:<idl>com.sun.star.drawing.LineProperties</idl>
;<tt>Text properties</tt>:<idl>com.sun.star.drawing.Text</idl> (with <idl>com.sun.star.style.CharacterProperties</idl> and <idl>com.sun.star.style.ParagraphProperties</idl>)
+
;<tt>Eigenschappen voor tekst</tt>:<idl>com.sun.star.drawing.Text</idl> (met <idl>com.sun.star.style.CharacterProperties</idl> en <idl>com.sun.star.style.ParagraphProperties</idl>)
;<tt>Shadow properties</tt>:<idl>com.sun.star.drawing.ShadowProperties</idl>
+
;<tt>Eigenschappen voor schaduw</tt>:<idl>com.sun.star.drawing.ShadowProperties</idl>
  
The <tt>PolyPolygonShape</tt> service also has a property that lets you define the coordinates of a polygon:
+
De service <tt>PolyPolygonShape</tt> heeft ook een eigenschap die u de coördinaten van een veelhoek laten definiëren:
  
* <tt>PolyPolygon (Array)</tt> – field containing the coordinates of the polygon (double array with points of the <idl>com.sun.star.awt.Point</idl> type)
+
* <tt>PolyPolygon (Array)</tt> – veld dat de coördinaten van de veelhoek bevat (dubbele tabel met de punten van het type <idl>com.sun.star.awt.Point</idl>)
  
The following example shows how you can define a triangle with the <tt>PolyPolygonShape</tt> service.
+
Het volgende voorbeeld toont hoe u een driehoek kunt definiëren met de service <tt>PolyPolygonShape</tt>.
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
Dim Page As Object
+
Dim Pagina As Object
Dim PolyPolygonShape As Object
+
Dim VeelhoekVorm As Object
Dim PolyPolygon As Variant
+
Dim Veelhoek As Variant
Dim Coordinates(2) As New com.sun.star.awt.Point
+
Dim Coördinaten(2) As New com.sun.star.awt.Point
  
 
Doc = ThisComponent
 
Doc = ThisComponent
Page = Doc.DrawPages(0)
+
Pagina = Doc.DrawPages(0)
  
PolyPolygonShape = Doc.createInstance("com.sun.star.drawing.PolyPolygonShape")
+
VeelhoekVorm = Doc.createInstance("com.sun.star.drawing.PolyPolygonShape")
Page.add(PolyPolygonShape)  ' Page.add must take place before the coordinates are set
+
Pagina.add(VeelhoekVorm)  ' Pagina.add moet plaatsvinden voordat de coördianten worden ingesteld
  
Coordinates(0).x = 1000
+
Coördinaten(0).x = 1000
Coordinates(1).x = 7500
+
Coördinaten(1).x = 7500
Coordinates(2).x = 10000
+
Coördinaten(2).x = 10000
Coordinates(0).y = 1000
+
Coördinaten(0).y = 1000
Coordinates(1).y = 7500
+
Coördinaten(1).y = 7500
Coordinates(2).y = 5000
+
Coördinaten(2).y = 5000
  
PolyPolygonShape.PolyPolygon = Array(Coordinates())
+
VeelhoekVorm.PolyPolygon = Array(Coördinaten())
</source>
+
</syntaxhighlight>
  
Since the points of a polygon are defined as absolute values, you do not need to specify the size or the start position of a polygon. Instead, you need to create an array of the points, package this array in a second array (using the <tt>Array(Coordinates())</tt> call), and then assign this array to the polygon. Before the corresponding call can be made, the polygon must be inserted into the document.
+
Omdat de punten van een veelhoek worden gedefinieerd als absolute waarden, hoeft u de grootte of de startpositie van een veelhoek niet te specificeren. In plaats daarvan moet u een tabel van de punten maken, dit verpakken in een tweede tabel (met behulp van de aanroep <tt>Array(Coordinates())</tt>), en dan die tabel toewijzen aan de veelhoek. Voordat de corresponderende aanroep kan worden uitgevoerd, moet de veelhoek worden ingevoegd in het document.
  
The double array in the definition allows you to create complex shapes by merging several polygons. For example, you can create a rectangle and then insert another rectangle inside it to create a hole in the original rectangle:
+
De dubbele array in de definitie staat u toe complexe vormen te maken door verschillende veelhoeken samen te voegen. Bijvoorbeeld, u kunt een rechthoek maken en daarin dan een andere rechthoek plaatsen om een gat in de originele rechthoek te maken:
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
Dim Page As Object
+
Dim Pagina As Object
Dim PolyPolygonShape As Object
+
Dim VeelhoekVorm As Object
Dim PolyPolygon As Variant
+
Dim Veelhoek As Variant
Dim Square1(3) As New com.sun.star.awt.Point
+
Dim Vierkant1(3) As New com.sun.star.awt.Point
Dim Square2(3) As New com.sun.star.awt.Point
+
Dim Vierkant2(3) As New com.sun.star.awt.Point
Dim Square3(3) As New com.sun.star.awt.Point
+
Dim Vierkant3(3) As New com.sun.star.awt.Point
  
 
Doc = ThisComponent
 
Doc = ThisComponent
Page = Doc.DrawPages(0)
+
Pagina = Doc.DrawPages(0)
  
PolyPolygonShape = Doc.createInstance("com.sun.star.drawing.PolyPolygonShape")
+
VeelhoekVorm = Doc.createInstance("com.sun.star.drawing.PolyPolygonShape")
  
Page.add(PolyPolygonShape)  ' Page.add must take place before the coordinates are set
+
Pagina.add(VeelhoekVorm)  ' Pagina.add moet plaatsvinden voordat de coördinaten worden ingesteld
  
Square1(0).x = 5000
+
Vierkant1(0).x = 5000
Square1(1).x = 10000
+
Vierkant1(1).x = 10000
Square1(2).x = 10000
+
Vierkant1(2).x = 10000
Square1(3).x = 5000
+
Vierkant1(3).x = 5000
Square1(0).y = 5000
+
Vierkant1(0).y = 5000
Square1(1).y = 5000
+
Vierkant1(1).y = 5000
Square1(2).y = 10000
+
Vierkant1(2).y = 10000
Square1(3).y = 10000
+
Vierkant1(3).y = 10000
  
Square2(0).x = 6500
+
Vierkant2(0).x = 6500
Square2(1).x = 8500
+
Vierkant2(1).x = 8500
Square2(2).x = 8500
+
Vierkant2(2).x = 8500
Square2(3).x = 6500
+
Vierkant2(3).x = 6500
Square2(0).y = 6500
+
Vierkant2(0).y = 6500
Square2(1).y = 6500
+
Vierkant2(1).y = 6500
Square2(2).y = 8500
+
Vierkant2(2).y = 8500
Square2(3).y = 8500
+
Vierkant2(3).y = 8500
  
Square3(0).x = 6500
+
Vierkant3(0).x = 6500
Square3(1).x = 8500
+
Vierkant3(1).x = 8500
Square3(2).x = 8500
+
Vierkant3(2).x = 8500
Square3(3).x = 6500
+
Vierkant3(3).x = 6500
Square3(0).y = 9000
+
Vierkant3(0).y = 9000
Square3(1).y = 9000
+
Vierkant3(1).y = 9000
Square3(2).y = 9500
+
Vierkant3(2).y = 9500
Square3(3).y = 9500
+
Vierkant3(3).y = 9500
  
PolyPolygonShape.PolyPolygon = Array(Square1(), Square2(), Square3())
+
VeelhoekVorm.PolyPolygon = Array(Vierkant1(), Vierkant2(), Vierkant3())
</source>
+
</syntaxhighlight>
  
With respect as to which areas are filled and which areas are holes, {{OOo}} applies a simple rule: the edge of the outer shape is always the outer border of the polypolygon. The next line inwards is the inner border of the shape and marks the transition to the first hole. If there is another line inwards, it marks the transition to a filled area.
+
Ten aanzien van het feit welk gebied wordt gevuld en welk gebied gaten zijn, hanteert {{AOo}} een eenvoudige regel: de rand van de buitenste vorm is altijd de buitenste grens van de meervoudige veelhoek. De volgende lijn binnenwaarts is de binnengrens van de vorm en markeert de overgang naar het eerste gat. Als er nog een lijn binnenwaarts is, markeert die de overgang naar een gevuld gebied.
  
=== Graphics ===
+
=== Afbeeldingen ===
  
The last of the drawing elements presented here are graphic objects that are based on the <idl>com.sun.star.drawing.GraphicObjectShape</idl> service. These can be used with any graphic within {{OOo}} whose appearance can be adapted using a whole range of properties.
+
De laatste van de hier gepresenteerde tekenelementen zijn de grafische objecten die zijn gebaseerd op de service <idl>com.sun.star.drawing.GraphicObjectShape</idl>. Deze kan worden gebruikt met elke afbeelding binnen {{AOo}} waarvan het uiterlijk kan worden opgenomen met behulp van een heel bereik aan eigenschappen.
  
Graphic objects support two of the general formatting properties:
+
Grafische objecten ondersteunen twee van de algemene eigenschappen voor opmaak :
  
;<tt>Text properties</tt>:<idl>com.sun.star.drawing.Text</idl> (with <idl>com.sun.star.style.CharacterProperties</idl> and <idl>com.sun.star.style.ParagraphProperties</idl>)
+
;<tt>Eigenschappen voor tekst</tt>:<idl>com.sun.star.drawing.Text</idl> (met <idl>com.sun.star.style.CharacterProperties</idl> en <idl>com.sun.star.style.ParagraphProperties</idl>)
;<tt>Shadow properties</tt>:<idl>com.sun.star.drawing.ShadowProperties</idl>
+
;<tt>Eigenschappen voor schaduw</tt>:<idl>com.sun.star.drawing.ShadowProperties</idl>
  
Additional properties that are supported by graphic objects are:
+
Aanvullende eigenschappen die worden ondersteund door grafische objecten zijn:
  
;<tt>GraphicURL (String)</tt>:URL of the graphic
+
;<tt>GraphicURL (String)</tt>:URL van de afbeelding
;<tt>AdjustLuminance (Short)</tt>:luminance of the colors, as a percentage (negative values are also permitted)
+
;<tt>AdjustLuminance (Short)</tt>:helderheid van de kleuren als een percentage (negatieve waarden zijn ook toegestaan)
;<tt>AdjustContrast (Short)</tt>:contrast as a percentage (negative values are also permitted)
+
;<tt>AdjustContrast (Short)</tt>:contrast als een percentage (negatieve waarden zijn ook toegestaan)
;<tt>AdjustRed (Short)</tt>:red value as a percentage (negative values are also permitted)
+
;<tt>AdjustRed (Short)</tt>:waarde voor rood als een percentage (negatieve waarden zijn ook toegestaan)
;<tt>AdjustGreen (Short)</tt>:green value as a percentage (negative values are also permitted)
+
;<tt>AdjustGreen (Short)</tt>:waarde voor groen als een percentage (negatieve waarden zijn ook toegestaan)
;<tt>AdjustBlue (Short)</tt>:blue value as a percentage (negative values are also permitted)
+
;<tt>AdjustBlue (Short)</tt>:waarde voor blauw als een percentage (negatieve waarden zijn ook toegestaan)
;<tt>Gamma (Short)</tt>:gamma value of a graphic
+
;<tt>Gamma (Short)</tt>:gamma-waarde van een afbeelding
;<tt>Transparency (Short)</tt>:transparency of a graphic as a percentage
+
;<tt>Transparency (Short)</tt>:transparantie van een afbeelding als een percentage;<tt>GraphicColorMode (enum)</tt>:modus kleur, bijvoorbeeld: standaard, grijswaarden, zwart en wit (standaard waarde overeenkomend met <idl>com.sun.star.drawing.ColorMode</idl> )
;<tt>GraphicColorMode (enum)</tt>:color mode, for example, standard, gray stages, black and white (default value in accordance with <idl>com.sun.star.drawing.ColorMode</idl> )
+
  
The following example shows how to insert a page into a graphics object.
+
Het volgende voorbeeld toont hoe een pagina in een grafisch object in te voegen.
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
Dim Page As Object
+
Dim Pagina As Object
Dim GraphicObjectShape As Object
+
Dim GrafischObjectVorm As Object
Dim Point As New com.sun.star.awt.Point
+
Dim Punt As New com.sun.star.awt.Point
Dim Size As New com.sun.star.awt.Size
+
Dim Grootte As New com.sun.star.awt.Size
  
Point.x = 1000        ' specifications, insignificant because latter
+
Punt.x = 1000        ' specificaties, niet relevant omdat latere
                      coordinates are binding
+
                      ' coördinaten bindend zijn
Point.y = 1000
+
Punt.y = 1000
Size.Width = 10000
+
Grootte.Width = 10000
Size.Height = 10000
+
Grootte.Height = 10000
  
 
Doc = ThisComponent
 
Doc = ThisComponent
Page = Doc.DrawPages(0)
+
Pagina = Doc.DrawPages(0)
  
GraphicObjectShape = Doc.createInstance("com.sun.star.drawing.GraphicObjectShape")
+
GrafischObjectVorm = Doc.createInstance("com.sun.star.drawing.GraphicObjectShape")
  
GraphicObjectShape.Size = Size
+
GrafischObjectVorm.Size = Grootte
GraphicObjectShape.Position = Point
+
GrafischObjectVorm.Position = Punt
 
   
 
   
GraphicObjectShape.GraphicURL = "file:///c:/test.jpg"
+
GrafischObjectVorm.GraphicURL = "file:///c:/test.jpg"
GraphicObjectShape.AdjustBlue = -50
+
GrafischObjectVorm.AdjustBlue = -50
GraphicObjectShape.AdjustGreen = 5
+
GrafischObjectVorm.AdjustGreen = 5
GraphicObjectShape.AdjustBlue = 10
+
GrafischObjectVorm.AdjustBlue = 10
GraphicObjectShape.AdjustContrast = 20
+
GrafischObjectVorm.AdjustContrast = 20
GraphicObjectShape.AdjustLuminance = 50
+
GrafischObjectVorm.AdjustLuminance = 50
GraphicObjectShape.Transparency = 40
+
GrafischObjectVorm.Transparency = 40
GraphicObjectShape.GraphicColorMode = com.sun.star.drawing.ColorMode.STANDARD
+
GrafischObjectVorm.GraphicColorMode = com.sun.star.drawing.ColorMode.STANDARD
  
Page.add(GraphicObjectShape)
+
Pagina.add(GrafischObjectVorm)
</source>
+
</syntaxhighlight>
  
This code inserts the <tt>test.jpg</tt> graphic and adapts its appearance using the <tt>Adjust</tt> properties. In this example, the graphics are depicted as 40 percent transparent with no other color conversions do not take place (<tt>GraphicColorMode = STANDARD</tt>).
+
Deze code voegt de afbeelding <tt>test.jpg</tt> in en past zijn verschijning aan met behulp van de eigenschappen <tt>Adjust</tt>. In dit voorbeeld wordt de afbeelding weergegeven als een 40 procent transparant terwijl andere kleuraanpassingen niet plaatsvinden (<tt>GraphicColorMode = STANDARD</tt>).
  
 
   
 
   
 
{{InterWiki Languages BasicGuide|articletitle=Documentation/BASIC Guide/Structure of Drawings}}
 
{{InterWiki Languages BasicGuide|articletitle=Documentation/BASIC Guide/Structure of Drawings}}
 
{{PDL1}}
 
{{PDL1}}

Revision as of 13:05, 31 December 2019

Book.png


Pagina's

Tip.png Een document van Draw (of Impress) wordt samengesteld uit pagina's, ook wel dia's genoemd. Wat hier is beschreven is ook van toepassing op documenten van Impress.


Apache OpenOffice kent geen beperking in het aantal pagina's in een document voor een tekening. U kunt elke pagina afzonderlijk ontwerpen. Er is ook geen limiet aan het aantal tekenelementen dat u kunt toevoegen aan een pagina.

De pagina's van een document voor een tekening zijn beschikbaar via de DrawPages container DrawPages. U kunt individuele pagina's echter benaderen via hun nummer of hun naam. Als een document slechts één pagina heeft en die is genaamd Dia 1, dan zijn de volgende voorbeelden identiek.

Voorbeeld 1: toegang door middel van het nummer (nummering begint met 0)

Dim Doc As Object
Dim Pagina As Object
 
Doc = ThisComponent
Pagina = Doc.DrawPages(0)
Documentation note.png De uitdrukking Doc.DrawPages(0) is een vereenvoudiging voor BASIC van de aanroep van de API : Doc.getDrawPages.getByIndex(0)

Voorbeeld 2: toegang door middel van de naam

Dim Doc As Object
Dim Pagina As Object
 
Doc = ThisComponent
Pagina = Doc.DrawPages.getByName("Dia 1")

In voorbeeld 1 wordt de pagina benaderd via zijn nummer (nummering begint bij 0). In het tweede voorbeeld wordt de pagina benaderd via zijn naam en de methode getByName.

Eigenschappen van een pagina

De voorgaande aanroep geeft een object Pagina terug dat de service com.sun.star.drawing.DrawPage ondersteunt. De service herkent de volgende eigenschappen:

BorderLeft (Long)
linker rand in 100-en van een millimeter
BorderRight (Long)
rechter rand in 100-en van een millimeter
BorderTop (Long)
bovenste rand in 100-en van een millimeter
BorderBottom (Long)
onderste rand in 100-en van een millimeter
Width (Long)
paginabreedte in 100-en van een millimeter
Height (Long)
paginahoogte in 100-en van een millimeter
Number (Short)
aantal pagina's (nummering begint met 1), alleen-lezen
Orientation (Enum)
oriëntatie van de pagina (overeenkomend met de opsomming com.sun.star.view.PaperOrientation)

Als deze instellingen worden veranderd dan beïnvloedt dat alle pagina's in het document. Het volgende voorbeeld stelt de paginagrootte van een net geopend document voor een tekening in op 20 × 20 centimeter met een paginamarge van 0,5 centimeter:

Dim Doc As Object
Dim Pagina As Object
 
Doc = ThisComponent
Pagina = Doc.DrawPages(0)
 
Pagina.BorderLeft = 500
Pagina.BorderRight = 500
Pagina.BorderTop = 500
Pagina.BorderBottom = 500
 
Pagina.Width = 20000
Pagina.Height = 20000

Hernoemen van pagina's

Documentation caution.png Indien een nieuwe pagina wordt ingevoegd in een document voor een tekening met meerdere pagina's, zullen alle daarop volgende pagina's die niet zijn hernoemd automatisch hun standaard naam zien veranderen, bijv. Dia 3 zal worden gewijzigd naar Dia 4, etc. Dit automatisch hernoemen werkt ook omgekeerd wanneer een pagina wordt verwijderd.

De enige manier om een vaste naam voor de pagina te verkrijgen is door de pagina te hernoemen, via de gebruikersinterface of door programmeren.

Een pagina verschaft de methoden getName en setName om zijn naam te lezen en aan te passen. BASIC kan beide methoden afhandelen als een eigenschap Name. Hier hernoemen we de eerste pagina van het document voor de tekening.

Dim Doc As Object
Dim Pagina As Object
 
Doc = ThisComponent
Pagina = Doc.DrawPages(0)
Pagina.Name = "Eerste"

Maken en verwijderen van pagina's

De container DrawPages van een document voor een tekening wordt ook gebruikt om individuele pagina's te maken en te verwijderen. Het volgende voorbeeld gebruikt de methode hasByName om te controleren of een pagina, genaamd MijnPagina, bestaat. Als die bestaat bepaalt de methode een overeenkomstige verwijzing naar het object met behulp van de methode getByName en slaat dan de verwijzing op in een variabele in Pagina. Als de overeenkomende pagina niet bestaat, wordt die gemaakt en ingevoegd in het document voor de tekening door middel van de methode insertNewByIndex. Het argument van de methode is de positie, geteld vanaf 0, van de bestaande pagina achter welke de nieuwe pagina zal worden ingevoegd. Dan wordt de nieuwe pagina hernoemd.

Dim Doc As Object
Dim Pagina As Object
 
Doc = ThisComponent
 
If Doc.Drawpages.hasByName("MijnPagina") Then
   Pagina = Doc.Drawpages.getByName("MijnPagina")
Else
   Pagina = Doc.Drawpages.insertNewByIndex(2)
   Pagina.Name = "MijnPagina" ' u zou een nieuwe pagina altijd moeten hernoemen
   ' MijnPagina is de vierde pagina van het document, d.i. positie 3
End If

De methoden hasByName en getByName worden verkregen uit de interface com.sun.star.container.XNameAccess.

De methode insertNewByIndex wordt verkregen uit de interface com.sun.star.drawing.XDrawPages. Dezelfde interface verschaft de methode remove om een pagina te verwijderen (wissen):

Dim Doc As Object
Dim Pagina As Object
 
Doc = ThisComponent
 
If Doc.Drawpages.hasByName("MijnPagina") Then
   Pagina = Doc.Drawpages.getByName("MijnPagina")
   Doc.Drawpages.remove(Pagina)
End If

Dupliceren van een pagina

Een kopie van een bepaalde pagina wordt gemaakt, niet vanuit de container DrawPages, maar vanuit het document voor de tekening zelf met de methode duplicate. De kopie wordt gemaakt op de volgende positie nà de originele pagina, met een standaard naam.

Dim Doc As Object
Dim Pagina As Object, KopiePagina As Object
 
Doc = ThisComponent
Pagina = Doc.Drawpages.getByName("MijnPagina")
KopiePagina = Doc.duplicate(Pagina)
KopiePagina.Name = "MijnKopie" ' u zou een nieuwe pagina altijd moeten hernoemen

Verplaatsen van een pagina

De API verschaft geen methode om de positie van een pagina binnen het document voor een tekening te wijzigen.

Elementaire eigenschappen van tekenobjecten

Tekenobjecten bestaan uit vormen (rechthoeken, cirkels, enzovoort), lijnen en tekstobjecten. Deze delen allemaal een aantal algemene mogelijkheden en ondersteunen de service com.sun.star.drawing.Shape. Deze service definieert de eigenschappen Size en Position van een tekenobject.

Apache OpenOffice BASIC biedt ook diverse andere services waardoor u dergelijke eigenschappen kunt wijzigen, zoals opmaak of vulling toepassen. De opties voor de opmaak die beschikbaar zijn hangen af van het type tekenobject.

Het volgende voorbeeld maakt een rechthoek en voegt die in een document voor een tekening in:

Dim Doc As Object
Dim Pagina As Object
Dim RechthoekVorm As Object
Dim Punt As New com.sun.star.awt.Point
Dim Grootte As New com.sun.star.awt.Size
 
Doc = ThisComponent
Pagina = Doc.DrawPages(0)
 
Punt.x = 1000
Punt.y = 1000
Grootte.Width = 10000
Grootte.Height = 10000
 
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RechthoekVorm.Size = Grootte
RechthoekVorm.Position = Punt
 
Pagina.add(RechthoekVorm)

De structuren Punt en Grootte, met het punt van origine (linkerbovenhoek) en de grootte van het tekenobject, worden geïnitialiseerd. De lengten worden gespecificeerd in honderdsten van een millimeter.

De programmacode gebruikt dan de aanroep Doc.createInstance om een rechthoekig tekenobject te maken, zoals gespecificeerd door de service com.sun.star.drawing.RectangleShape. Aan het einde wordt het tekenobject toegewezen aan de pagina met behulp van een aanroep Pagina.add.

Eigenschappen voor vulling

Dit gedeelte beschrijft vier services en in elk geval gebruikt de programmacode van het voorbeeld een element met een rechthoekige vorm die verschillende vormen van opmaak combineert. Eigenschappen voor vulling worden gecombineerd in de service com.sun.star.drawing.FillProperties.

Apache OpenOffice herkent vier hoofdtypen van opmaak voor een gebied dat gevuld moet worden. De eenvoudigste variant is een enkelkleurige vulling. De opties voor het definiëren van kleurverlopen en arceringen stellen u in staat ook andere kleuren te gebruiken. De vierde variant is de optie van het projecteren van bestaande afbeeldingen in het gebied om te vullen.

De modus vulling van een tekenobject wordt gedefinieerd met behulp van de eigenschap FillStyle. De toegestane waarden worden gedefinieerd in com.sun.star.drawing.FillStyle.

Vullingen met één kleur

De belangrijkste eigenschap voor enkelkleurige vullingen is:

FillColor (Long)
kleur voor de vulling van het gebied

U moet de eigenschap FillStyle instellen op de modus voor vulling SOLID om die modus voor vulling te kunnen gebruiken.

Het volgende voorbeeld maakt een rechthoekige vorm en vult die met rood (RGB waarde 255, 0, 0):

Dim Doc As Object
Dim Pagina As Object
Dim RechthoekVorm As Object
Dim Punt As New com.sun.star.awt.Point
Dim Grootte As New com.sun.star.awt.Size
 
Punt.x = 1000
Punt.y = 1000
Grootte.Width = 10000
Grootte.Height = 10000
 
Doc = ThisComponent
Pagina = Doc.DrawPages(0)
 
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RechthoekVorm.Size = Grootte
RechthoekVorm.Position = Punt
 
RechthoekVorm.FillStyle = com.sun.star.drawing.FillStyle.SOLID
RechthoekVorm.FillColor = RGB(255,0,0)
 
Pagina.add(RechthoekVorm)

Kleurverloop

Als u de eigenschap FillStyle instelt op GRADIENT, kunt u een kleurverloop toepassen op elk vulgebied in een document van Apache OpenOffice.

Indien u een vooraf gedefinieerd kleurverloop wilt toepassen, kunt u de bijbehorende naam toewijzen aan de eigenschap FillTransparenceGradientName. Om uw eigen kleurverloop te definiëren, moet u een structuur com.sun.star.awt.Gradient completeren om de eigenschap FillGradient aan toe te wijzen. Deze eigenschap verschaft de volgende opties:

Style (Enum)
type kleurverloop, bijvoorbeeld, lineair of radiaal (standaard waarden overeenkomend met com.sun.star.awt.GradientStyle)
StartColor (Long)
beginkleur van kleurverloop
EndColor (Long)
eindkleur van kleurverloop
Angle (Short)
hoek van het kleurverloop in tienden van graden
XOffset (Short)
X-coördinaat waarop het kleurverloop begint, gespecificeerd in 100-en of a millimeter
YOffset (Short)
Y-coördinaat waarop het kleurverloop begint, gespecificeerd in 100-en of a millimeter
StartIntensity (Short)
intensiteit van StartColor als een percentage (in Apache OpenOffice BASIC kunt u ook waarden specificeren die groter zijn dan 100 procent)
EndIntensity (Short)
intensiteit van EndColor als een percentage (in Apache OpenOffice BASIC kunt u ook waarden specificeren die groter zijn dan 100 procent)
StepCount (Short)
aantal gradaties van kleuren dat Apache OpenOffice moet berekenen voor de verlopen

Het volgende voorbeeld demonstreert het gebruik van kleurverlopen met behulp van de structuur com.sun.star.awt.Gradient:

Dim Doc As Object
Dim Pagina As Object
Dim RechthoekVorm As Object
Dim Punt As New com.sun.star.awt.Point
Dim Grootte As New com.sun.star.awt.Size
Dim Kleurverloop As New com.sun.star.awt.Gradient 
 
Punt.x = 1000
Punt.y = 1000
Grootte.Width = 10000
Grootte.Height = 10000
 
Doc = ThisComponent
Pagina = Doc.DrawPages(0)
 
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RechthoekVorm.Size = Grootte
RechthoekVorm.Position = Punt
Kleurverloop.Style = com.sun.star.awt.GradientStyle.LINEAR
Kleurverloop.StartColor = RGB(255,0,0)
Kleurverloop.EndColor = RGB(0,255,0)
Kleurverloop.StartIntensity = 150   
Kleurverloop.EndIntensity = 150
Kleurverloop.Angle = 450
Kleurverloop.StepCount = 100
 
RechthoekVorm.FillStyle = com.sun.star.drawing.FillStyle.GRADIENT
RechthoekVorm.FillGradient = Kleurverloop
 
Pagina.add(RechthoekVorm)

Dit voorbeeld maakt een lineair kleurverloop (Style = LINEAR). Het kleurverloop begint met rood (StartColor) in de linkerbovenhoek en breidt zich uit in een hoek van 45 graden (Angle) tot groen (EndColor) in de rechter benedenhoek. De kleurintensiteit van de begin- en eindkleur is 150 procent (StartIntensity en EndIntensity) welke er in resulteren dat de kleuren helderder lijken dan de waarden, gespecificeerd in de eigenschappen StartColor en EndColor. Het kleurverloop wordt weergegeven door middel van honderd gegradueerde individuele kleuren (StepCount).

Arceringen

De eigenschap FillStyle moet worden ingesteld op HATCH om een vulling met arcering te maken. De programmacode voor het definiëren van de arcering lijkt veel op de code voor kleurverlopen. Opnieuw wordt een hulp-structuur, in dit geval com.sun.star.drawing.Hatch, gebruikt om het uiterlijk van de arcering te definiëren. De structuur voor arceringen heeft de volgende eigenschappen:

Style (Enum)
type arcering: eenvoudig, vierkant of vierkant met diagonalen (standaard waarden die overeenkomen met com.sun.star.awt.HatchStyle)
Color (Long)
kleur van de lijnen
Distance (Long)
afstand tussen de lijnen in 100-en van een millimeter
Angle (Short)
hoek van de arcering in tienden van graden

Het volgende voorbeeld demonstreert het gebruik van een structuur voor arcering:

Dim Doc As Object
Dim Pagina As Object
Dim RechthoekVorm As Object
Dim Punt As New com.sun.star.awt.Point
Dim Grootte As New com.sun.star.awt.Size
Dim Arcering As New com.sun.star.drawing.Hatch
 
Punt.x = 1000
Punt.y = 1000
Grootte.Width = 10000
Grootte.Height = 10000
 
Doc = ThisComponent
Pagina = Doc.DrawPages(0)
 
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RechthoekVorm.Size = Grootte
RechthoekVorm.Position = Punt
 
RechthoekVorm.FillStyle = com.sun.star.drawing.FillStyle.HATCH
 
Arcering.Style = com.sun.star.drawing.HatchStyle.SINGLE
Arcering.Color = RGB(64,64,64)
Arcering.Distance = 20
Arcering.Angle = 450
 
RechthoekVorm.FillHatch = Hatch
 
Pagina.add(RechthoekVorm)

Deze code maakt een eenvoudige structuur voor arcering (HatchStyle = SINGLE) waarvan de lijnen gedraaid zijn onder een hoek van 45 graden (Angle). De lijnen zijn donkergrijs (Color) en liggen 0,2 millimeter (Distance) uit elkaar.

Afbeeldingen

U moet de eigenschap FillStyle instellen op BITMAP om een projectie van een afbeelding te gebruiken als vulling. Als de afbeelding al beschikbaar is in Apache OpenOffice, hoeft u alleen de naam te specificeren in de eigenschap FillBitMapName en zijn manier van zijn weergave (eenvoudig, getegeld of vergroot) in de eigenschap FillBitmapMode (standaardwaarden overeenkomend met com.sun.star.drawing.BitmapMode).

Als u een extern afbeeldingsbestand wilt gebruiken, kunt u de URL daarvan specificeren in de eigenschap FillBitmapURL.

Het volgende voorbeeld maakt een rechthoek en tegelt de afbeelding Sky, die beschikbaar is in Apache OpenOffice, om het gebied van de rechthoek te vullen:

Dim Doc As Object
Dim Pagina As Object
Dim RechthoekVorm As Object
Dim Punt As New com.sun.star.awt.Point
Dim Grootte As New com.sun.star.awt.Size
 
Punt.x = 1000
Punt.y = 1000
Grootte.Width = 10000
Grootte.Height = 10000
 
Doc = ThisComponent
Page = Doc.DrawPages(0)
 
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RechthoekVorm.Size = Grootte
RechthoekVorm.Position = Punt
 
RechthoekVorm.FillStyle = com.sun.star.drawing.FillStyle.BITMAP
RechthoekVorm.FillBitmapName = "Sky"
RechthoekVorm.FillBitmapMode = com.sun.star.drawing.BitmapMode.REPEAT
 
Pagina.add(RechthoekVorm)

Transparantie

U kunt de transparantie aanpassen van elke vulling die u toepast. De eenvoudigste manier om de transparantie van een teken-element te veranderen is door de eigenschap FillTransparence te gebruiken.

Het volgende voorbeeld maakt een rode rechthoek met een transparantie van 50 procent.

Dim Doc As Object
Dim Pagina As Object
Dim RechthoekVorm As Object
Dim Punt As New com.sun.star.awt.Point
Dim Grootte As New com.sun.star.awt.Size
 
Punt.x = 1000
Punt.y = 1000
Grootte.Width = 10000
Grootte.Height = 10000
 
Doc = ThisComponent
Pagina = Doc.DrawPages(0)
 
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RechthoekVorm.Size = Grootte
RechthoekVorm.Position = Punt
 
RechthoekVorm.FillStyle = com.sun.star.drawing.FillStyle.SOLID
RechthoekVorm.FillTransparence = 50
RechthoekVorm.FillColor = RGB(255,0,0)
 
Pagina.add(RechthoekVorm)

Stel de eigenschap FillTransparence in op 100 om de vulling transparant te maken.

In aanvulling op de eigenschap FillTransparence verschaft de service com.sun.star.drawing.FillProperties ook de eigenschap FillTransparenceGradient. Deze wordt gebruikt om een kleurverloop te definiëren dat de transparantie van een gebied voor de vulling specificeert.

Lijneigenschappen

Alle tekenobjecten die een randlijn kunnen hebben ondersteunen de service com.sun.star.drawing.LineStyle. Enkele van de eigenschappen die deze service verschaft zijn:

LineStyle (Enum)
type lijn (standaardwaarden overeenkomend met com.sun.star.drawing.LineStyle)
LineColor (Long)
kleur van de lijn
LineTransparence (Short)
transparantie van de lijn
LineWidth (Long)
dikte van de lijn in 100-en van een millimeter
LineJoint (Enum)
transities naar verbindingspunten (standaard waarden overeenkomend met com.sun.star.drawing.LineJoint )

Het volgende voorbeeld maakt een rechthoek met een doorlopende randlijn (LineStyle = SOLID) die 5 millimeter dik is (LineWidth) en 50 procent transparant. De rechter en linker-uiteinden van de lijn breiden zich uit tot het ontmoetingspunt met elkaar (LineJoint = MITER) om een rechte hoek te vormen.

Dim Doc As Object
Dim Pagina As Object
Dim RechthoekVorm As Object
Dim Punt As New com.sun.star.awt.Point
Dim Grootte As New com.sun.star.awt.Size
 
Punt.x = 1000
Punt.y = 1000
Grootte.Width = 10000
Grootte.Height = 10000
 
Doc = ThisComponent
Pagina = Doc.DrawPages(0)
 
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RechthoekVorm.Size = Grootte
RechthoekVorm.Position = Punt
 
RechthoekVorm.LineColor = RGB(128,128,128)
RechthoekVorm.LineTransparence = 50
RechthoekVorm.LineWidth = 500
RechthoekVorm.LineJoint = com.sun.star.drawing.LineJoint.MITER   
 
RechthoekVorm.LineStyle = com.sun.star.drawing.LineStyle.SOLID
 
Pagina.add(RechthoekVorm)

In aanvulling op de vermelde eigenschappen, verschaft de service com.sun.star.drawing.LineStyle opties voor het tekenen van lijnen met punten en streepjes. Voor meer informatie, zie de verwijzing naar de API van Apache OpenOffice.

Eigenschappen voor tekst (tekenobjecten)

De services com.sun.star.style.CharacterProperties en com.sun.star.style.ParagraphProperties kunnen tekst opmaken in tekenobjecten. Deze services relateren aan de individuele tekens en alinea's en worden in detail beschreven in Tekstdocumenten.

Het volgende voorbeeld voegt een tekst in in een rechthoek en maakt de service voor het lettertype com.sun.star.style.CharacterProperties op.

Dim Doc As Object
Dim Pagina As Object
Dim RechthoekVorm As Object
Dim Punt As New com.sun.star.awt.Point
Dim Grootte As New com.sun.star.awt.Size
Punt.x = 1000
Punt.y = 1000
Grootte.Width = 10000
Grootte.Height = 10000
Doc = ThisComponent
Pagina = Doc.DrawPages(0)
 
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RechthoekVorm.Size = Grootte
RechthoekVorm.Position = Punt
 
Pagina.add(RechthoekVorm)
 
RechthoekVorm.String = "Dit is een test"
RechthoekVorm.CharWeight = com.sun.star.awt.FontWeight.BOLD
RechthoekVorm.CharFontName = "Arial"

Deze code gebruikt de eigenschap String van de rechthoek om de tekst in te voegen en de eigenschappen CharWeight en CharFontName uit de service com.sun.star.style.CharacterProperties om het lettertype van de tekst op te maken.

De tekst kan alleen worden ingevoegd nadat het tekenobject is toegevoegd aan de tekenpagina. U kunt ook de service com.sun.star.drawing.Text gebruiken om de tekst te positioneren en op te maken in het tekenobject. Hier volgen enkele van de belangrijkste eigenschappen van deze service:

TextAutoGrowHeight (Boolean)
past de hoogte van het tekenelement aan aan de tekst die het bevat
TextAutoGrowWidth (Boolean)
past de breedte van het tekenelement aan aan de tekst die het bevat
TextHorizontalAdjust (Enum)
horizontale positie van de tekst binnen het tekenelement (standaard waarden overeenkomend met com.sun.star.drawing.TextHorizontalAdjust)
TextVerticalAdjust (Enum)
verticale positie van de tekst binnen het tekenelement (standaard waarden overeenkomend met com.sun.star.drawing.TextVerticalAdjust)
TextLeftDistance (Long)
afstand links tussen het tekenelement en de tekst in 100-en van een millimeter
TextRightDistance (Long)
afstand rechts tussen het tekenelement en de tekst in 100-en van een millimeter
TextUpperDistance (Long)
afstand boven tussen het tekenelement en de tekst in 100-en van een millimeter
TextLowerDistance (Long)
afstand onder tussen het tekenelement en de tekst in 100-en van een millimeter

Het volgende voorbeeld demonstreert het gebruik van de genoemde eigenschappen.

Dim Doc As Object
Dim Pagina As Object
Dim RechthoekVorm As Object
Dim Punt As New com.sun.star.awt.Point
Dim Grootte As New com.sun.star.awt.Size
 
Punt.x = 1000
Punt.y = 1000
Grootte.Width = 10000
Grootte.Height = 10000
 
Doc = ThisComponent
Pagina = Doc.DrawPages(0)
 
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RechthoekVorm.Size = Grootte
RechthoekVorm.Position = Punt
 
Pagina.add(RechthoekVorm)
 
RechthoekVorm.String = "Dit is een test"   ' Kan alleen plaatsvinden na Pagina.add!
 
RechthoekVorm.TextVerticalAdjust = com.sun.star.drawing.TextVerticalAdjust.TOP
RechthoekVorm.TextHorizontalAdjust = com.sun.star.drawing.TextHorizontalAdjust.LEFT
 
RechthoekVorm.TextLeftDistance = 300
RechthoekVorm.TextRightDistance = 300
RechthoekVorm.TextUpperDistance = 300
RechthoekVorm.TextLowerDistance = 300

Deze code voegt een tekenelement in op een pagina en voegt dan tekst toe aan de linkerbovenhoek van het tekenobject met behulp van de eigenschappen TextVerticalAdjust en TextHorizontalAdjust. De minimum afstand tussen de tekst en de rand van het teken-object is ingesteld op drie millimeters

Eigenschappen voor schaduw

U kunt een schaduw toevoegen aan de meeste teken-objecten met de service com.sun.star.drawing.ShadowProperties. De eigenschappen van deze service zijn:

Shadow (Boolean)
activeert de schaduw
ShadowColor (Long)
kleur van de schaduw
ShadowTransparence (Short)
transparantie van de schaduw
ShadowXDistance (Long)
verticale afstand van de schaduw tot het tekenobject in 100-en van een millimeter
ShadowYDistance (Long)
horizontale afstand van de schaduw tot het tekenobject in 100-en van een millimeter

Het volgende voorbeeld maakt een rechthoek met een schaduw die verticaal en horizontaal buiten de rechthoek steekt tot 2 millimeters. De schaduw wordt uitgevoerd in donkergrijs met 50 procent transparantie.

Dim Doc As Object
Dim Pagina As Object
Dim RechthoekVorm As Object
Dim Punt As New com.sun.star.awt.Point
Dim Grootte As New com.sun.star.awt.Size
 
Punt.x = 1000
Punt.y = 1000
Grootte.Width = 10000
Grootte.Height = 10000
 
Doc = ThisComponent
Pagina = Doc.DrawPages(0)
 
RechthoekVorm = Doc.createInstance("com.sun.star.drawing.RectangleShape")
RechthoekVorm.Size = Grootte
RechthoekVorm.Position = Punt
 
RechthoekVorm.Shadow = True
RechthoekVorm.ShadowColor = RGB(192,192,192)
RechthoekVorm.ShadowTransparence = 50
RechthoekVorm.ShadowXDistance = 200 
RechthoekVorm.ShadowYDistance = 200
 
Pagina.add(RechthoekVorm)

Een overzicht van de verschillende tekenobjecten

Rechthoekige vormen

Objecten met een rechthoekige vorm (com.sun.star.drawing.RectangleShape) ondersteunen de volgende services voor het opmaken van objecten:

Eigenschappen voor vulling
com.sun.star.drawing.FillProperties
Eigenschappen voor lijnen
com.sun.star.drawing.LineProperties
Eigenschappen voor tekst
com.sun.star.drawing.Text (met com.sun.star.style.CharacterProperties en com.sun.star.style.ParagraphProperties)
Eigenschappen voor schaduw
com.sun.star.drawing.ShadowProperties
CornerRadius (Long)
radius voor het afronden van hoeken in 100-en van een millimeter

Cirkels en ellipsem

De service com.sun.star.drawing.EllipseShape is verantwoordelijk voor cirkels en ellipsen en ondersteunt de volgende services:

Eigenschappen voor vulling
com.sun.star.drawing.FillProperties
Eigenschappen voor lijnen
com.sun.star.drawing.LineProperties
Eigenschappen voor tekst
com.sun.star.drawing.Text (met com.sun.star.style.CharacterProperties en com.sun.star.style.ParagraphProperties)
Eigenschappen voor schaduw
com.sun.star.drawing.ShadowProperties

In aanvulling op deze services, verschaffen cirkels en ellipsen ook deze eigenschappen:

CircleKind (Enum)
type cirkel of ellips (standaard waarden die overeenkomen met com.sun.star.drawing.CircleKind )
CircleStartAngle (Long)
beginhoek in tienden van graden (alleen voor segmenten van cirkel of ellips)
CircleEndAngle (Long)
eindhoek in tienden van graden (alleen voor segmenten van cirkel of ellips)

De eigenschap CircleKind bepaalt of een object een complete cirkel is, een cirkelsegment of een sector van een cirkel. De volgende waarden zijn beschikbaar:

com.sun.star.drawing.CircleKind.FULL
volledige cirkel of volledige ellips
com.sun.star.drawing.CircleKind.CUT
cirkelsegment (gedeeltelijk cirkel waarvan de interfaces direct aan elkaar gekoppeld zijn)
com.sun.star.drawing.CircleKind.SECTION
cirkelsegment
com.sun.star.drawing.CircleKind.ARC
hoek (niet inclusief de rand van de cirkel)

Het volgende voorbeeld maakt een cirkelsegment met een 70 graden hoek (geproduceerd uit het verschil van de starthoek van 20 graden en de eindhoek van 90 graden):

Dim Doc As Object
Dim Pagina As Object
Dim EllipsVorm As Object
Dim Punt As New com.sun.star.awt.Point
Dim Grootte As New com.sun.star.awt.Size
 
Punt.x = 1000
Punt.y = 1000
Grootte.Width = 10000
Grootte.Height = 10000
 
Doc = ThisComponent
Pagina = Doc.DrawPages(0)
 
EllipsVorm = Doc.createInstance("com.sun.star.drawing.EllipseShape")
EllipsVorm.Size = Grootte
EllipsVorm.Position = Punt
 
EllipsVorm.CircleStartAngle = 2000
EllipsVorm.CircleEndAngle = 9000
EllipsVorm.CircleKind =  com.sun.star.drawing.CircleKind.SECTION
 
Pagina.add(EllipsVorm)

Lijnen

Apache OpenOffice verschaft de service com.sun.star.drawing.LineShape voor lijn-objecten. Lijn-objecten ondersteunen alle algemene opmaak-services met uitzondering van die van gebieden. Hieronder volgen alle eigenschappen die zijn verbonden met de service LineShape:

Eigenschappen voor lijnen
com.sun.star.drawing.LineProperties
Eigenschappen voor tekst
com.sun.star.drawing.Text (met com.sun.star.style.CharacterProperties en com.sun.star.style.ParagraphProperties)
Eigenschappen voor schaduw
com.sun.star.drawing.ShadowProperties

Het volgende voorbeeld maakt een lijn en maakt die op met de hulp van de genoemde eigenschappen. De oorsprong van de lijn wordt gespecificeerd in de eigenschap Location, waarbij de coördinaten opgesomd in de eigenschap Size, het eindpunt van de lijn aangeven.

Dim Doc As Object
Dim Pagina As Object
Dim LijnVorm As Object
Dim Punt As New com.sun.star.awt.Point
Dim Grootte As New com.sun.star.awt.Size
 
Punt.x = 1000
Punt.y = 1000
Grootte.Width = 10000
Grootte.Height = 10000
 
Doc = ThisComponent
Pagina = Doc.DrawPages(0)
 
LijnVorm = Doc.createInstance("com.sun.star.drawing.LineShape")
LijnVorm.Size = Grootte
LijnVorm.Position = Punt
 
Pagina.add(LijnVorm)

Veelhoekige vormen

Apache OpenOffice ondersteunt ook complexe veelhoekige vormen door de service com.sun.star.drawing.PolyPolygonShape. Strikt gesproken is een PolyPolygoon niet een eenvoudige veelhoek, maar een meervoudige veelhoek. Verschillende onafhankelijke lijsten die hoekpunten bevatten kunnen daardoor worden gespecificeerd en gecombineerd om een compleet object te vormen.

Net als met rechthoekige vormen worden alle eigenschappen voor opmaak van teken-objecten ook verschaft voor meervoudige veelhoeken:

Eigenschappen voor vulling
com.sun.star.drawing.FillProperties
Eigenschappen voor lijnen
com.sun.star.drawing.LineProperties
Eigenschappen voor tekst
com.sun.star.drawing.Text (met com.sun.star.style.CharacterProperties en com.sun.star.style.ParagraphProperties)
Eigenschappen voor schaduw
com.sun.star.drawing.ShadowProperties

De service PolyPolygonShape heeft ook een eigenschap die u de coördinaten van een veelhoek laten definiëren:

  • PolyPolygon (Array) – veld dat de coördinaten van de veelhoek bevat (dubbele tabel met de punten van het type com.sun.star.awt.Point)

Het volgende voorbeeld toont hoe u een driehoek kunt definiëren met de service PolyPolygonShape.

Dim Doc As Object
Dim Pagina As Object
Dim VeelhoekVorm As Object
Dim Veelhoek As Variant
Dim Coördinaten(2) As New com.sun.star.awt.Point
 
Doc = ThisComponent
Pagina = Doc.DrawPages(0)
 
VeelhoekVorm = Doc.createInstance("com.sun.star.drawing.PolyPolygonShape")
Pagina.add(VeelhoekVorm)   ' Pagina.add moet plaatsvinden voordat de coördianten worden ingesteld
 
Coördinaten(0).x = 1000
Coördinaten(1).x = 7500
Coördinaten(2).x = 10000
Coördinaten(0).y = 1000
Coördinaten(1).y = 7500
Coördinaten(2).y = 5000
 
VeelhoekVorm.PolyPolygon = Array(Coördinaten())

Omdat de punten van een veelhoek worden gedefinieerd als absolute waarden, hoeft u de grootte of de startpositie van een veelhoek niet te specificeren. In plaats daarvan moet u een tabel van de punten maken, dit verpakken in een tweede tabel (met behulp van de aanroep Array(Coordinates())), en dan die tabel toewijzen aan de veelhoek. Voordat de corresponderende aanroep kan worden uitgevoerd, moet de veelhoek worden ingevoegd in het document.

De dubbele array in de definitie staat u toe complexe vormen te maken door verschillende veelhoeken samen te voegen. Bijvoorbeeld, u kunt een rechthoek maken en daarin dan een andere rechthoek plaatsen om een gat in de originele rechthoek te maken:

Dim Doc As Object
Dim Pagina As Object
Dim VeelhoekVorm As Object
Dim Veelhoek As Variant
Dim Vierkant1(3) As New com.sun.star.awt.Point
Dim Vierkant2(3) As New com.sun.star.awt.Point
Dim Vierkant3(3) As New com.sun.star.awt.Point
 
Doc = ThisComponent
Pagina = Doc.DrawPages(0)
 
VeelhoekVorm = Doc.createInstance("com.sun.star.drawing.PolyPolygonShape")
 
Pagina.add(VeelhoekVorm)   ' Pagina.add moet plaatsvinden voordat de coördinaten worden ingesteld
 
Vierkant1(0).x = 5000
Vierkant1(1).x = 10000
Vierkant1(2).x = 10000
Vierkant1(3).x = 5000
Vierkant1(0).y = 5000
Vierkant1(1).y = 5000
Vierkant1(2).y = 10000
Vierkant1(3).y = 10000
 
Vierkant2(0).x = 6500
Vierkant2(1).x = 8500
Vierkant2(2).x = 8500
Vierkant2(3).x = 6500
Vierkant2(0).y = 6500
Vierkant2(1).y = 6500
Vierkant2(2).y = 8500
Vierkant2(3).y = 8500
 
Vierkant3(0).x = 6500
Vierkant3(1).x = 8500
Vierkant3(2).x = 8500
Vierkant3(3).x = 6500
Vierkant3(0).y = 9000
Vierkant3(1).y = 9000
Vierkant3(2).y = 9500
Vierkant3(3).y = 9500
 
VeelhoekVorm.PolyPolygon = Array(Vierkant1(), Vierkant2(), Vierkant3())

Ten aanzien van het feit welk gebied wordt gevuld en welk gebied gaten zijn, hanteert Apache OpenOffice een eenvoudige regel: de rand van de buitenste vorm is altijd de buitenste grens van de meervoudige veelhoek. De volgende lijn binnenwaarts is de binnengrens van de vorm en markeert de overgang naar het eerste gat. Als er nog een lijn binnenwaarts is, markeert die de overgang naar een gevuld gebied.

Afbeeldingen

De laatste van de hier gepresenteerde tekenelementen zijn de grafische objecten die zijn gebaseerd op de service com.sun.star.drawing.GraphicObjectShape. Deze kan worden gebruikt met elke afbeelding binnen Apache OpenOffice waarvan het uiterlijk kan worden opgenomen met behulp van een heel bereik aan eigenschappen.

Grafische objecten ondersteunen twee van de algemene eigenschappen voor opmaak :

Eigenschappen voor tekst
com.sun.star.drawing.Text (met com.sun.star.style.CharacterProperties en com.sun.star.style.ParagraphProperties)
Eigenschappen voor schaduw
com.sun.star.drawing.ShadowProperties

Aanvullende eigenschappen die worden ondersteund door grafische objecten zijn:

GraphicURL (String)
URL van de afbeelding
AdjustLuminance (Short)
helderheid van de kleuren als een percentage (negatieve waarden zijn ook toegestaan)
AdjustContrast (Short)
contrast als een percentage (negatieve waarden zijn ook toegestaan)
AdjustRed (Short)
waarde voor rood als een percentage (negatieve waarden zijn ook toegestaan)
AdjustGreen (Short)
waarde voor groen als een percentage (negatieve waarden zijn ook toegestaan)
AdjustBlue (Short)
waarde voor blauw als een percentage (negatieve waarden zijn ook toegestaan)
Gamma (Short)
gamma-waarde van een afbeelding
Transparency (Short)
transparantie van een afbeelding als een percentage;GraphicColorMode (enum):modus kleur, bijvoorbeeld: standaard, grijswaarden, zwart en wit (standaard waarde overeenkomend met com.sun.star.drawing.ColorMode )

Het volgende voorbeeld toont hoe een pagina in een grafisch object in te voegen.

Dim Doc As Object
Dim Pagina As Object
Dim GrafischObjectVorm As Object
Dim Punt As New com.sun.star.awt.Point
Dim Grootte As New com.sun.star.awt.Size
 
Punt.x = 1000         ' specificaties, niet relevant omdat latere
                      ' coördinaten bindend zijn
Punt.y = 1000
Grootte.Width = 10000
Grootte.Height = 10000
 
Doc = ThisComponent
Pagina = Doc.DrawPages(0)
 
GrafischObjectVorm = Doc.createInstance("com.sun.star.drawing.GraphicObjectShape")
 
GrafischObjectVorm.Size = Grootte
GrafischObjectVorm.Position = Punt
 
GrafischObjectVorm.GraphicURL = "file:///c:/test.jpg"
GrafischObjectVorm.AdjustBlue = -50
GrafischObjectVorm.AdjustGreen = 5
GrafischObjectVorm.AdjustBlue = 10
GrafischObjectVorm.AdjustContrast = 20
GrafischObjectVorm.AdjustLuminance = 50
GrafischObjectVorm.Transparency = 40
GrafischObjectVorm.GraphicColorMode = com.sun.star.drawing.ColorMode.STANDARD
 
Pagina.add(GrafischObjectVorm)

Deze code voegt de afbeelding test.jpg in en past zijn verschijning aan met behulp van de eigenschappen Adjust. In dit voorbeeld wordt de afbeelding weergegeven als een 40 procent transparant terwijl andere kleuraanpassingen niet plaatsvinden (GraphicColorMode = STANDARD).


Content on this page is licensed under the Public Documentation License (PDL).
Personal tools