Changeset 50
- Timestamp:
- Mar 29, 2005, 11:32:18 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MacFaceFloat/MacFaceApp.cs
r49 r50 108 108 // Xe[^XEChE 109 109 statusWindow = new Form(); 110 statusWindow.ClientSize = new System.Drawing.Size(3 00, 211);110 statusWindow.ClientSize = new System.Drawing.Size(310, 215); 111 111 statusWindow.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; 112 112 statusWindow.ControlBox = false; 113 113 statusWindow.Icon = new Icon(asm.GetManifestResourceStream("MacFace.FloatApp.App.ico")); 114 statusWindow.Text = " Status";114 statusWindow.Text = "Xe[^X"; 115 115 statusWindow.Paint +=new PaintEventHandler(statusWindow_Paint); 116 116 } … … 319 319 g.SmoothingMode = SmoothingMode.AntiAlias; 320 320 321 g.FillRectangle(new SolidBrush(Color.White), 0, 0, 300, 100); 322 for (int y = 0; y < 100; y += 10) 323 { 324 g.DrawLine(Pens.FloralWhite, 0, y, 300, y); 325 } 326 327 g.FillRectangle(new SolidBrush(Color.White), 0, 110, 300, 100); 321 g.FillRectangle(new SolidBrush(Color.White), 5, 5, 300, 100); 322 Pen pen = new Pen(Color.FromArgb(220, 220, 220), 1F); 323 for (int y = 5; y < 105; y += 10) 324 { 325 g.DrawLine(pen, 5, y, 305, y); 326 } 327 g.DrawRectangle(Pens.Black, 4, 4, 301, 101); 328 329 g.FillRectangle(new SolidBrush(Color.White), 5, 110, 300, 100); 328 330 for (int y = 110; y < 210; y += 10) 329 331 { 330 g.DrawLine(Pens.FloralWhite, 0, y, 300, y); 331 } 332 g.DrawLine(pen, 5, y, 305, y); 333 } 334 g.DrawRectangle(Pens.Black, 4, 109, 301, 101); 332 335 333 336 334 337 if (cpuHistoryCount >= 2) 335 338 { 336 Point[] userGraph = new Point[cpuHistoryCount]; 337 Point[] sysGraph = new Point[cpuHistoryCount]; 339 Point[] userGraph = new Point[cpuHistoryCount+2]; 340 Point[] sysGraph = new Point[cpuHistoryCount+2]; 341 342 userGraph[cpuHistoryCount+0].X = 305 - cpuHistoryCount * 5; 343 userGraph[cpuHistoryCount+0].Y = 105 - 0; 344 userGraph[cpuHistoryCount+1].X = 305 - 0 * 5; 345 userGraph[cpuHistoryCount+1].Y = 105 - 0; 346 347 sysGraph[cpuHistoryCount+0].X = 305 - cpuHistoryCount * 5; 348 sysGraph[cpuHistoryCount+0].Y = 105 - 0; 349 sysGraph[cpuHistoryCount+1].X = 305 - 0 * 5; 350 sysGraph[cpuHistoryCount+1].Y = 105 - 0; 338 351 339 352 int pos = cpuHistoryHead - 1; … … 342 355 if (pos < 0) pos = cpuHistory.Length - 1; 343 356 CPUUsage usage = cpuHistory[pos]; 344 userGraph[i].X = sysGraph[i].X = 300 - i * 5; 345 userGraph[i].Y = 100 - usage.Active; 346 sysGraph[i].Y = 100 - usage.System; 347 //Console.WriteLine("" + pos + ": " + points[i]); 357 userGraph[i].X = sysGraph[i].X = 305 - i * 5; 358 userGraph[i].Y = 105 - usage.Active; 359 sysGraph[i].Y = 105 - usage.System; 348 360 pos--; 349 361 } 350 362 351 g.DrawLines(Pens.Red, sysGraph); 352 g.DrawLines(Pens.Blue, userGraph); 363 g.FillPolygon(new SolidBrush(Color.FromArgb(64, 0, 0, 255)), userGraph); 364 g.DrawPolygon(new Pen(Color.FromArgb(0, 0, 255), 1F), userGraph); 365 g.FillPolygon(new SolidBrush(Color.FromArgb(64, 255, 0, 0)), sysGraph); 353 366 } 354 367 355 368 double rate = 70.0 / (MemoryUsageCounter.TotalVisibleMemorySize * 1024); 356 369 370 g.SmoothingMode = SmoothingMode.None; 371 Brush brush = new SolidBrush(Color.FromArgb(180, 255, 145, 0)); 357 372 int posu = memHistoryHead - 1; 358 373 for (int i = 0; i < memHistoryCount; i++) … … 363 378 int x, y, w, h; 364 379 365 x = 30 0 - i *5;380 x = 305 - i * 5 - 5; 366 381 w = 5; 367 382 h = (int)(usage.Committed * rate); 368 383 y = 210 - h; 369 g.FillRectangle( Brushes.Blue, x, y, w, h);370 371 x = 30 0 - i *5;384 g.FillRectangle(brush, x, y, w, h); 385 386 x = 305 - i * 5 - 5; 372 387 w = 2; 373 388 h = (int)(usage.Pagein); … … 375 390 g.FillRectangle(Brushes.LightGray, x, y, w, h); 376 391 377 x = 30 3 - i *5;392 x = 308 - i * 5 - 5; 378 393 w = 2; 379 394 h = (int)(usage.Pageout); … … 383 398 posu--; 384 399 } 385 g.DrawLine(Pens.Red, 0, 210-70, 300, 210-70);400 g.DrawLine(Pens.Red, 5, 210-70, 305, 210-70); 386 401 } 387 402 }
Note: See TracChangeset
for help on using the changeset viewer.