Very nice "Night" icon, and I'm sure the Moon Macro will come in useful at some stage.
I have 5 more icons to add: "Mute", "Good Luck", "Telephone", "BlueTooth", "Broadcast", "Speaker"
Code: Select all
Declare.i Mute (file$, img.i, size.i, color1.i, color2.i)
Declare.i GoodLuck (file$, img.i, size.i, color1.i, color2.i)
Declare.i Telephone (file$, img.i, size.i, color1.i, color2.i)
Declare.i BlueTooth (file$, img.i, size.i, color.i)
Declare.i Broadcast (file$, img.i, size.i, color.i)
Declare.i Speaker (file$, img.i, size.i, color.i)
Procedure.i Mute (file$, img.i, size.i, color1.i, color2.i)
; file$: name of SVG file which is to be created (only supported on Linux),
; or "" for creating an image in memory
; in : img : number of the image which is to be created, or #PB_Any
; size : width and height (number of pixels)
; color1: foreground color #1
; color2: foreground color #2
; out: return value: if img = #Pb_Any => number of the created image,
; error => 0
; [by davido]
Protected ret.i, p.d
ret = StartVectorIconOutput(file$, img, size)
p = size / 32.0
If ret
VectorSourceColor(color1)
MovePathCursor(p,12*p)
AddPathLine(p,21*p)
AddPathLine(8*p,21*p)
AddPathLine(14*p,26*p)
AddPathLine(14*p,7*p)
AddPathLine(8*p,12*p)
ClosePath()
FillPath()
VectorSourceColor(color2)
RotateCoordinates(23*p,16*p,45)
DrawPlus(23*p,16*p,8*p,2*p)
StopVectorDrawing()
EndIf
ProcedureReturn ret
EndProcedure
Procedure.i GoodLuck (file$, img.i, size.i, color1.i, color2.i)
; file$: name of SVG file which is to be created (only supported on Linux),
; or "" for creating an image in memory
; in : img : number of the image which is to be created, or #PB_Any
; size : width and height (number of pixels)
; color1: foreground color #1
; color2: foreground color #2
; out: return value: if img = #Pb_Any => number of the created image,
; error => 0
; [by davido]
Protected ret.i, p.d, M.i
ret = StartVectorIconOutput(file$, img, size)
p = size / 32.0
If ret
VectorSourceColor(color1)
VectorSourceColor(color2)
MovePathCursor(14*p,16*p)
AddPathLine(17*p,31*p)
StrokePath(2*p)
VectorSourceColor(color1)
For M = 1 To 12
RotateCoordinates(16*p,16*p,30)
If M % 3 <> 0
AddPathEllipse(16*p,8.5*p,4.5*p,7.5*p)
FillPath()
EndIf
Next M
StopVectorDrawing()
EndIf
ProcedureReturn ret
EndProcedure
Procedure.i Telephone (file$, img.i, size.i, color1.i, color2.i)
; file$: name of SVG file which is to be created (only supported on Linux),
; or "" for creating an image in memory
; in : img : number of the image which is to be created, or #PB_Any
; size : width and height (number of pixels)
; color1: foreground color #1
; color2: foreground color #2
; out: return value: if img = #Pb_Any => number of the created image,
; error => 0
; [by davido]
Protected ret.i, p.d
ret = StartVectorIconOutput(file$, img, size)
p = size / 32.0
If ret
VectorSourceColor($fff0ffff)
FillVectorOutput()
VectorSourceColor(color1)
;Receiver
MovePathCursor(4*p,5*p)
AddPathLine(28*p,5*p)
AddPathLine(28*p,8*p)
AddPathLine(26*p,8*p)
AddPathLine(26*p,5*p)
AddPathLine(7*p,5*p)
AddPathLine(7*p,8*p)
AddPathLine(4*p,8*p)
ClosePath()
;Body
MovePathCursor(12*p,16*p)
AddPathLine(4*p,25*p)
AddPathLine(4*p,28*p)
AddPathLine(28*p,28*p)
AddPathLine(28*p,25*p)
AddPathLine(20*p,16*p)
ClosePath()
FillPath(#PB_Path_Preserve)
StrokePath(7*p,#PB_Path_RoundCorner)
MovePathCursor(12.5*p,11*p)
AddPathLine(12.5*p,16*p)
SaveVectorState()
FlipCoordinatesX(15.75*p)
MovePathCursor(12*p,11*p)
AddPathLine(12*p,16.5*p)
StrokePath(3*p,#PB_Path_RoundEnd)
;Keys
RestoreVectorState()
VectorSourceColor(color2)
AddPathBox(9*p,16.5*p,2.5*p,1.25*p)
AddPathBox(14.5*p,16.5*p,2.5*p,1.25*p)
AddPathBox(20*p,16.5*p,2.5*p,1.25*p)
AddPathBox(9*p,21.5*p,2.5*p,1.25*p)
AddPathBox(14.5*p,21.5*p,2.5*p,1.25*p)
AddPathBox(20*p,21.5*p,2.5*p,1.25*p)
AddPathBox(9*p,26.5*p,2.5*p,1.25*p)
AddPathBox(14.5*p,26.5*p,2.5*p,1.25*p)
AddPathBox(20*p,26.5*p,2.5*p,1.25*p)
FillPath(#PB_Path_Preserve)
StrokePath(2*p,#PB_Path_RoundCorner)
StopVectorDrawing()
EndIf
ProcedureReturn ret
EndProcedure
Procedure.i BlueTooth (file$, img.i, size.i, color.i)
; file$: name of SVG file which is to be created (only supported on Linux),
; or "" for creating an image in memory
; in : img : number of the image which is to be created, or #PB_Any
; size : width and height (number of pixels)
; color: foreground color
; out: return value: if img = #Pb_Any => number of the created image,
; error => 0
; [by davido]
Protected ret.i, p.d
ret = StartVectorIconOutput(file$, img, size)
p = size / 32.0
If ret
VectorSourceColor(color)
MovePathCursor(7*p,23*p)
AddPathLine(25*p,9*p)
AddPathLine(16*p,2*p)
AddPathLine(16*p,30*p)
AddPathLine(25*p,23*p)
AddPathLine(7*p,9*p)
StrokePath(2*p)
StopVectorDrawing()
EndIf
ProcedureReturn ret
EndProcedure
Procedure.i Broadcast (file$, img.i, size.i, color.i)
; file$: name of SVG file which is to be created (only supported on Linux),
; or "" for creating an image in memory
; in : img : number of the image which is to be created, or #PB_Any
; size : width and height (number of pixels)
; color: foreground color
; out: return value: if img = #Pb_Any => number of the created image,
; error => 0
; [by davido]
Protected ret.i, p.d
ret = StartVectorIconOutput(file$, img, size)
p = size / 32.0
If ret
VectorSourceColor(color)
MovePathCursor(9*p,29*p)
AddPathLine(23*p,29*p)
StrokePath(3*p,#PB_Path_RoundEnd)
MovePathCursor(16*p,8*p)
AddPathLine(13*p,29*P)
AddPathLine(19*p,29*p)
ClosePath()
FillPath()
StrokePath(3*p,#PB_Path_RoundEnd)
AddPathCircle(16*p,8*p,3*p)
FillPath()
AddPathCircle(16*p,8*p,6*p,330,30)
AddPathCircle(16*p,8*p,10*p,330,30)
AddPathCircle(16*p,8*p,14*p,330,30)
FlipCoordinatesX(16*p)
AddPathCircle(16*p,8*p,6*p,330,30)
AddPathCircle(16*p,8*p,10*p,330,30)
AddPathCircle(16*p,8*p,14*p,330,30)
StrokePath(2*p)
StopVectorDrawing()
EndIf
ProcedureReturn ret
EndProcedure
Procedure.i Speaker (file$, img.i, size.i, color.i)
; file$: name of SVG file which is to be created (only supported on Linux),
; or "" for creating an image in memory
; in : img : number of the image which is to be created, or #PB_Any
; size : width and height (number of pixels)
; color: foreground color
; out: return value: if img = #Pb_Any => number of the created image,
; error => 0
; [by davido]
Protected ret.i, p.d
ret = StartVectorIconOutput(file$, img, size)
p = size / 32.0
If ret
VectorSourceColor(color)
MovePathCursor(p,12*p)
AddPathLine(p,21*p)
AddPathLine(8*p,21*p)
AddPathLine(14*p,26*p)
AddPathLine(14*p,7*p)
AddPathLine(8*p,12*p)
ClosePath()
FillPath()
AddPathCircle(8*p,16*p,13*p,320,40)
AddPathCircle(8*p,16*p,18*p,320,40)
AddPathCircle(8*p,16*p,23*p,320,40)
StrokePath(2*p)
StopVectorDrawing()
EndIf
ProcedureReturn ret
EndProcedure
"Mute", "Good Luck", "Telephone", "BlueTooth", "Broadcast", "Speaker"
NewIcon( Mute (file$, img.i, size.i, #CSS_Black, #CSS_Red))
NewIcon( GoodLuck (file$, img.i, size.i, #CSS_LimeGreen, #CSS_DarkGreen))
NewIcon( Telephone (file$, img.i, size.i, #CSS_Black, #CSS_BurlyWood))
NewIcon( BlueTooth (file$, img.i, size.i, #CSS_Black))
NewIcon( Broadcast (file$, img.i, size.i, #CSS_Black))
NewIcon( Speaker (file$, img.i, size.i, #CSS_Black))
NewIcon( Mute (file$, img.i, size.i, #CSS_Silver, #CSS_Silver))
NewIcon( GoodLuck (file$, img.i, size.i, #CSS_DarkGrey, #CSS_Silver))
NewIcon( Telephone (file$, img.i, size.i, #CSS_Silver, #CSS_Silver))
NewIcon( BlueTooth (file$, img.i, size.i, #CSS_Silver))
NewIcon( Broadcast (file$, img.i, size.i, #CSS_Silver))
NewIcon( Speaker (file$, img.i, size.i, #CSS_Silver))