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