September 23, 2019, 03:06:43 PM

Author Topic: draw an image of a protoboard, to draw components wires on it (for circuit)  (Read 162 times)

Offline RemiD

  • Hero Member
  • *****
  • Posts: 852
Code: [Select]
;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()
DualCore AMD E-450, 1646 MHz - 6 Go DDR3 1333 SDRAM - AMD Radeon HD 6320 Graphics (384 Mo) - Windows 7 Home Premium - DirectX 11.0