Code: Select all
NewIcon(Flag_Brazil(file$, img, size, #CSS_Green, #CSS_Yellow, #CSS_Blue))
...
NewIcon(Flag_Brazil(file$, img, size, #CSS_DarkGray, #CSS_LightGray, #CSS_DimGrey))
Code: Select all
Procedure.i Flag_Brazil(file$, img.i, size.i, color1.i, color2.i, color3.i)
; in : file$: name of SVG file which is to be created (only supported on Linux),
; or "" for creating an image in memory
; img : number of the image which is to be created, or #PB_Any
; size : width and height (number of pixels)
; out: return value: if img = #Pb_Any => number of the created image,
; error => 0
; [org. by Omi]
Protected ret.i;, I.i
Protected p.d = size / 32
ret = StartVectorIconOutput(file$, img, size)
If ret
VectorSourceColor(#CSS_White)
MovePathCursor(0, p * 16- 1)
AddPathLine (size- 1, p * 16- 1)
StrokePath (p * 20)
VectorSourceColor(color1)
MovePathCursor(1, p * 16)
AddPathLine (size, p * 16)
StrokePath (p * 20)
VectorSourceColor(color2)
MovePathCursor (p * 3, p * 16)
AddPathLine(p * 16, p * 7)
AddPathLine ((p * 14.500)*2, p * 16)
AddPathLine (p * 16, p * 25)
ClosePath()
FillPath ()
VectorSourceColor(color3)
AddPathCircle (p * 16, p * 16, p * 6)
FillPath ()
StopVectorDrawing()
EndIf
ProcedureReturn ret
EndProcedure