freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

c語言下的交通模擬燈軟件開發(fā)設(shè)計(jì)畢業(yè)論文-資料下載頁(yè)

2025-06-28 08:29本頁(yè)面
  

【正文】 OnPaint(PaintEventArgs e) 139. { 140. (e)。 141. Resize()。 142. ()。 143. ()。 144. ()。 145. } 146. 147. //控制直行燈的變化 148. public void TurnGreen(int nLight) 149. { 150. if (nLight == 1) 151. { 152. = (0, 255, 0)。 153. = iSGTime。 154. } 155. else 156. { 157. = (255, 0, 0)。 158. = iSRTime。 159. } 160. } 161. 162. //控制左行燈的變化 163. public void TurnGreen2(int nLight) 164. { 165. if (nLight == 1) 166. { 167. = (0, 255, 0)。 168. = iLGTime。 169. } 31170. else 171. { 172. = (255, 0, 0)。 173. = iLRTime。 174. } 175. } 176. 177. private void Resize() 178. { 179. int w, h, d。 180. w = 。 181. h = 。 182. d = w / 4。 183. 184. if (d h) 185. d = h。 186. (d / 4, (h d) / 2, d, d)。 187. (d + d / 2, (h d) / 2, d, d)。 188. (2 * d + 3 * d / 4, (h d) / 2, d, d)。 189. } 190. 191. //開啟定時(shí)器 192. private void trafficLightCtrl_Load(object sender, EventArgs e) 193. { 194. = (255, 0, 0)。 195. = (255, 0, 0)。 196. = (0, 255, 0)。 197. 198. = 1。 199. = 40000。 200. currentSIndex = 0。 201. currentLIndex = 0。 202. ()。 203. ()。 204. } 205. 206. //定時(shí)器 207. private void timer1_Tick(object sender, EventArgs e) 208. { 209. int nLight = currentSIndex + 1。 210. if (nLight 2) 211. { 32212. nLight = 1。 213. } 214. currentSIndex = nLight。 215. TurnGreen(nLight)。 216. ()。 //重新繪制控件 217. } 218. 219. private void timer2_Tick(object sender, EventArgs e) 220. { 221. int nLight = currentLIndex + 1。 222. if (nLight 2) 223. { 224. nLight = 1。 225. } 226. currentLIndex = nLight。 227. TurnGreen2(nLight)。 228. ()。 //重新繪制控件 229. } 230. } 231. } 附 B 西東車輛和路況實(shí)現(xiàn)代碼41. using System。 42. using 。 43. using 。 44. using 。 45. using 。 46. using 。 47. using 。 48. using 。 49. 50. namespace trafficLight 51. { 52. public partial class weRoadCar : UserControl 53. { 54. //成員變量 55. int currentSCarNum = 2。 56. int currentLCarNum = 1。 57. int i = 0。 58. int yS = 0。 59. int yL = 0。 3360. int width = 0。 61. int height = 0。 62. public Color FillColor = (0, 0, 0)。 63. 64. //構(gòu)造函數(shù) 65. public weRoadCar() 66. { 67. InitializeComponent()。 68. } 69. 70. public int CurrentSCarNum 71. { 72. get { return currentSCarNum。 } 73. set { currentSCarNum = value。 } 74. } 75. 76. public int CurrentLCarNum 77. { 78. get { return currentLCarNum。 } 79. set { currentLCarNum = value。 } 80. } 81. 82. public void setTimerInterval(int iTime) 83. { 84. = iTime * 1000。 85. } 86. 87. //畫圖 88. public void Paint(Graphics g) 89. { 90. yS = / 24 * 23。 91. yL = / 24 * 17。 92. width = / 12。 93. height = / 12。 94. 95. float[] dashValues = { 1, 1 }。 96. Pen blackPen = new Pen(, 1)。 97. = dashValues。 98. 99. //畫路線 100. (, 1, 0, , 0)。 34101. (, 1, / 2, , / 2)。 102. (blackPen, 1, / 3 * 2, , / 3 * 2)。 103. (blackPen, 1, / 7 * 6, , / 7 * 6)。 104. (, 1, 1, , 1)。 105. 106. //畫直行車輛 107. for (i = 1。 i = currentSCarNum。 i++) 108. { 109. (, ( width * i) 2 * i, yS, width, height)。 110. (new SolidBrush(), ( width * i) 2 * i, yS, width, height)。 111. } 112. //畫左行車輛 113. for (i = 1。 i = currentLCarNum。 i++) 114. { 115. (, ( width * i) 2 * i, yL, width, height)。 116. (new SolidBrush(), ( width * i) 2 * i, yL, width, height)。 117. } 118. } 119. 120. protected override void OnPaint(PaintEventArgs e) 121. { 122. (e)。 123. ()。 124. } 125. 126. //定時(shí)器 127. private void timer1_Tick(object sender, EventArgs e) 128. { 129. //直行車輛產(chǎn)生時(shí)間為 3—8s 隨機(jī) 130. Random rd = new Random()。 131. = (3, 8) * 1000。 132. CurrentSCarNum += 1。 133. ()。 //重新繪制控件 134. } 35135. 136. private void weRoadCar_Load(object sender, EventArgs e) 137. { 138. Random rd = new Random()。 139. = (3, 8) * 1000。 140. ()。 141. = (8, 12) * 1000。 142.
點(diǎn)擊復(fù)制文檔內(nèi)容
法律信息相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1