Nice picture.

Thank you for the update and improvements.
Hi Oma,
I've just taken a close look at your latest icons: They are incredible!
You have produced a lovely set of professional looking icons. Congratulations.
Code: Select all
Declare.i BatteryCharging (file$, img.i, size.i, color1.i, color2.i, color3.i)
Declare.i Snowflake (file$, img.i, size.i, color.i)
Macro ChargeFlash(_x_,_y_,_size_)
MovePathCursor(_x_ + 0.09375*_size_,_y_-0.4375*_size_)
AddPathLine(_x_-0.21875*_size_,_y_ +0.0625*_size_)
AddPathLine(_x_-0.0625*_size_,_y_+0.0625*_size_)
AddPathLine(_x_-0.0625*_size_,_y_+0.4375*_size_)
AddPathLine(_x_+0.25*_size_,_y_-0.0625*_size_)
AddPathLine(_x_ + 0.09375*_size_,_y_-0.0625*_size_)
ClosePath()
FillPath()
EndMacro
Procedure.i BatteryCharging (file$, img.i, size.i, color1.i, color2.i, color3.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
; color3: foreground color #3
; 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)
DrawRoundBox(14*p,4*p,4*p,3*p,1*p)
FillPath()
VectorSourceColor(color2)
DrawRoundBox(9*p,6*p,14*p,24*p,2*p)
FillPath()
VectorSourceColor(color3)
ChargeFlash(16*p,18*p,18*p)
FillPath()
StopVectorDrawing()
EndIf
ProcedureReturn ret
EndProcedure
Procedure.i Snowflake (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, M.i
ret = StartVectorIconOutput(file$, img, size)
p = size / 32.0
If ret
VectorSourceColor(color)
For M = 1 To 6
MovePathCursor(16*p,16*p)
AddPathLine(16*p,2*p)
MovePathCursor(20*p,3*p)
AddPathLine(16*p,8*p)
AddPathLine(12*p,3*p)
RotateCoordinates(16*p,16*p,60)
StrokePath(2*p,#PB_Path_RoundEnd)
Next M
StopVectorDrawing()
EndIf
ProcedureReturn ret
EndProcedure
"Battery Charging", "Snowflake"
NewIcon( BatteryCharging (file$, img.i, size.i, #CSS_Grey, #CSS_Black, #CSS_Yellow))
NewIcon( Snowflake (file$, img.i, size.i, #CSS_Black))
NewIcon( BatteryCharging (file$, img.i, size.i, #CSS_Grey, #CSS_Silver, #CSS_WhiteSmoke))
NewIcon( Snowflake (file$, img.i, size.i, #CSS_Silver))
Code: Select all
Declare.i A2M (file$, img.i, size.i, color.i)
Declare.i N2Z (file$, img.i, size.i, color.i)
Macro UcaseFont(_x_,_y_,_size_,_Char_,_rotation_=0)
hh = _size_ *0.3125
SaveVectorState()
RotateCoordinates(size * 0.5,size * 0.5,_rotation_)
Select _Char_
Case Asc("A")
hw = hh * 0.9
MovePathCursor(_x_ - hw,_y_ + hh)
AddPathLine(_x_,_y_ - hh)
AddPathLine(_x_ + hw, _y_ + hh)
MovePathCursor(_x_ - hw/1.8,_y_ + hh/3)
AddPathLine(_x_ + hw/1.8,_y_ + hh/3)
Case Asc("B")
hw = hh * 0.81
MovePathCursor(_x_ + hw * 0.08,_y_ - hh)
AddPathLine(_x_ - hw ,_y_ - hh)
AddPathLine(_x_ - hw, _y_ + hh)
MovePathCursor(_x_ - hw + hh,_y_)
AddPathLine(_x_ - hw,_y_)
AddPathCircle(_x_ + hw * 0.08,_y_ - hh/2,hh/2,270,90)
MovePathCursor(_x_ - hw + hh,_y_ + hh)
AddPathLine(_x_ - hw,_y_ + hh)
AddPathCircle(_x_ - hw + hh,_y_ + hh/2,hh/2,270,90)
Case Asc("C")
hw = hh * 0.9
AddPathCircle(_x_, _y_ + hw - hh,hw,200,340)
AddPathCircle(_x_, _y_ - hw + hh,hw,20,160)
MovePathCursor(_x_ - hw * 0.95,_y_ - hh/2.75)
AddPathLine(_x_ - hw * 0.95,_y_ + hh/2.75)
Case Asc("D")
hw = hh * 0.81
MovePathCursor(_x_ - hw/2.5,_y_ - hh)
AddPathLine(_x_ - hw ,_y_ - hh)
AddPathLine(_x_ - hw, _y_ + hh)
MovePathCursor(_x_ - hw/2.5,_y_ + hh)
AddPathLine(_x_ - hw,_y_ + hh)
AddPathCircle(_x_ - hw/2.5,_y_ ,hh,270,90)
Case Asc("E")
hw = hh * 0.81
MovePathCursor(_x_ + hw,_y_ - hh)
AddPathLine(_x_ - hw ,_y_ - hh)
AddPathLine(_x_ - hw, _y_ + hh)
AddPathLine(_x_ + hw,_y_ + hh)
MovePathCursor(_x_ - hw,_y_)
AddPathLine(_x_ + hw * 0.8,_y_)
Case Asc("F")
hw = hh * 0.81
MovePathCursor(_x_ + hw,_y_ - hh)
AddPathLine(_x_ - hw ,_y_ - hh)
AddPathLine(_x_ - hw, _y_ + hh)
MovePathCursor(_x_ - hw,_y_)
AddPathLine(_x_ + hw * 0.8,_y_)
Case Asc("G")
hw = hh * 0.9
AddPathCircle(_x_, _y_ + hw - hh,hw,200,340)
AddPathCircle(_x_, _y_ - hw + hh,hw,20,160)
MovePathCursor(_x_ - hw * 0.95,_y_ - hh/2.75)
AddPathLine(_x_ - hw * 0.95,_y_ + hh/2.75)
MovePathCursor(_x_ + hw/5,_y_ + hh/5)
AddPathLine(_x_ + hw * 0.95,_y_ + hh/5)
AddPathLine(_x_ + hw * 0.95,_y_ + hh/2.75)
Case Asc("H")
hw = hh * 0.81
MovePathCursor(_x_ - hw,_y_ - hh)
AddPathLine(_x_ - hw ,_y_ + hh)
MovePathCursor(_x_ + hw,_y_ - hh)
AddPathLine(_x_ + hw ,_y_ + hh)
MovePathCursor(_x_ - hw,_y_)
AddPathLine(_x_ + hw ,_y_)
Case Asc("I")
hw = hh * 0.81
MovePathCursor(_x_ ,_y_ - hh)
AddPathLine(_x_ ,_y_ + hh)
Case Asc("J")
hw = hh * 0.81
MovePathCursor(_x_ ,_y_ - hh)
AddPathLine(_x_ ,_y_ + hh * 0.55)
AddPathCircle(_x_ - hh/2,_y_ + hh/2, hh/2,0,180)
Case Asc("K")
hw = hh * 0.6
MovePathCursor(_x_ - hw,_y_ - hh)
AddPathLine(_x_ - hw,_y_ + hh)
MovePathCursor(_x_ - hw,_y_ + hh/3)
AddPathLine(_x_ + hw, _y_ - hh)
MovePathCursor(_x_ - hw/8,_y_ - hh/10)
AddPathLine(_x_ + hw,_y_ + hh)
Case Asc("L")
hw = hh * 0.45
MovePathCursor(_x_ - hw,_y_ - hh)
AddPathLine(_x_ - hw ,_y_ + hh)
AddPathLine(_x_ + hw, _y_ + hh)
Case Asc("M")
hw = hh * 0.9
MovePathCursor(_x_ - hw,_y_ + hh)
AddPathLine(_x_ - hw,_y_ - hh)
AddPathLine(_x_, _y_ + hh * 0.05)
AddPathLine(_x_ + hw,_y_ - hh)
AddPathLine(_x_ + hw,_y_ + hh)
Case Asc("N")
hw = hh * 0.81
MovePathCursor(_x_ - hw,_y_ + hh)
AddPathLine(_x_ - hw ,_y_ - hh)
AddPathLine(_x_ + hw ,_y_ + hh)
AddPathLine(_x_ + hw ,_y_ -hh)
Case Asc("O")
hw = hh * 0.9
AddPathCircle(_x_, _y_ + hw - hh,hw,200,340)
AddPathCircle(_x_, _y_ - hw + hh,hw,20,160)
MovePathCursor(_x_ - hw * 0.95,_y_ - hh/2.75)
AddPathLine(_x_ - hw * 0.95,_y_ + hh/2.75)
MovePathCursor(_x_ + hw * 0.95,_y_ - hh/2.75)
AddPathLine(_x_ + hw * 0.95,_y_ + hh/2.75)
Case Asc("P")
hw = hh * 0.81
MovePathCursor(_x_ - hw + hh,_y_ - hh)
AddPathLine(_x_ - hw ,_y_ - hh)
AddPathLine(_x_ - hw, _y_ + hh)
MovePathCursor(_x_ - hw + hh,_y_)
AddPathLine(_x_ - hw,_y_)
AddPathCircle(_x_ - hw + hh,_y_ - hh/2,hh/2,270,90)
Case Asc("Q")
hw = hh * 0.9
AddPathCircle(_x_, _y_ + hw - hh,hw,200,340)
AddPathCircle(_x_, _y_ - hw + hh,hw,20,160)
MovePathCursor(_x_ - hw * 0.95,_y_ - hh/2.75)
AddPathLine(_x_ - hw * 0.95,_y_ + hh/2.75)
MovePathCursor(_x_ + hw * 0.95,_y_ - hh/2.75)
AddPathLine(_x_ + hw * 0.95,_y_ + hh/2.75)
MovePathCursor(_x_ + hw/4,_y_ + hh/4)
AddPathLine(_x_ + hw * 1.1,_y_ + hh * 1.1)
Case Asc("R")
hw = hh * 0.81
MovePathCursor(_x_ - hw + hh,_y_ - hh)
AddPathLine(_x_ - hw ,_y_ - hh)
AddPathLine(_x_ - hw, _y_ + hh)
MovePathCursor(_x_ - hw + hh,_y_)
AddPathLine(_x_ - hw,_y_)
AddPathCircle(_x_ - hw + hh,_y_ - hh/2,hh/2,270,90)
MovePathCursor(PathCursorX() - hw/6,PathCursorY())
AddPathLine(_x_ + hw * 0.7,_y_ + hh)
Case Asc("S")
hw = hh * 0.9
AddPathCircle(_x_ + 0.0125 * _size_,_y_ - 0.0125 * _size_, 0.315625 * _size_,240,320)
AddPathCircle(_x_ - 0.09375 * _size_,_y_ - 0.15625 * _size_, 0.140625 * _size_,250,95,#PB_Path_CounterClockwise)
AddPathLine(_x_ + 0.125 * _size_, _y_ + 0.046875 * _size_)
AddPathCircle(_x_ + 0.125 * _size_,_y_ + 0.1875 * _size_, 0.140625 * _size_,275,70)
AddPathCircle(_x_ + 0.01875 * _size_,_y_ + 0.04375 * _size_, 0.315625 * _size_,60,140)
Case Asc("T")
hw = hh * 0.81
MovePathCursor(_x_ - hw,_y_ - hh)
AddPathLine(_x_ + hw ,_y_ - hh)
MovePathCursor(_x_, _y_ - hh)
AddPathLine(_x_,_y_ + hh)
Case Asc("U")
hw = hh * 0.81
AddPathCircle(_x_, _y_ - hw + hh,hw,20,160)
MovePathCursor(_x_ - hw * 0.95,_y_ - hh)
AddPathLine(_x_ - hw * 0.95,_y_ + hh/2.3)
MovePathCursor(_x_ + hw * 0.95,_y_ - hh)
AddPathLine(_x_ + hw * 0.95,_y_ + hh/2.3)
Case Asc("V")
hw = hh * 0.9
MovePathCursor(_x_ - hw,_y_ - hh)
AddPathLine(_x_ ,_y_ + hh)
AddPathLine(_x_ + hw, _y_ - hh)
Case Asc("W")
hw = hh * 1.5
MovePathCursor(_x_ - hw, _y_ - hh)
AddPathLine(_x_ - hw * 0.5,_y_ + hh)
AddPathLine(_x_,_y_ - hh * 0.5)
AddPathLine(_x_ + hw * 0.5,_y_ + hh)
AddPathLine(_x_ + hw,_y_ - hh)
Case Asc("X")
hw = hh * 0.81
MovePathCursor(_x_ - hw,_y_ - hh)
AddPathLine(_x_ + hw ,_y_ + hh)
MovePathCursor(_x_ + hw, _y_ - hh)
AddPathLine(_x_ - hw,_y_ + hh)
Case Asc("Y")
hw = hh * 0.9
MovePathCursor(_x_ - hw,_y_ - hh)
AddPathLine(_x_ ,_y_)
AddPathLine(_x_ + hw, _y_ - hh)
MovePathCursor(_x_,_y_)
AddPathLine(_x_,_y_ + hh)
Case Asc("Z")
hw = hh * 0.81
hw = hh * 0.81
MovePathCursor(_x_ - hw,_y_ - hh)
AddPathLine(_x_ + hw ,_y_ - hh)
AddPathLine(_x_ - hw, _y_ + hh)
AddPathLine(_x_ + hw,_y_ + hh)
EndSelect
StrokePath(_size_ / 16,#PB_Path_RoundEnd | #PB_Path_RoundCorner)
RestoreVectorState()
EndMacro
Procedure.i A2M (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, hh.d, hw.d, M.i
ret = StartVectorIconOutput(file$, img, size)
p = size / 32.0
If ret
VectorSourceColor(color)
UcaseFont(size * 0.125,size * 0.125,size * 0.25,Asc("A"))
UcaseFont(size * 0.375,size * 0.125,size * 0.25,Asc("B"))
UcaseFont(size * 0.625,size * 0.125,size * 0.25,Asc("C"))
UcaseFont(size * 0.875,size * 0.125,size * 0.25,Asc("D"))
UcaseFont(size * 0.125,size * 0.375,size * 0.25,Asc("E"))
UcaseFont(size * 0.375,size * 0.375,size * 0.25,Asc("F"))
UcaseFont(size * 0.625,size * 0.375,size * 0.25,Asc("G"))
UcaseFont(size * 0.875,size * 0.375,size * 0.25,Asc("H"))
UcaseFont(size * 0.125,size * 0.625,size * 0.25,Asc("I"))
UcaseFont(size * 0.375,size * 0.625,size * 0.25,Asc("J"))
UcaseFont(size * 0.625,size * 0.625,size * 0.25,Asc("K"))
UcaseFont(size * 0.875,size * 0.625,size * 0.25,Asc("L"))
UcaseFont(size * 0.125,size * 0.875,size * 0.25,Asc("M"))
StopVectorDrawing()
EndIf
ProcedureReturn ret
EndProcedure
Procedure.i N2Z (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, hh.d, hw.d
ret = StartVectorIconOutput(file$, img, size)
p = size / 32.0
If ret
VectorSourceColor(color)
UcaseFont(size * 0.125,size * 0.125,size * 0.25,Asc("N"))
UcaseFont(size * 0.375,size * 0.125,size * 0.25,Asc("O"))
UcaseFont(size * 0.625,size * 0.125,size * 0.25,Asc("P"))
UcaseFont(size * 0.875,size * 0.125,size * 0.25,Asc("Q"))
UcaseFont(size * 0.125,size * 0.375,size * 0.25,Asc("R"))
UcaseFont(size * 0.375,size * 0.375,size * 0.25,Asc("S"))
UcaseFont(size * 0.625,size * 0.375,size * 0.25,Asc("T"))
UcaseFont(size * 0.875,size * 0.375,size * 0.25,Asc("U"))
UcaseFont(size * 0.125,size * 0.625,size * 0.25,Asc("V"))
UcaseFont(size * 0.375,size * 0.625,size * 0.25,Asc("W"))
UcaseFont(size * 0.625,size * 0.625,size * 0.25,Asc("X"))
UcaseFont(size * 0.875,size * 0.625,size * 0.25,Asc("Y"))
UcaseFont(size * 0.125,size * 0.875,size * 0.25,Asc("Z"))
StopVectorDrawing()
EndIf
ProcedureReturn ret
EndProcedure
, "N2Z", "A2M"
NewIcon( A2M (file$, img.i, size.i, #CSS_Blue))
NewIcon( N2Z (file$, img.i, size.i, #CSS_Blue))
NewIcon( A2M (file$, img.i, size.i, #CSS_Silver))
NewIcon( N2Z (file$, img.i, size.i, #CSS_Silver))
Hi davido,davido wrote:Looks great on my MacBook, now.
Eminently satisfactory, thank you.Little John wrote: Since nobody else wrote an opinion about this point ... I'd like the code always to comply with the newest final PureBasic version.
Is that OK with you?
Code: Select all
Declare.i RainCloud (file$, img.i, size.i, color1.i, color2.i=0)
Declare.i CloudStorage (file$, img.i, size.i, color1.i, color2.i=0)
Macro DrawCloud(_x_,_y_,_size_,_outline_=0)
MovePathCursor(_x_ + 0.375 * _size_,_y_ + 0.375 * _size_)
AddPathLine(_x_ - 0.375 * _size_,_y_ + 0.375 * _size_)
AddPathCircle(_x_ - 0.21825 * _size_,_y_ + 0.21825 * _size_,0.221875 * _size_,138,225.25)
AddPathCircle(_x_ - 0.15625 * _size_,_y_,0.21875 * _size_,166,270,#PB_Path_Connected)
AddPathCircle(_x_ + 0.03125 * _size_,_y_ - 0.125 * _size_,0.20625 * _size_,207,15,#PB_Path_Connected)
AddPathCircle(_x_ + 0.1875 * _size_,_y_ + 0.1953125 * _size_,0.2625 * _size_,280,42,#PB_Path_Connected)
ClosePath()
If _outline_ = #False
FillPath(#PB_Path_Preserve)
EndIf
StrokePath(p,#PB_Path_RoundEnd)
EndMacro
Macro DrawBalloon(_x_,_y_,_size_,_rotation_=0)
SaveVectorState()
RotateCoordinates(size * 0.5,size * 0.5,_rotation_)
MovePathCursor(_x_,_y_ + _size_ * 0.4375)
AddPathCurve(_x_ - _size_ * 1.125,_y_ - _size_ *0.71875,_x_ + _size_ * 1.125,_y_ - _size_ *0.71875,_x_,_y_ + _size_ * 0.4375)
StrokePath(_size_ / 32,#PB_Path_RoundEnd | #PB_Path_RoundCorner | #PB_Path_Preserve)
FillPath()
RestoreVectorState()
EndMacro
Procedure.i RainCloud (file$, img.i, size.i, color1.i, color2.i=0)
; 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)
DrawCloud(16*p,12*p,size/1.25,1)
VectorSourceColor(color2)
DrawBalloon(24*p,4*p,size/8,180)
DrawBalloon(20*p,8*p,size/9,180)
DrawBalloon(16*p,4*p,size/8,180)
DrawBalloon(12*p,8*p,size/9,180)
DrawBalloon(8*p,4*p,size/8,180)
StopVectorDrawing()
EndIf
ProcedureReturn ret
EndProcedure
Procedure.i CloudStorage (file$, img.i, size.i, color1.i, color2.i=0)
; 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)
DrawCloud(16*p,12*p,size)
VectorSourceColor(color2)
MovePathCursor(6*p,13*p)
AddPathLine(6*p,19*p)
AddPathEllipse(11*p,16*p,2*p,2.5*p)
MovePathCursor(16*p,13*p)
AddPathLine(16*p,19*p)
AddPathEllipse(21*p,16*p,2*p,2.5*p)
MovePathCursor(26*p,13*p)
AddPathLine(26*p,19*p)
StrokePath(P)
StopVectorDrawing()
EndIf
ProcedureReturn ret
EndProcedure
"Rain Cloud", "Cloud Storage"
NewIcon( RainCloud (file$, img.i, size.i, #CSS_AliceBlue, #CSS_Silver))
NewIcon( CloudStorage (file$, img.i, size.i, #CSS_AliceBlue, #CSS_Blue))
NewIcon( RainCloud (file$, img.i, size.i, #CSS_WhiteSmoke, #CSS_Silver))
NewIcon( CloudStorage (file$, img.i, size.i, #CSS_Silver, #CSS_DarkGrey))