Changeset 51


Ignore:
Timestamp:
Mar 30, 2005, 11:47:58 PM (19 years ago)
Author:
altba\rryu
Message:

メモリ関係のグラフ表示の内容をもう少し充実させてみた。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MacFaceFloat/MacFaceApp.cs

    r50 r51  
    270270                        patternWindow.UpdatePattern(suite, pattern, markers);
    271271
    272                         statusWindow.Refresh();
     272                        statusWindow.Invalidate();
    273273                }
    274274
     
    325325                                g.DrawLine(pen, 5, y, 305, y);
    326326                        }
     327                        g.DrawLine(Pens.Gray, 5, 55, 305, 55);
     328
    327329                        g.DrawRectangle(Pens.Black, 4, 4, 301, 101);
    328330
    329331                        g.FillRectangle(new SolidBrush(Color.White), 5, 110, 300, 100);
    330                         for (int y = 110; y < 210; y += 10)
     332                        for (int y = 210; y > 110; y -= 7)
    331333                        {
    332334                                g.DrawLine(pen, 5, y, 305, y);
    333335                        }
     336                        g.DrawLine(Pens.Gray, 5, 210-5*7, 305, 210-5*7);
    334337                        g.DrawRectangle(Pens.Black, 4, 109, 301, 101);
    335338
     
    361364                                }
    362365
    363                                 g.FillPolygon(new SolidBrush(Color.FromArgb(64, 0, 0, 255)), userGraph);
     366                                g.FillPolygon(new SolidBrush(Color.FromArgb(50, 0, 0, 255)), userGraph);
    364367                                g.DrawPolygon(new Pen(Color.FromArgb(0, 0, 255), 1F), userGraph);
    365                                 g.FillPolygon(new SolidBrush(Color.FromArgb(64, 255, 0, 0)), sysGraph);
    366                         }
    367 
    368                         double rate = 70.0 / (MemoryUsageCounter.TotalVisibleMemorySize * 1024);
     368                                g.FillPolygon(new SolidBrush(Color.FromArgb(50, 255, 0, 0)), sysGraph);
     369                        }
     370
     371                        int totalMemory = (int)MemoryUsageCounter.TotalVisibleMemorySize * 1024;
     372                        double rate = 70.0 / totalMemory;
    369373
    370374                        g.SmoothingMode = SmoothingMode.None;
    371                         Brush brush = new SolidBrush(Color.FromArgb(180, 255, 145, 0));
     375                        Brush commitedBrush = new SolidBrush(Color.FromArgb(180, 255, 145, 0));
     376                        Brush uncommitedBrush = new SolidBrush(Color.FromArgb(180, 180, 200, 255));
     377                        Brush availableBrush = new SolidBrush(Color.FromArgb(180, 100, 100, 255));
     378
    372379                        int posu = memHistoryHead - 1;
    373380                        for (int i = 0; i < memHistoryCount; i++)
     
    380387                                x = 305 - i * 5 - 5;
    381388                                w = 5;
     389
    382390                                h = (int)(usage.Committed * rate);
    383391                                y = 210 - h;
    384                                 g.FillRectangle(brush, x, y, w, h);
     392                                g.FillRectangle(commitedBrush, x, y, w, h);
     393
     394                                if (h < 100)
     395                                {
     396                                        h = 100 - h;
     397                                        y = 110;
     398                                        g.FillRectangle(uncommitedBrush, x, y, w, h);
     399                                }
     400
     401                                h = (int)(usage.Available * rate);
     402                                y = 210-70;
     403                                g.FillRectangle(availableBrush, x, y, w, h);
    385404
    386405                                x = 305 - i * 5 - 5;
     
    398417                                posu--;
    399418                        }
    400                         g.DrawLine(Pens.Red, 5, 210-70, 305, 210-70);
     419                        g.DrawLine(Pens.Black, 5, 210-70, 305, 210-70);
    401420                }
    402421        }
Note: See TracChangeset for help on using the changeset viewer.