Your point regarding the fruit icons is well-taken. I have reposted as you suggested.
Code: Select all
Declare.i CitrusFruits (img.i, size.i, color1.i, color2.i)
Declare.i Action (img.i, size.i, color1.i, color2.i, color3.i, color4.i)
Declare.i Move (img.i, size.i, color1.i)
Procedure.i CitrusFruits (img.i, size.i, color1.i, color2.i)
; 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
ret = StartVectorIconOutput(img, size)
If ret
VectorSourceColor(color1)
AddPathCircle(0.5*size,0.5*size,0.45*size)
StrokePath(0.03125*size)
VectorSourceColor(color2)
AddPathCircle(0.5*size,0.5*size,0.45*size)
FillPath()
VectorSourceColor(color1)
AddPathCircle(0.5*size,0.5*size,0.40*size)
FillPath()
VectorSourceColor(color2)
MovePathCursor(0.49*size,0.5*size)
AddPathLine(0.48*size,0.1*size)
AddPathLine(0.52*size,0.1*size)
AddPathLine(0.51*size,0.5*size)
ClosePath()
RotateCoordinates(0.5*size,0.5*size,50)
MovePathCursor(0.49*size,0.5*size)
AddPathLine(0.48*size,0.1*size)
AddPathLine(0.52*size,0.1*size)
AddPathLine(0.51*size,0.5*size)
ClosePath()
RotateCoordinates(0.5*size,0.5*size,75)
MovePathCursor(0.49*size,0.5*size)
AddPathLine(0.48*size,0.1*size)
AddPathLine(0.52*size,0.1*size)
AddPathLine(0.51*size,0.5*size)
ClosePath()
RotateCoordinates(0.5*size,0.5*size,45)
MovePathCursor(0.49*size,0.5*size)
AddPathLine(0.48*size,0.1*size)
AddPathLine(0.52*size,0.1*size)
AddPathLine(0.51*size,0.5*size)
ClosePath()
RotateCoordinates(0.5*size,0.5*size,65)
MovePathCursor(0.49*size,0.5*size)
AddPathLine(0.48*size,0.1*size)
AddPathLine(0.52*size,0.1*size)
AddPathLine(0.51*size,0.5*size)
ClosePath()
RotateCoordinates(0.5*size,0.5*size,55)
MovePathCursor(0.49*size,0.5*size)
AddPathLine(0.48*size,0.1*size)
AddPathLine(0.52*size,0.1*size)
AddPathLine(0.51*size,0.5*size)
ClosePath()
FillPath()
AddPathCircle(0.5*size,0.5*size,0.0625*size)
FillPath()
StopVectorDrawing()
EndIf
ProcedureReturn ret
EndProcedure
Procedure.i Action (img.i, size.i, color1.i, color2.i, color3.i, color4.i)
; 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
; color4: foreground color #4
; out: return value: if img = #Pb_Any => number of the created image,
; error => 0
; [by davido]
Protected ret.i
ret = StartVectorIconOutput(img, size)
If ret
VectorSourceColor(color1)
AddPathEllipse(0.5*size,0.5*size,0.46875*size,0.1875*size)
StrokePath(0.0625*size)
RotateCoordinates(0.5*size,0.5*size,60)
VectorSourceColor(color2)
AddPathEllipse(0.5*size,0.5*size,0.46875*size,0.1875*size)
StrokePath(0.0625*size)
RotateCoordinates(0.5*size,0.5*size,60)
VectorSourceColor(color3)
AddPathEllipse(0.5*size,0.5*size,0.46875*size,0.1875*size)
StrokePath(0.0625*size)
VectorSourceColor(color3)
AddPathCircle(0.5*size,0.5*size,0.09375*size)
FillPath()
StopVectorDrawing()
EndIf
ProcedureReturn ret
EndProcedure
Procedure.i Move (img.i, size.i, color1.i)
; 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
; out: return value: if img = #Pb_Any => number of the created image,
; error => 0
; [by davido]
Protected ret.i
ret = StartVectorIconOutput(img, size)
If ret
VectorSourceColor(color1)
MovePathCursor(0.3125 * size, 0.21875 * size)
AddPathLine(0.5 * size, 0.03125 * size)
AddPathLine(0.6875 * size, 0.21875 * size)
AddPathLine(0.53125 * size, 0.21875 * size)
AddPathLine(0.53125 * size, 0.46875 * size)
AddPathLine(0.78125 * size, 0.46875 * size)
AddPathLine(0.78125 * size, 0.3125 * size)
AddPathLine(0.96875 * size, 0.5 * size)
AddPathLine(0.78125 * size, 0.6875 * size)
AddPathLine(0.78125 * size, 0.53125 * size)
AddPathLine(0.53125 * size, 0.53125 * size)
AddPathLine(0.53125 * size, 0.78125 * size)
AddPathLine(0.6875 * size, 0.78125 * size)
AddPathLine(0.5 * size, 0.96875 * size)
AddPathLine(0.3125 * size, 0.78125 * size)
AddPathLine(0.46875 * size, 0.78125 * size)
AddPathLine(0.46875 * size, 0.53125 * size)
AddPathLine(0.21875 * size, 0.53125 * size)
AddPathLine(0.21875 * size, 0.6875 * size)
AddPathLine(0.03125 * size, 0.5 * size)
AddPathLine(0.21875 * size, 0.3125 * size)
AddPathLine(0.21875 * size, 0.46875 * size)
AddPathLine(0.46875 * size, 0.46875 * size)
AddPathLine(0.46875 * size, 0.21875 * size)
AddPathLine(0.3125 * size, 0.21875 * size)
FillPath()
StopVectorDrawing()
EndIf
ProcedureReturn ret
EndProcedure
#ImgOrangeFruit
#ImgLemonFruit
#ImgLimeFruit
#ImgAction
#ImgMove
"Orange Fruit" , "Lemon Fruit" , "Lime Fruit" , "Action" , "Move"
CitrusFruits(#ImgOrangeFruit, size, #CSS_Orange, #CSS_WhiteSmoke)
CitrusFruits(#ImgLemonFruit, size, #CSS_Khaki, #CSS_WhiteSmoke)
CitrusFruits(#ImgLimeFruit, size, #CSS_LimeGreen, #CSS_WhiteSmoke)
Action(#ImgAction, size.i, #CSS_Red, #CSS_LightGreen, #CSS_Blue, #CSS_Black)
Move(#ImgMove, size.i, #CSS_Black)
CitrusFruits(#ImgOrangeFruit + #IconCount, size, #CSS_Silver, #CSS_WhiteSmoke)
CitrusFruits(#ImgLemonFruit + #IconCount, size, #CSS_Silver, #CSS_WhiteSmoke)
CitrusFruits(#ImgLimeFruit + #IconCount, size, #CSS_Silver, #CSS_WhiteSmoke)
Action(#ImgAction + #IconCount, size.i, #CSS_Silver, #CSS_Silver, #CSS_Silver, #CSS_Silver)
Move(#ImgMove + #IconCount, size.i, #CSS_Silver)