Code: Select all
Declare.i Tools (img.i, size.i, color.i, Color2.i)
Declare.i Sort (img.i, size.i, color.i)
Declare.i Randomise (img.i, size.i, color.i)
Macro Spanner()
AddPathEllipse(16*p, 7*p, 3.5*p, 5*p, 20, 160)
MovePathCursor(12.7*p,4*p)
AddPathLine(12.7*p,9*p)
MovePathCursor(19.3*p,4*p)
AddPathLine(19.3*p,9*p)
StrokePath(3*p)
MovePathCursor(16*p,13*p)
AddPathLine(16*p,26*p)
StrokePath(4*p,#PB_Path_RoundEnd)
EndMacro
Macro Hammer()
MovePathCursor(13.5*p,28*p)
AddPathLine(18.5*p,28*p)
AddPathLine(17.5*p,11*p)
AddPathLine(13.5*p,11*p)
ClosePath()
FillPath()
MovePathCursor(9*p,7*p)
AddPathLine(9*p,11*p)
MovePathCursor(9*p,10*p)
AddPathLine(10*p,10*p)
AddPathLine(10*p,11*p)
AddPathLine(21*p,11*p)
AddPathLine(21*p,10*p)
AddPathLine(23*p,10*p)
AddPathLine(23*p,11*p)
AddPathLine(26*p,11*p)
AddPathLine(26*p,7*p)
AddPathLine(23*p,7*p)
AddPathLine(23*p,8*p)
AddPathLine(21*p,8*p)
AddPathLine(21*p,7*p)
AddPathLine(10*p,7*p)
AddPathLine(10*p,8*p)
AddPathLine(9*p,8*p)
FillPath()
AddPathEllipse(9*p,9*p,4*p,2*p,90,270)
FillPath()
EndMacro
Procedure.i Tools (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)
; color: foreground color
; out: return value: if img = #Pb_Any => number of the created image,
; error => 0
; [by davido]
Protected ret.i, p.i, half.d
p = size / 32
half = size / 2.0
ret = CreateImage(img, size, size, 32, #Background)
If ret
If img = #PB_Any
img = ret
EndIf
If StartVectorDrawing(ImageVectorOutput(img))
;Spanner tool
VectorSourceColor(color1)
Spanner()
;Hammer tool
RotateCoordinates(16*p,16*p,-104)
Hammer()
StopVectorDrawing()
Else
FreeImage(img)
ret = 0
EndIf
EndIf
ProcedureReturn ret
EndProcedure
Procedure.i Sort (img.i, size.i, color.i)
; 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
p = size / 32
ret = CreateImage(img, size, size, 32, #Background)
If ret
If img = #PB_Any
img = ret
EndIf
If StartVectorDrawing(ImageVectorOutput(img))
VectorSourceColor(color)
;A
MovePathCursor(4*p,14*p)
AddPathLine(8*p,2*p)
AddPathLine(12*p,14*p)
MovePathCursor(6*p,10*p)
AddPathLine(10*p,10*p)
;Z
MovePathCursor(2*p,18*p)
AddPathLine(13*p,18*p)
AddPathLine(3*p,30*p)
AddPathLine(14*p,30*p)
;Double arrows
MovePathCursor(26*p,4*p)
AddPathLine(26*p,28*p)
StrokePath(2*p)
MovePathCursor(21*p,8*p)
AddPathLine(26*p,2*p)
AddPathLine(31*p,8*p)
ClosePath()
FillPath()
MovePathCursor(21*p,24*p)
AddPathLine(26*p,30*p)
AddPathLine(31*p,24*p)
ClosePath()
FillPath()
StopVectorDrawing()
Else
FreeImage(img)
ret = 0
EndIf
EndIf
ProcedureReturn ret
EndProcedure
Procedure.i Randomise (img.i, size.i, color.i)
; 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
p = size / 32
ret = CreateImage(img, size, size, 32, #Background)
If ret
If img = #PB_Any
img = ret
EndIf
If StartVectorDrawing(ImageVectorOutput(img))
VectorSourceColor(color)
MovePathCursor(2*p,9*p)
AddPathLine(12*p,9*p)
AddPathLine(20*p,24*p)
AddPathLine(26*p,24*p)
MovePathCursor(2*p,24*p)
AddPathLine(12*p,24*p)
AddPathLine(20*p,9*p)
AddPathLine(26*p,9*p)
StrokePath(2*p)
MovePathCursor(26*p,5*p)
AddPathLine(26*p,13*p)
AddPathLine(31*p,9*p)
ClosePath()
FillPath()
MovePathCursor(26*p,20*p)
AddPathLine(26*p,28*p)
AddPathLine(31*p,24*p)
ClosePath()
FillPath()
Else
FreeImage(img)
ret = 0
EndIf
EndIf
ProcedureReturn ret
EndProcedure
#ImgTools
#ImgSort
#ImgRandomise
;, "Tools", "Sort", "Randomise"
Tools(#ImgTools, size, #CSS_DimGrey,#CSS_WhiteSmoke)
Sort(#ImgSort, size, #CSS_FireBrick)
Randomise(#ImgRandomise, size, #CSS_Navy)
Tools(#ImgTools + #IconCount, size, #CSS_Silver,#CSS_WhiteSmoke)
Sort(#ImgSort + #IconCount, size, #CSS_Silver)
Randomise(#ImgRandomise + #IconCount, size, #CSS_Silver)
The Tools icon has two associated Macros: Spanner and Hammer. I'll be glad to change these if they don't conform to your the format of your macros.
Thank you for all the additions you have made, I'll need a little time to digest this.