## draw an image of a solderless board (for circuit testing)

Started by RemiD, September 15, 2019, 10:06:17

#### RemiD

`;draw an image of a solderless board, to draw components wires on it (for circuit testing)Graphics(1000,500,32,2)WCount% = 1+75+1 ;number of holes along the widthHCount% = 1+1+1+1+10+1+1+10+1+1+1+1 ;number of holes along the height (for each side)XImage = CreateImage(WCount*10,HCount*10)SetBuffer(ImageBuffer(XImage));color of backgroundClsColor(200,200,200) : Cls();highlight positive holes at topPX% = 1*10 : PY% = 1*10 : PWidth% = (75)*10 : PHeight% = (1)*10Color(255,125,125) : Rect(PX,PY,PWidth,PHeight,True);highlight negative holes at topPX% = 1*10 : PY% = 2*10 : PWidth% = (75)*10 : PHeight% = (1)*10Color(125,125,255) : Rect(PX,PY,PWidth,PHeight,True);highlight positive holes at bottomPX% = 1*10 : PY% = (30-3)*10 : PWidth% = (75)*10 : PHeight% = (1)*10Color(255,125,125) : Rect(PX,PY,PWidth,PHeight,True);highlight negative holes at bottomPX% = 1*10 : PY% = (30-2)*10 : PWidth% = (75)*10 : PHeight% = (1)*10Color(125,125,255) : Rect(PX,PY,PWidth,PHeight,True);holesFor 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,125,125) : Oval(PX+3,PY+3,PWidth-6,Pheight-6,True) NextNext;gaps at topPX% = 0*10 : PY% = 0*10 : PWidth% = (1+75+1)*10 : PHeight% = (1)*10Color(200,200,200) : Rect(PX,PY,PWidth,PHeight,True);gaps at bottomPX% = 0*10 : PY% = (30-1)*10 : PWidth% = (1+75+1)*10 : PHeight% = (1)*10Color(200,200,200) : Rect(PX,PY,PWidth,PHeight,True);gap in the middlePX% = 0*10 : PY% = (15-1)*10 : PWidth% = (1+75+1)*10 : PHeight% = (2)*10Color(200,200,200) : Rect(PX,PY,PWidth,PHeight,True);gap at leftPX% = 0*10 : PY% = 0*10 : PWidth% = (1)*10 : PHeight% = (30)*10Color(200,200,200) : Rect(PX,PY,PWidth,PHeight,True);gap at rightPX% = (75+1)*10 : PY% = 0*10 : PWidth% = (1)*10 : PHeight% = (30)*10Color(200,200,200) : Rect(PX,PY,PWidth,PHeight,True);gap to separate holes from middle top to negative positive topPX% = 0*10 : PY% = 3*10 : PWidth% = (1+75+1)*10 : PHeight% = (1)*10Color(200,200,200) : Rect(PX,PY,PWidth,PHeight,True);gap to separate holes from middle bottom to negative positive bottomPX% = 0*10 : PY% = (30-4)*10 : PWidth% = (1+75+1)*10 : PHeight% = (1)*10Color(200,200,200) : Rect(PX,PY,PWidth,PHeight,True);save the imageXFileName\$ = "solderlessboard"+"-"+Str(WCount-1-1)+"x"+Str(HCount-1-1-1-1-1-1-1-1-1-1)+".bmp"SaveImage(XImage,XFileName);draw the imageSetBuffer(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();finisEnd()`