...

Capitolo 12 Disegnare in Gambas

by user

on
Category: Documents
32

views

Report

Comments

Transcript

Capitolo 12 Disegnare in Gambas
Capitolo 12
Disegnare in Gambas
La classe Draw è la classe di Gambas utilizzata per disegnare. L’oggetto può essere del tipo Picture,
Window, Printer, Drawing o DrawingArea. La classe è statica. È importante ricordare che prima
d’iniziare a disegnare qualunque cosa, è necessario richiamare il metodo Begin, passando un
handle al tipo di oggetto che volete disegnare. Fatto questo, potete richiamare qualunque metodo
per disegnare punti, linee, testi, immagini, ecc. . . Tuttavia, non è documentato con chiarezza che
si debba impostare anche la proprietà Cached della DrawingArea su True, per vedere il disegno
sul form. Quando il vostro disegno è terminato, dovete richiamare il metodo End.
0.1
Le proprietà Draw
Qualunque cosa intendiate disegnare in Gambas è supportato con vari attributi, il colore dello
sfondo, il colore del primo piano, il colore di riempimento, uno stile di riempimento, ecc. . . Alcune
proprietà, come Clip, sono di sola lettura e restituiscono semplicemente dei dati da usare nel
codice.
0.1.1
BackColor/Background e ForeColor/Foreground
Come abbiamo spiegato nel Capitolo 4, molte proprietà sono comuni a diversi controlli, pertanto
spiegheremo soltanto le proprietà che sono specifiche per un certo controllo.
BackColor is defined as PROPERTY BackColor AS Integer
ForeColor is defined as PROPERTY ForeColor AS Integer
Questi valori integer, rappresentano il colore utilizzato nello sfondo o nel primo piano del disegno
corrente. È sinonimo delle proprietà Background/Foreground rispettivamente. PROPERTY è
un tipo di dato predefinito in Gambas. Si possono impiegare le costanti di Gambas predefinite per
impostare il valore del colore:
Black
DarkCyan
DarkRed
Green
Pink
White
Blue
DarkGray
DarkYellow
LightGray
Red
Yellow
Cyan
DarkGreen
Default
Magenta
Trasparent
DarkBlue
DarkMagenta
Gray
Orange
Violet
Per impostare la proprietà BackColor sul rosso, dovreste utilizzare il seguente codice:
Draw.BackColor = Color.Red
In alternativa, se si conoscono i valori RGB o HSV di un colore particolare, Gambas dispone del
convertitore per questi valori e restituisce il valore integer corrispondente che può essere passato
1
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
2
A Beginner’s Guide to Gambas
alla proprietà BackColor. La classe Color possiede due metodi, RGB e HSV. La funzione RGB
restituisce un valore di colore a partire dalle componenti rosso, verde e blu. HSV restituisce
un valore di colore a partire dalle componenti tonalità, saturazione e luminosità. Di seguito un
esempio per impostare il colore di sfondo del tasto:
Draw.BackColor = Color.RGB(255,255,255)
Il codice di cui sopra imposta il colore dello sfondo dell’oggetto Draw sul bianco. È molto utile
quando si cerca d’impostare colori che non rientrano nei valori standard delle costanti di default
di Gambas.
0.1.2
Clip
La classe Clip è static. Clip è una proprietà di sola-lettura che restituisce un oggetto virtuale
(.DrawClip) utilizzato per gestire le clipping area di un disegno. I metodi di disegno in Gambas
non trovano realizzazione al di fuori dei contorni della clipping area. Non si può utilizzare questa
classe virtuale come un data-type (tipo di dato). La sintassi standard nel linguaggio Gambas è:
STATIC PROPERTY READ Clip AS .DrawClip
Questa classe può essere impiegata come una funzione. Per invocarla in modo da definire una
clipping area, si può utilizzare la seguente sintassi:
STATIC SUB .DrawClip (X AS Integer, Y AS Integer, W AS Integer, H AS Integer)
Le proprietà restituite da questa funzione sono Enabled, H, Height, W, Width, X e Y.
0.1.3
FillColor, FillStyle, FillX, FillY
La proprietà FillColor restituisce o imposta il colore utilizzato dai metodi disegno per riempire
un poligono con un colore o con un modello. Questa classe è static. La proprietà FillStyle
restituisce o imposta lo stile utilizzato dai metodi disegno per riempire un poligono con un colore
o con un modello. La classe Fill supporta molteplici costanti FillStyle predefinite utilizzate per
rappresentare modelli di riempimento per il disegno:
BackDiagonal
Dense37
Dense88
None
Cross
Dense50
Dense94
Solid
CrossDiagonal
Dense6
Diagonal
Vertical
Dense12
Dense63
Horizontal
La sintassi Gambas per FillColor e FillStyle è la seguente:
STATIC PROPERTY FillColor AS Integer
STATIC PROPERTY FillStyle AS integer
Le proprietà FillX e FillY sono impiegate per restituire o per impostare l’origine orizzontale/
verticale dei pennelli utilizzati dai metodi disegno per riempire un poligono con un colore o con
modello. La sintassi Gambas per FillX e FillY è:
STATIC PROPERTY FillX AS Integer
STATIC PROPERTY FillY AS Integer
0.1.4
Font
La classe Font restituisce o imposta il font impiegato per generare testo sull’area del disegno. La
sintassi Gambas è:
STATIC PROPERTY Font AS Font
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
3
A Beginner’s Guide to Gambas
Per impostare gli attributi di controllo del font, può essere utilizzato il seguente codice:
Draw.Font.Name = "Lucida"
Draw.Font.Bold = TRUE
Draw.Font.Italic = FALSE
Draw.Font.Size = "10"
Draw.Font.StrikeOut = FALSE
Draw.Font.Underline = FALSE
0.1.5
Invert
La proprietà Invert è utilizzata per far si che tutte le immagini primitive combinino i loro colori
dei pixel con i colori dei pixel di una seconda immagine di destinazione mediante un’operazione
XOR. La sintassi Gambas è:
STATIC PROPERTY Invert AS Boolean
0.1.6
LineStyle/LineWidth
La proprietà LineStyle restituisce o imposta lo stile impiegato per le linee del disegno. LineWidth
restituisce o imposta la larghezza utilizzata per le linee del disegno. La classe Line è static e
definisce le costanti utilizzate dalla proprietà Draw.LineStyle. Queste costanti includono:
Dash
DashDotDot
Dot
None
DashDot
Solid
La sintassi standard Gambas è:
STATIC PROPERTY LineStyle AS Integer
STATIC PROPERTY LineWidth AS Integer
0.1.7
Transparent
La proprietà Transparent permette ad alcuni metodi disegno come Draw.Text di non riempire il
loro sfondo con alcunché (perciò essi sono trasparenti). La sintassi del linguaggio Gambas è:
STATIC PROPERTY Transparent AS Boolean
0.2
I metodi Draw
Uno dei modi più proficui per imparare ad utilizzare i metodi per disegnare in Gambas, è scrivere un
codice che spieghi l’utilizzo di ciascun metodo. In questo modo si può vedere come programmare
un metodo ed avere immediata soddisfazione vedendo i risultati. Realizzeremo un’applicazione
dimostrativa che impiega quasi tutti i metodi supportati dalla classe Draw.
Cominceremo col creare un’applicazione con una nuova interfaccia grafica. Chiamiamo il progetto
gfxDemo creando un form, Form1, una volta nell’IDE. Assicurarsi di specificarlo come classe
d’avvio e impostare i controlli su public. La figura 1 mostra il layout del Form1 all’avvio. Impostare
la larghezza del form a 530 e l’altezza a 490. Le impostazioni di default per tutte le restanti
proprietà dovrebbero andar bene per i nostri scopi. Creare otto tasti e nominarli come mostrato
nella figura 1. I nomi dei tasti sono TextBtn, InvRectBtn, EllipseBtn, FillRectBtn, PolygonBtn,
PolyLineBtn, TileBtn, e QuitBtn. Ciascun tasto dovrebbe avere una larghezza di 60 ed un’altezza
di 25. Collocarli in basso sul form. Per ogni tasto creato abbiamo bisogno di creare un evento clic
col classico doppio clic sul tasto.
Per ciascun metodo si vedrà il codice corrispondente. Prima di proseguire, ci sono un paio di
cose da fare con il nostro programma. Per prima cosa, è necessario un controllo DrawingArea,
chiamato da nel form. Collochiamolo nell’angolo in alto a sinistra del form e dimensioniamolo
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
4
A Beginner’s Guide to Gambas
Figura 1: Il Form1 all’avvio.
a circa 1 pollice quadrato (circa 2.5cm X 2.5cm). Verrà impiegato un constructor per avviare
il processo di disegno invocando il metodo Draw.Begin ed impostando i parametri che saranno
utilizzati per il nostro programma. Ecco la subroutine del constructor :
PUBLIC SUB _new()
’establish width of the drawing area
da.W = form1.W { 10
’establish height of the drawing area
da.H = form1.H { 45
’make the mandatory call to start draw operations
Draw.Begin(da)
’set a default line width of 2 pixels
Draw.LineWidth = 2
END
All’avvio del programma, si apre il form che chiamerà il constructor ed eseguirà il codice nella
subroutine Form Open. Tutto ciò che faremo per questa subroutine è impostare la caption nella
parte alta del form:
PUBLIC SUB Form_Open()
Form1.Text = " Drawing Examples "
END
L’ultima routine che scriveremo prima di considerare i metodi Draw, è il codice necessario per
terminare il nostro programma. Fare doppio clic sul tasto Quit ed aggiungere il seguente codice:
PUBLIC SUB QuitBtn_Click()
Draw.End ’close drawing operations
ME.Close ’close Form1
END
A questo punto siamo pronti per studiare il codice necessario per sperimentare i vari strumenti
del disegno con i metodi della classe Draw.
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
A Beginner’s Guide to Gambas
0.2.1
5
Text/TextHeight/TextWidth
Cominceremo con Draw.Text e le due proprietà di testo di sola-lettura, TextHeight e TextWidth.
La proprietà TextHeight restituisce l’altezza di un disegno testuale, mentre la proprietà TextWidth
restituisce la larghezza di un disegno testuale. La sintassi Gambas standard è la seguente:
STATIC FUNCTION TextHeight (Text AS String) AS Integer
STATIC FUNCTION TextWidth (Text AS String) AS Integer
Fare doppio clic sul tasto Text ed aggiungere questo codice:
PUBLIC SUB TextButton_Click()
’this var will be used for our loop counter
DIM counter AS Integer
’clear the current drawing area
da.Clear
’set foreground color to black
Draw.ForeColor = color.Black
’set current font to Arial
draw.Font.Name = "Arial"
’turn on boldface
draw.Font.Bold = TRUE
’turn off italic
draw.Font.Italic = FALSE
’turn off underline
draw.Font.Underline = FALSE
’set text size to 16 points
draw.Font.Size = "16"
’start a loop and continue until we iterate 10 times
FOR counter = 0 TO 9
’output text and increment the y position by 40 * counter
’the optional width, height parameters are given as 100, 60
draw.Text("Sample Text", 10, 10 + 40*counter, 100,60)
NEXT ’iteration of the loop
’now set font to 24 points
draw.Font.Size = "24"
Draw.ForeColor = color.Blue ’and change color to blue
FOR counter = 0 TO 9 ’loop another 10 times
’all we change is x position to move the text right 200 pixels
draw.Text("More Sample Text", 200, 10 + 40*counter, 100,60)
NEXT ’iteration
’refresh the drawing area to see what was done
da.Refresh
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
6
A Beginner’s Guide to Gambas
Figura 2: Output del clic sul tasto Text Button.
END ’ we are done with text stuff!
Una volta terminata la scrittura del codice, salvate e cliccate sul tasto RUN.
Dovreste vedere qualcosa di simila alla figura 2.
0.2.2
Disegnare primitive:1 Point/Rect/Ellipse/Line
Il metodo Draw.Point disegna un singolo pixel mentre il metodo Draw.Rect disegna un rettangolo.
La sintassi Gambas per questi due metodi è:
STATIC SUB Point (X AS Integer, Y AS Integer )
STATIC SUB Rect (X AS Integer,Y AS Integer,Width AS Integer,Height AS Integer )
Useremo il tasto InvRect per illustrare come vengono utilizzati questi metodi. Fare doppio clic sul
tasto InvRect e scrivere il seguente codice:
PUBLIC SUB InvRectBtn_Click()
’use this var for our loop counter
DIM counter AS Integer
’clear the drawing area
da.Clear
’make sure fill style is set to None
draw.FillStyle = fill.None
’set color to cyan
draw.ForeColor = color.cyan
’this will make the cyan rectangle appear red
draw.Invert = TRUE
1 In geometria, una primitiva è la più semplice delle figure geometriche. In computer grafica, una primitiva può
essere un punto, una linea o un poligono.
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
A Beginner’s Guide to Gambas
7
FOR counter = 0 TO 15 ’loop 16 times
’draw a rect, inc the startx,y and end x,y positions 5* counter val
Draw.Rect(5+5*counter, 5+5*counter, da.W/2+5*counter, da.H/2 + 5*counter)
’if we hit an even number, invoke toggle Invert property on/off
IF counter MOD 2 = 0 THEN
draw.Invert = FALSE
ELSE
draw.Invert = TRUE
ENDIF
NEXT ’iteration of the loop
’ensure invert is set to off
draw.Invert = FALSE
’set current fgd color to black
draw.Forecolor = color.Black
’set a point midscreen
draw.Point(da.W/2, da.H/2)
’now we will make a tiny crosshair from the first point
’by moving one pixel up, down, left and right of the center
’dot we set with the first draw.point call
draw.Point(da.W/21, da.H/2)
draw.Point(da.W/2+1, da.H/2)
draw.Point(da.W/2, da.H/21)
draw.Point(da.W/2, da.H/2+1)
’update the display to see what we did
da.Refresh
END ’of the rect/point demo code
Salvate ed avviate il programma. Quando viene eseguito un clic sul tasto InvRect, dovreste vedere
qualcosa di simile alla figura 3. Il metodo Draw.Line disegna una linea. Il punto (x1, y1)
rappresenta il vertice iniziale della linea, il punto (x2, y2) rappresenta il vertice finale della linea.
Il metodo linea utilizza le proprietà della classe Line per determinare lo stile della linea e lo
spessore. Le costanti utilizzate dalla proprietà Draw.LineStyle sono Dash, DashDot, DashDotDot,
Dot, None, e Solid. Lo spessore della linea è impostato usando la proprietà Draw.LineWidth e la
larghezza è in pixel. La sintassi Gambas per questo metodo è:
STATIC SUB Line(X1 AS Integer,Y1 AS Integer,X2 AS Integer,Y2 AS Integer)
Il metodo Draw.Ellipse disegnerà un’ellisse o un cerchio. Un cerchio è un’ellisse con eguali parametri di larghezza e di altezza; per questo non esiste una funzione Draw.Circle in Gambas. La
sintassi Gambas per Draw.Ellipse è:
STATIC SUB Ellipse (X AS Integer, Y AS Integer, Width AS Integer, Height AS
Integer [ , Start AS Float, Length AS Float ] )
X e Y rappresentano il punto centrale del cerchio o dell’ellisse. La larghezza può essere immaginata
come un raggio lungo il piano orizzontale, l’altezza è un raggio lungo il piano verticale. Se voi
specificate i parametri opzionali di inizio e lunghezza, questi rappresentano gli angoli iniziali (in
gradi) dove il disegno avrà inizio e fine. Illustreremo tutte queste caratteristiche utilizzando il
tasto Ellipses. Fare doppio clic sul tasto Ellipses e scrivere il seguente codice:
PUBLIC SUB EllipseBtn_Click()
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
8
A Beginner’s Guide to Gambas
Figura 3: Output del clic sul tasto InvRect, notare il punto nero al centro dello schermo.
’declare some variables to work with
DIM x1 AS Integer
DIM x2 AS Integer
DIM y1 AS Integer
DIM y2 AS Integer
’we will need a counter variable
DIM i AS Integer
’and a var to hold the value of line width as we change it
DIM lwidth AS Integer
’clear our display before we begin
da.Clear
’set
x1 =
y1 =
x2 =
y2 =
initial vectors
50
50
100
100
’change the color to dark blue
Draw.ForeColor = color.DarkBlue
’set up for a solid fill. Any fillable container that is called after
’this call will be filled with the pattern specified below
draw.FillStyle = fill.Solid
’set up a loop that will create 12 increments
FOR i = 0 TO 360 STEP 30
’if we fall on a 90 degree increment, switch colors
IF i MOD 45 = 0 THEN
draw.FillColor = color.Yellow
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
9
A Beginner’s Guide to Gambas
ELSE
draw.FillColor = color.Red
ENDIF
’draw a filled ellipse of 12 segments, starting at each value of i
’and sweeping for 30 degrees, as specified in the optional parms
Draw.Ellipse(x1, y1, x2, y2, i, 30)
NEXT
’now, turn off the fill style
draw.FillStyle = fill.None
’set our fgd color to black
draw.ForeColor = color.Black
’lets draw some lines, start x at midscreen horiz axis
x1 = da.W/225
25 pixels
’start our y at midscreen on the vertical axis
y1 = da.H/2
’start with a line width of a single pixel
lwidth = 1
’loop 8 times, moving down along the y axis in 25 pix increments
FOR i = 10 TO 200 STEP 25
’draw a line
draw.Line(da.W/2, i, da.W/2 + 150, i)
’increase line thickness variable
INC lwidth
’set the new width
draw.LineWidth = lwidth
NEXT ’iteration of the loop
’out of the loop, reset to a default of 2 pix wide
draw.LineWidth = 2
’now, lets start another loop and draw some ellipses
FOR i = 1 TO 40 STEP 3 ’lets make 13 of them
’moving this one left along the horiz axis
Draw.Ellipse(x1i*5, y1, 75, 200)
’and moving this one right along the horiz axis
Draw.Ellipse(x1+i*5, y1, 75, 200)
’if we hit an even number in our loop change colors
IF i MOD 2 = 0 THEN
draw.ForeColor = color.Red
ELSE
draw.ForeColor = color.Black
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
10
A Beginner’s Guide to Gambas
Figura 4: Il tasto Ellipses visualizza linee di disegno ed ellissi.
ENDIF
NEXT ’iteration of the loop
’refresh the drawing area to see our work
da.Refresh
END ’end of the ellipses and lines demo code
Salvate ed avviate il programma. Al clic sul tasto Ellipses dovreste vedere qualcosa di simile
alla figura 4. Il nostro successivo segmento di codice utilizzerà il tasto FillRect. Torneremo ad
esaminare il metodo Draw.Rect per mostrarvi come utilizzare Draw.FillStyle per creare oggetti
riempibili. Creare un evento clic ed immettere il seguente codice:
PUBLIC SUB FillRectBtn_Click()
’create some local vars to work with
DIM x1 AS Integer
DIM x2 AS Integer
DIM y1 AS Integer
DIM y2 AS Integer
’clear the drawing area
da.Clear
’set the rect top left corner
x1 = 20
y1 = 80
’set the rect bot right corner
x2 = x1+50
y2 = y1+50
’set fgd color to red
draw.FillColor = color.Red
’specify a horiz style fill pattern
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
A Beginner’s Guide to Gambas
11
Figura 5: Risultato del clic sul tasto FillRect.
draw.FillStyle = fill.Horizontal
’draw a rect, if a fill pattern is specified, it is autofilled
Draw.Rect(x1,y1,x2, y2)
’set the rect top left corner
x1 = 220
y1 = 180
’set the rect bot right corner
x2 = x1+50
y2 = y1+50
’set fgd color to blue
draw.FillColor = color.Blue
’specify a cross style fill pattern
draw.FillStyle = fill.Cross
’draw a rect, if a fill pattern is specified, it is autofilled
Draw.Rect(x1,y1,x2, y2)
’turn off the fill
draw.FillStyle = fill.None
’refresh to see our work
da.Refresh
END
Salvate ed avviate il programma. Al clic sul tasto FillRect, dovreste vedere qualcosa di simile alla
figura 5.
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
12
A Beginner’s Guide to Gambas
0.2.3
Disegnare primitive: Polygon e Polyline
Il metodo Draw.Polygon disegna un poligono con n vertici. I vertici sono specificati in un array
integer mediante la seguente sintassi Gambas:
STATIC SUB Polygon ( Points AS Integer[] )
Il parametro Points è un array integer contenente le coordinate dei vertici del poligono. Le coordinate sono acquisite nel formato (x,y); devono esserci nell’array due integer per ciascun vertice
del poligono.
Il metodo Draw.Polyline funziona quasi esattamente come la routine Polygon eccetto per il fatto
che con una polilinea la figura, per essere disegnata, non necessita di essere chiusa. Questa talvolta
va sotto il nome di poligono vuoto. Una polilinea è una serie di vertici uniti l’un l’altro da una
linea. La sintassi nel linguaggio Gambas per Polyline è:
STATIC SUB Polyline ( Points AS Integer[] )
Il parametro Points è un array integer che contiene le coordinate dei vertici del poligono. Ci
devono essere nell’array due dati integer per ciascun vertice. Utilizzeremo il tasto FillPoly sul
nostro Form1 per spiegare l’uso del metodo Draw.Polygon. Fare doppio-clic sul tasto FillPoly per
creare un evento clic e inserire il seguente codice:
PUBLIC SUB PolygonBtn_Click()
’declare some work variables to create a polygon
DIM x1 AS Integer
DIM y1 AS Integer
DIM x2 AS Integer
DIM y2 AS Integer
DIM x3 AS Integer
DIM y3 AS Integer
’we are going to create a triangle for our polygon
’and store the vertices in the integer array triangle
DIM triangle AS Integer[]
’clear the display area
da.Clear
’set the vertices for each leg of the triangle
’starting with the top part of an equilateral triangle
x1 = da.w/2 ’ set the horiz axis to midscreen
y1 = 10 ’set vertical axis to top + 10 pixels
’now, we will do the left leg of the triangle
’starting on the extreme left edge plus 10 pixels
x2 = da.Left + 10
’and setting our y position to drawingarea height
y2 = da.H 200
’the right leg sets horiz position far right
x3 = da.W 20
200 pixels
20 pixels in
’and the vert axis will be same as the second leg
y3 = y2
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
A Beginner’s Guide to Gambas
13
Figura 6: Draw polygon per disegnare un triangolo.
’all vertices defined, load the integer array with the triangle
triangle = Array(x1, y1, x2, y2, x3, y3)
’set a fill style
draw.FillStyle = fill.Dense63
’and a fill color
draw.FillColor = color.DarkMagenta
’and draw the polygon using the triangle array data
draw.Polygon(triangle)
’remember to set fill style to None
draw.FillStyle = fill.None
’call refresh to see our work
da.Refresh
END ’ and we are done with the polygon routine
Salvare ed avviare il programma. Al clic sul tasto FillPoly dovreste vedere qualcosa di simile alla
figura 6. Adesso studiamo il metodo Draw.Polyline. Fare doppio-clic sul tasto Polyline e creare
un evento clic. Inserire il seguente codice:
PUBLIC SUB PolyLineBtn_Click()
’declare some variables to create our vertices
DIM x1 AS Integer
DIM y1 AS Integer
DIM x2 AS Integer
DIM y2 AS Integer
DIM x3 AS Integer
DIM y3 AS Integer
DIM x4 AS Integer
DIM y4 AS Integer
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
14
A Beginner’s Guide to Gambas
’declare an integer array to hold the polyline data
DIM lines AS Integer[]
’clear the drawingarea
da.Clear
’start our first point midscreen about 10 pixels from the top
x1 = da.w/2
y1 = 10
’the next point will be 10 pixels in from far left, down 200 pixels
x2 = da.Left + 10
y2 = da.H { 200
’our
’and
x3 =
y3 =
3rd vertex will be deadcenter of the drawing area on horiz axis
very bottom of the drawing area for vert axis
da.W 20
da.H 20
’and the 4th vertex will be deadcenter x and y of the drawing area
x4 = da.W/2
y4 = da.H/2
’load the vertices into the array
’if we wanted to close the polygon, all we need to do is add the
’x1,y1 vertices to the end of the array
’uncomment the next line to try it and see
’lines = Array(x1, y1, x2, y2, x3, y3, x4, y4, x1, y1)
lines = Array(x1, y1, x2, y2, x3, y3, x4, y4)
’ensure any fill styles are turned off
draw.FillStyle = fill.None
’set the color to dark green
draw.ForeColor = color.DarkGreen
’draw the lines
draw.Polyline(lines)
’refresh to see our work
da.Refresh
END ’of the polyline demo routine
Salvare ed avviare il programma. Al clic sul tasto PolyLine, dovreste vedere qualcosa di simile
alla figura 7.
0.2.4
Image/Picture/Tile
La classe Image disegna un’immagine o parte di essa. I contenuti dell’immagine sono immagazzinati nella memoria del processo, non nel server dello schermo come una Picture. Questa classe si
può creare. Se Width e Height non sono specificati l’immagine è vuota. La sintassi Gambas è:
STATIC SUB Image ( Image AS Image, X AS Integer, Y AS Integer [ , SrcX AS Integer,
SrcY AS Integer, SrcWidth AS Integer, SrcHeight AS Integer ] )
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
A Beginner’s Guide to Gambas
15
Figura 7: Draw polyline per disegnare linee.
Il codice seguente dovrebbe creare una nuova immagine:
DIM hImage AS Image
hImage = NEW Image ( [ Width AS Integer, Height AS Integer ] )
Questa classe si comporta come un array di pixel; X sono le righe ed Y sono le colonne dei pixel
di un’immagine. Di seguito scriviamo il codice per ottenere o impostare un pixel di un’immagine:
DIM hImage AS Image
DIM anInteger AS Integer
anInteger = hImage [ X AS Integer, Y AS Integer ]
Il codice di cui sopra restituisce il colore di un pixel di un’immagine come una coppia (X,Y) mentre
il seguente codice imposterà il colore di un pixel di un’immagine al valore di un Integer:
hImage [ X AS Integer, Y AS Integer ] = anInteger
Image ci consente di utilizzare le seguenti proprietà: Depth, Height, Picture e Width.
Depth restituisce o imposta la profondità dell’immagine. Quando s’impostano i valori di profondità si possono utilizzare esclusivamente i seguenti valori: 2, 8, 16 e 24. La sintassi Gambas
è:
PROPERTY Depth AS Integer
Height è un attributo di sola-lettura che restituisce l’altezza dell’immagine come un integer. La
sintassi Gambas è:
PROPERTY READ Height AS Integer
Width è un attributo di sola-lettura che restituisce la larghezza in pixel dell’immagine. La sintassi
Gambas è:
PROPERTY READ Width AS Integer
Picture (in sola-lettura) converte e restituisce l’immagine in una picture. La sintassi Gambas è:
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
16
A Beginner’s Guide to Gambas
PROPERTY READ Picture AS Picture
La classe Image supporta diversi metodi: Clear, Copy, Fill, Flip, Load, Mirror, Replace, Resize,
Rotate, Save e Stretch.
Clear cancellerà l’immagine, impostando tutti i valori dei pixel a zero.
Copy restituisce una copia dell’immagine o una copia di una parte di essa. Il metodo Copy è
dichiarato come una funzione come nel seguente codice:
FUNCTION Copy ( [ X AS Integer, Y AS Integer, Width AS Integer, Height AS Integer ] ) AS Image
Fill riempie l’immagine con uno colore specifico. La sintassi Gambas è:
SUB Fill ( Color AS Integer )
Flip restituisce una copia riflessa dell’immagine. La copia riflessa è creata a partire dall’asse
orizzontale dell’immagine.
FUNCTION Flip ( ) AS Image
Load carica e Save salva un’immagine rispettivamente da un file o in un file. L’estensione del
file di Path specificherà il formato del file grafico utilizzato con l’immagine salvata. Attualmente
i formati di file supportati sono: JPEG, PNG, BMP, GIF e XPM. La sintassi Gambas è:
SUB Load ( Path AS String )
SUB Save ( Path AS String )
Mirror restituisce una copia riflessa dell’immagine. La copia riflessa è creata a partire dall’asse
verticale dell’immagine.
FUNCTION Mirror ( ) AS Image
Replace cambia un valore di OldColor con il colore specificato da NewColor, come mostrato di
seguito:
SUB Replace ( OldColor AS Integer, NewColor AS Integer )
Resize cambia la dimensione dell’immagine a quella specificata dai parametri di larghezza e di
altezza:
SUB Resize ( Width AS Integer, Height AS Integer )
Rotate restituisce una copia ruotata dell’immagine. La sintassi Gambas è la seguente:
FUNCTION Rotate ( Angle AS Float ) AS Image
La funzione ruoterà l’immagine di n gradi. L’angolo è specificato in gradi, non in radianti.
Stretch restituisce una copia “stirata” dell’immagine. Se il parametro opzionale Smooth è impostato su True, viene applicato un algoritmo dedicato e restituito il risultato. La sintassi Gambas
è:
FUNCTION Stretch ( Width AS Integer, Height AS Integer [ , Smooth AS Boolean ] ) AS Image
La classe Picture realizza una picture, o parte di una picture. I contenuti della Picture sono
archiviati nel server del display non nella memoria del processo come una Image. Ugualmente
se X-Window non gestisce ancora la trasparenza, ogni Picture può avere una maschera. Questa
caratteristica può essere impostata esplicitamente alla istanza della picture, oppure implicitamente
quando si carica un file immagine con trasparenza come una PNG. Quando si disegna su una
picture che possiede una maschera, la picture e la maschera sono di conseguenza modificati. La
sintassi Gambas è:
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
A Beginner’s Guide to Gambas
17
STATIC SUB Picture ( Picture AS Picture, X AS Integer, Y AS Integer [ , SrcX AS Integer,
SrcY AS Integer, SrcWidth AS Integer, SrcHeight AS Integer ] )
Questa classe si può creare. Il seguente codice crea una Picture:
DIM hPicture AS Picture
hPicture = NEW Picture ( [ Width AS Integer, Height AS Integer, Transparent AS Boolean ] )
Se i parametri opzionali Width e Height non sono specificati, la Picture è vuota. È possibile
assegnare una maschera alla Picture con il parametro Transparent. Questa classe agisce come un
array.
DIM hPicture AS Picture
hPicture = Picture [ Path AS String ]
Il codice di cui sopra restituisce un oggetto picture dalla cache interna della picture. Se la picture
non è presente nella cache, viene automaticamente caricata dal file specificato. Per inserire una
picture nella cache interna della picture, utilizzare questo codice:
DIM hPicture AS Picture
Picture [ Path AS String ] = hPicture
Depth restituisce o imposta la profondità della picture. Quando vengono impostati i valori di
profondità si possono assegnare esclusivamente i seguenti valori: 2, 8, 16 e 24. È dichiarata come
PROPERTY Depth AS Integer
Height è un attributo di sola-lettura che restituisce l’altezza della picture come un integer. È
dichiarata come:
PROPERTY READ Height AS Integer
Width è un attributo di sola-lettura che restituisce la larghezza in pixel della picture. È dichiarata
come:
PROPERTY READ Width AS Integer
Image è una proprietà di sola-lettura che converte e restituisce la picture in una image. È
dichiarata come:
PROPERTY READ Image AS Image
Faremo uso di un esempio molto semplice per mostrare come opera questa proprietà. Mostreremo come ricavare uno screenshot con il codice e salvare l’immagine. L’immagine del desktop
è catturata come un oggetto picture quando viene premuto il tasto sul form. Questo oggetto
picture viene successivamente convertito in un oggetto image e visualizzato come un’immagine
in una DrawingArea. Avviare Gambas e creare un nuovo progetto con interfaccia grafica utente,
chiamata gfxDemo2. Rendere il progetto convertibile con controlli pubblici e creare un form per
la classe d’avvio chiamato Form1. Dalla finestra delle proprietà di Form1, impostare la proprietà
resize su True affinché possiate adattare il form per vedere l’immagine quando essa viene aggiunta. Creare un tasto chiamato Button1 ed una DrawingArea chiamata DrawingArea1. Collocare la
DrawingArea nell’angolo superiore sinistro del form e dimensionarla a circa un pollice quadrato.
Quindi posizionare il tasto nell’angolo inferiore destro del form. Aggiungere la caption “Snapshot”
al pulsante. Fare doppio-clic sul tasto per creare un evento clic ed aggiungere il seguente codice:
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
18
A Beginner’s Guide to Gambas
’Gambas class file
PUBLIC SUB Button1_Click()
’declare a var for our picture
p AS NEW Picture
’and one for our image
i AS NEW Image
’get the picture ojbect from the desktop using .Grab method
p = Desktop.Grab()
’assign the picture using the image property to
’convert screenshot to an image
i = p.image
’specify that the contents of the drawing area are cached in memory
Drawingarea1.Cached = TRUE
’resize drawing area to size of the image converted fm picture
DrawingArea1.Resize(i.Width,i.Height)
’clear the drawing area
DrawingArea1.Clear()
’call the Draw.Begin (mandatory) method to start to draw
Draw.Begin(DrawingArea1)
’put the image in the drawing area starting at origin 0,0
Draw.Image(i, 0, 0)
’call the (mandatory) Draw.End method to quit drawing
Draw.End
’make the image visible
DrawingArea1.Visible = TRUE
’refresh the drawing area to see what was done
DrawingArea1.Refresh
END
Salvate ed avviate il programma. Facendo clic sul tasto, uno screenshot del vostro schermo sarà
piazzato sulla DrawigArea del form. Piuttosto semplice, vero?
Transparent è un flag booleano che può essere letto oppure impostato. Esso indica se la
picture possiede o meno una maschera. La sintassi Gambas è:
PROPERTY Transparent AS Boolean
I metodi supportati da Picture includono Clear, Copy, Fill, Flush, Load, Resize e Save.
Clear pulirà la picture, impostando tutti i valori dei pixel a zero.
Copy restituisce una copia della picture o una copia di una parte di essa. Il metodo copy è
dichiarato come una funzione. Ecco un esempio:
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
A Beginner’s Guide to Gambas
19
FUNCTION Copy ( [ X AS Integer, Y AS Integer, Width AS Integer, Height AS Integer ] ) AS Image
Fill riempie la picture con uno specifico colore. La sintassi Gambas è:
SUB Fill ( Color AS Integer )
Flush scarica la cache interna della picture. Il metodo non prevede parametri e viene chiamato
attraverso questa convenzione:
STATIC SUB Flush ( )
Load carica e Save salva una picture rispettivamente da un file o in un file. L’estensione del
file di Path specificherà il formato del file grafico usato con la picture salvata. Attualmente sono
supportati i formati di file JPEG, PNG, BMP, GIF e XPM. La sintassi Gambas è:
SUB Load ( Path AS String )
SUB Save ( Path AS String )
Resize ridimensiona l’immagine a quella specificata dai parametri di larghezza e di altezza:
SUB Resize ( Width AS Integer, Height AS Integer )
Il metodo Tile realizza un disegno a piastrelle nella DrawingArea. La sintassi Gambas è la seguente:
STATIC SUB Tile ( Picture AS Picture, X AS Integer, Y AS Integer, Width AS Integer,
Height AS Integer )
Torniamo dunque al nostro programma dimostrativo gfxDemo e finiamo di scrivere il codice per
l’ultimo tasto. Avviare Gambas e caricare il progetto gfxDemo. Aprire Form1 e fare doppio-clic
sul tasto TileImg. Aggiungere il seguente codice:
PUBLIC SUB TileBtn_Click()
’declare our local vars here
’we will need a picture var to hold the picture we load
DIM mypic AS Picture
’we need a counter var for our loop work
DIM counter AS Integer
’we are also going to need some integer vars
DIM i AS Integer
DIM j AS Integer
’set i and j to zero to start
i = 0
j = 0
’instantiate picture variable, set width, height so it is not void
mypic = NEW Picture(170, 105,FALSE)
’clear the drawing area
da.Clear
’now load the picture using the load method
mypic.Load("Gambas Shrimp.png")
’we will tile the picture i columns across per j rows down
’in our case we will have 4 rows of 3 images per row
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
20
A Beginner’s Guide to Gambas
’so we will need to loop 12 times
FOR counter = 0 TO 11
’draw the tile
draw.Tile(mypic, i*175, j, 170,105)
’increment our column counter
INC i
’check to see if we have three across
IF i MOD 3 = 0 THEN
’if so, move value of j (our y axis) image.height + 5 pixels down
j = j + 110
’reset column counter to zero
i = 0
ENDIF ’our check to see if 3 across
NEXT ’iteration of the loop
’refresh the display to see the work
da.Refresh
END ’of the TileImg button code
L’ultima cosa che dobbiamo fare è procurarci un’immagine da usare nel nostro programma. Ho
scelto la mascot di Gambas utilizzata da un precedente progetto. Potete copiare questa immagine
dal nostro FirstProject. Dalla finestra del progetto, nella cartella TreeView Data, selezionare
New Image. Quando appare la finestra, potete selezionare la tab Existing ed aprire la cartella
FirstProject (assumendo che abbiate chiamato i vostri progetti cosı̀ come li abbiamo specificati
nel libro) e scegliere l’immagine “Gambas mascot.png”. Salvatela nel progetto gfxDemo come
“Gambas shrimp.png” e questo è quanto. Se non trovare l’immagine nel vostro sistema, andate
nel sito web di Gambas e salvatene una copia nella nostra cartella del progetto gfxDemo utilizzando
il tasto destro del mouse sull’immagine della mascot. Salvate ed avviate il programma. Facendo
clic sul tasto TileImg dovreste vedere qualcosa di simile alla figura 8.
0.2.5
Disegnare con un oggetto Drawing
In Gambas, un oggetto drawing è basato sull’uso dello Scalable Vector Graphics, o SVG2 . Secondo
le specifiche di SVG, “SVG è un linguaggio per la descrizione della grafica bi-dimensionale in
XML. SVG consente tre tipi di oggetti grafici: forme grafiche vettoriali (esempio, percorsi consistenti di linee rette e curve), immagini e testo. Gli oggetti grafici possono essere raggruppati,
stilizzati, trasformati e composti in oggetti precedentemente renderizzati. Il set di caratteristiche
include trasformazioni annidate, clipping paths, maschere alfa, effetti filtro ed oggetti modello. I
disegni SVG possono essere interattivi e dinamici. Le animazioni possono essere definite e calibrate o dichiarandole (esempio, inserendo elementi di animazione SVG in un contenuto SVG) o
via scripting.”
Inkscape 3 è un popolare programma usato nella comunità GNU/Linux per creare immagini SVG
ed è quello che ho scelto di utilizzare con questo libro dato che esso è liberamente disponibile su
Internet. Inkscape è un editor grafico vettoriale open source, con capacità simili ad Illustrator,
Freehand, CorelDraw, o Xara X che usano il formato di file standard W3C Scalable Vector Graphics
(SVG).
2 Vedere
3 Vedere
http://www.w3.org/TR/SVG/intro.html per maggiore dettagli su SVG.
http://www.inkscape.org per maggiori dettagli su Inkscape.
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
A Beginner’s Guide to Gambas
21
Figura 8: Uso di immagini a piastrelle con il tasto TileImg.
In Gambas potete caricare, salvare, pulire o copiare un’immagine SVG. Le proprietà a vostra
disposizione sono le più essenziali, vale a dire larghezza, altezza e profondità. Gambas non è concepito per essere un editor SVG. Esso vi offre semplicemente la possibilità di usare immagini SVG
nel vostro programma. Avendo le funzioni per disegnare, siete in grado di realizzare qualcosa. Come esempio, faremo un nuovo programma che carica e visualizza un’immagine SVG. Innanzitutto,
abbiamo bisogno di trovare un’immagine SVG. Io ho scaricato un’immagine di dominio pubblico
utilizzabile liberamente da Internet: http://openclipart.org da usare per il nostro programma. Potete scegliere qualunque immagine voi vogliate per questo programma, purché sia un file in
formato SVG. Creiamo un nuovo progetto con interaccia grafica utente, chiamato gfxDemo3. Rendiamo i controlli del progetto pubblici e traducibili. Creiamo un nuovo form come classe d’avvio,
chiamato Form1. Aggiungere diversi controlli: Scrollview, DrawingArea, Hbox e due tasti. Il form
dovrebbe apparire in modalità design come quello di figura 9. Fare doppio-clic sul form per aprire
la finestra del codice. Iniziamo con il controllo ScrollWiev1. Poi, aggiungere una DrawingArea
nella parte superiore del controllo ScrollView. Chiamare la DrawingArea daSVG. Aggiungere un
Hbox, denominato Hbox1 e due tasti chiamati LoadBtn e QuitBtn. Non dimenticare di aggiungere
la caption (etichetta) ai tasti. Successivamente, fare doppio-clic sul tasto Quit ed aggiungere il
seguente codice:
PUBLIC SUB QuitBtn_Click()
ME.Close
END
Fare doppio-clic sul tasto LoadBtn ed aggiungere il seguente codice:
PUBLIC SUB LoadBtn_Click()
’declare our Drawing object for the SVG file
DIM dra AS Drawing
’instantiate it
dra = NEW Drawing
’now load it using the Load method
dra.Load("floppy.svg")
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
22
A Beginner’s Guide to Gambas
Figura 9: Il programma gfxDemo3 in modalità design.
’set cached property to TRUE to cache it in memory
daSvg.Cached = TRUE
’set visible property to TRUE so we can see the picture
daSvg.Visible = TRUE
’move the drawing area object to start at top left (0,0) origin
dasvg.Move(0,0,dra.Width, dra.Height)
’call the mandatory Draw.Begin to start to draw
draw.Begin(daSvg)
’do the draw
draw.Drawing(dra,0,0)
’call the Draw.End method to quit drawing
draw.end
’refresh our form to see what was done
Form1.Refresh
END
Una volta che avete scaricato o creato il file floppy.svg, salvatelo nella directory del progetto.
Questo è tutto il codice che dobbiamo aggiungere per visualizzare un file SVG. Salvate ed avviate
il programma. All’avvio del programma, fare clic sul tasto Load e dovreste vedere un disegno simile
a quello della figura 10. Spero che vi sia piaciuto il nostro piccolo “tour de force” sulle capacità di
disegno di Gambas. Questo capitolo ha presentato tutti gli elementi base per utilizzare Gambas ad
ogni necessità grafica. Al termine di questo libro, nell’Appendice A, viene presentato uno speciale
programma di grafica che potete utilizzare per disegnare oggetti generati in 2D/3D più avanzati
mediante una classe grafica del tipo GKS creata in Gambas.
0.2.6
Contents of SVG file “floppy.svg” downloaded from http://openclipart.org
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
A Beginner’s Guide to Gambas
23
Figura 10: Caricamento di un file SVG in Gambas.
<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
<svg height="400pt" id="svg548"
sodipodi:docbase="/home/nicu/svg_gal/computers/"
sodipodi:docname="/home/nicu/svg_gal/computers/floppy.svg"
sodipodi:version="0.32" width="400pt" xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink">
<metadata>
<rdf:RDF xmlns:cc="http://web.resource.org/cc/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<cc:Work rdf:about="">
<dc:title>Clipart by Nicu Buculei - antenna</dc:title>
<dc:description></dc:description>
<dc:subject>
<rdf:Bag>
<rdf:li>hash</rdf:li>
<rdf:li></rdf:li>
<rdf:li>computer</rdf:li>
</rdf:Bag>
</dc:subject>
<dc:publisher>
<cc:Agent rdf:about="http://www.openclipart.org">
<dc:title>Nicu Buculei</dc:title>
</cc:Agent>
</dc:publisher>
<dc:creator>
<cc:Agent>
<dc:title>Nicu Buculei</dc:title>
</cc:Agent>
</dc:creator>
<dc:rights>
<cc:Agent>
<dc:title>Nicu Buculei</dc:title>
</cc:Agent>
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
24
A Beginner’s Guide to Gambas
</dc:rights>
<dc:date></dc:date>
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<cc:license rdf:resource="http://web.resource.org/cc/PublicDomain"/>
<dc:language>en</dc:language>
</cc:Work>
<cc:License rdf:about="http://web.resource.org/cc/PublicDomain">
<cc:permits rdf:resource="http://web.resource.org/cc/Reproduction"/>
<cc:permits rdf:resource="http://web.resource.org/cc/Distribution"/>
<cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/>
</cc:License>
</rdf:RDF>
</metadata>
<defs id="defs550"/>
<sodipodi:namedview id="base" showgrid="true"/>
<path d="M 52.5712 53.9929 L 407.003 53.9929 L 443.463 89.6056
L 441.768 447.429 L 53.4191 445.733 L 52.5712
53.9929 z " id="path551" style="fill:#00007b;
fill-rule:evenodd;stroke:black;stroke-opacity:1;stroke-width:3.75;strokelinejoin:miter;stroke-linecap:butt;fill-opacity:1;stroke-dasharray:none;"/>
<path d="M 371.39 53.9929 L 371.39 145.569
C 371.39 145.569 368.846 159.135 355.279 163.375 C 341.713 164.222
156.866 164.223 156.866 164.223 C 156.018 165.071 144.995 157.439
144.147 152.352 C 143.299 147.264 142.451
145.569 142.451 145.569 C 142.451 145.569 144.147 53.145 143.299 53.145
C 142.451 53.145 372.238 53.9929
371.39 53.9929 z " id="path552" sodipodi:nodetypes="cccccccc"
style="fill:#a3a6a6;fill-rule:evenodd;stroke:black;strokeopacity:1;stroke-width:2.32865;stroke-linejoin:miter;stroke-linecap:butt;
fill-opacity:1;stroke-dasharray:none;"
transform="matrix(1.000000,0.000000,0.000000,1.152582,0.000000,-6.413116)"/>
<rect height="185.694977" id="rect553" style="font-size:12;fill:#ffffff;
fill-rule:evenodd;stroke-width:1pt;fill-opacity:1;"
width="321.362518" x="89.879768" y="249.862976"/>
<rect height="9.32714844" id="rect554" style="font-size:12;fill:#808080;
fill-rule:evenodd;stroke-width:1pt;"
width="0.00000000" x="410.394348" y="240.535797"/>
<path d="M 334.929 76.0389 C 334.081 76.0389 282.358 76.0389 282.358 76.0389
L 282.358 165.071 L 334.929
165.071 L 334.929 76.0389 z " id="path555" style="fill:#00007b;
fill-rule:evenodd;stroke:black;stroke-opacity:1;strokewidth:2.5;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:1;
stroke-dasharray:none;"/>
<rect height="55.1149292" id="rect556" style="font-size:12;fill:#dd8080;
fill-rule:evenodd;stroke-width:1pt;fill-opacity:1;"
width="321.362549" x="89.8797607" y="249.862946"/>
<rect height="6.783386" id="rect557" style="font-size:12;fill:#dd8080;
fill-rule:evenodd;stroke-width:1pt;fill-opacity:1;"
width="287.445648" x="105.142365" y="335.503052"/>
<rect height="5.935455" id="rect558" style="font-size:12;fill:#dd8080;
fill-rule:evenodd;stroke-width:1pt;fill-opacity:1;"
width="287.445648" x="104.294426" y="371.115822"/>
<rect height="5.935455" id="rect559" style="font-size:12;fill:#df8080;
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
A Beginner’s Guide to Gambas
25
fill-rule:evenodd;stroke-width:1pt;fill-opacity:1;"
width="286.597717" x="105.142365" y="406.728516"/>
<rect height="5.08750916" id="rect567" style="font-size:12;fill:#000000;
fill-rule:evenodd;stroke-width:1pt;fill-opacity:1;"
width="78.8567657" x="159.409393" y="75.1909637"/>
<rect height="5.08754730" id="rect568" style="font-size:12;fill:#000000;
fill-rule:evenodd;stroke-width:1pt;fill-opacity:1;"
width="58.5066528" x="161.105225" y="87.9097748"/>
<rect height="5.08750916" id="rect569" style="font-size:12;fill:#180003;
fill-rule:evenodd;stroke-width:1pt;fill-opacity:1;"
width="76.3130035" x="161.105225" y="100.628624"/>
<rect height="5.93548584" id="rect570" style="font-size:12;fill:#ffffff;
fill-rule:evenodd;stroke-width:1pt;fill-opacity:1;"
width="114.469490" x="105.990288" y="261.733826"/>
<rect height="5.08752441" id="rect571" style="font-size:12;fill:#ffffff;
fill-rule:evenodd;stroke-width:1pt;fill-opacity:1;"
width="44.0919495" x="106.838211" y="277.844360"/>
<rect height="5.087512" id="rect572" style="font-size:12;fill:#ffffff;
fill-rule:evenodd;stroke-width:1pt;fill-opacity:1;"
width="33.916901" x="178.063675" y="277.844386"/>
<path d="M 150.317 158.228 C 151.899 153.481 148.734 63.2911 155.063 63.2911
C 161.392 63.2911 292.722
61.7089 292.722 61.7089 C 232.595 68.038 164.557 66.4557 150.317
158.228 z " id="path566"
sodipodi:nodetypes="cccc" style="fill:#ffffff;fill-rule:evenodd;
stroke:none;stroke-opacity:1;stroke-width:1pt;strokelinejoin:miter;stroke-linecap:butt;fill-opacity:0.5;"/>
</svg>
This product is [C] 2005 by John W. Rittinghouse, all rights reserved. It is released to the
Gambas User Community under an Open Content License [OCL] and may not be distributed
under any other terms or conditions without the express written consent of the author.
Fly UP