draw an image of a protoboard, to draw components wires on it (for circuit)

Started by RemiD, August 24, 2019, 20:39:45

Previous topic - Next topic

RemiD


;draw an image of a proto board, to draw components wires on it (for circuit design / layout)
Graphics(1000,500,32,2)

WCount% = 66 ;number of holes along the width
HCount% = 39 ;number of holes along the height

XImage = CreateImage(WCount*10,HCount*10)

SetBuffer(ImageBuffer(XImage))
;color of background
ClsColor(175,150,100) : Cls()
;holes
For WC% = 1 To WCount Step 1
For HC% = 1 To HCount Step 1
  PX% = (WC-1)*10 : PY% = (HC-1)*10 : PWidth% = 10 : PHeight% = 10
  Color(125,100,050) : Oval(PX+3,PY+3,PWidth-6,Pheight-6,True)
Next
Next

;save the image
XFileName$ = "protoboard"+"-"+Str(WCount)+"x"+Str(HCount)+".bmp"
SaveImage(XImage,XFileName)

;draw the image
SetBuffer(BackBuffer())
ClsColor(000,000,000) : Cls()
DrawImage(XImage,0,0)
PX% = 0 : PY% = ImageHeight(XImage)+16 : Color(255,255,255) : Text(PX,PY,XFileName)
Flip()
WaitKey()

;finis
End()