类似于xp的任务管理器中的cpu使用记录的网格控件哪里有? ( 积分: 100 )

  • 主题发起人 主题发起人 暮佳雨
  • 开始时间 开始时间

暮佳雨

Unregistered / Unconfirmed
GUEST, unregistred user!
需要一个这样的控件,谢谢
 
需要一个这样的控件,谢谢
 
Chart 應該可以啊
 
我用的是BCB6,Samples里有一个TPerfGraph,类似于CPU使用记录那样的控件,带有源码的,呵呵,Delphi里应该也带有。

不过这个自带的Samples OCX,还不完善,画出的线 容易 出现不连续,可能是个Sample,而且还带有源码,所以也就只能凑合着学习学习,或者就自己改,自己作:)
 
以前写的东西,给你看看:

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
procedure TfrmMain.InitFluxGuid;
var
i,j:integer;
m_rcClient:TRect;
begin
m_rcClient:=bmpGuid.Canvas.ClipRect;

bmpGuid.Canvas.Brush.Color:=clBlack;
bmpGuid.Canvas.FillRect(m_rcClient);

bmpGuid.Canvas.Pen.Style:=psSolid;
bmpGuid.Canvas.Pen.Color:=clBlue;

i:=m_rcClient.Left - 1;
while i<= (m_rcClient.Right) do
begin
Inc(i,13);
bmpGuid.Canvas.MoveTo(i, m_rcClient.top);
bmpGuid.Canvas.LineTo(i, m_rcClient.bottom);
end;

j:=m_rcClient.top - 1;
while j<= (m_rcClient.bottom) do
begin
Inc(j,13);
bmpGuid.Canvas.MoveTo(m_rcClient.left, j);
bmpGuid.Canvas.LineTo(m_rcClient.right, j);
end;

m_yPos := m_rcClient.bottom + 1;
m_yPreviousPos :=m_yPos;
end;

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
procedure TfrmMain.DrawFluxLine;
var
bkRect:TRect;
m_rcClient:TRect;
nX,J:integer;
begin
if bmpGuid=nil then Exit;
if m_yPos<=0 then m_yPos:=3;

m_rcClient:=bmpGuid.Canvas.ClipRect;

bkRect:=Rect(m_rcClient.right - 3, m_rcClient.top, m_rcClient.right, m_rcClient.bottom);

bmpGuid.Canvas.Brush.Color:=clBlack;
bmpGuid.Canvas.FillRect(bkRect);

BitBlt(bmpGuid.Canvas.Handle,0, 0, bmpGuid.Width, bmpGuid.Height,
bmpGuid.Canvas.Handle, 3, 0, SRCCOPY);

bmpGuid.Canvas.Pen.Style:=psSolid;
bmpGuid.Canvas.Pen.Color:=clBlue;

Dec(m_nFirstLinePos,3);
if(m_nFirstLinePos < 0) then
Inc(m_nFirstLinePos,13);

nX := m_rcClient.right - ((m_rcClient.right - m_nFirstLinePos) mod 13) - 1;

bmpGuid.Canvas.MoveTo(nX, m_rcClient.top);
bmpGuid.Canvas.LineTo(nX, m_rcClient.bottom);

j:=m_rcClient.top - 1;
while j<= (m_rcClient.bottom) do
begin
Inc(j,13);
bmpGuid.Canvas.MoveTo(bkRect.left - 3, j);
bmpGuid.Canvas.LineTo(bkRect.right, j);
end;

if m_yPreviousPos = (m_rcClient.bottom + 1) then m_yPreviousPos := m_yPos;

bmpGuid.Canvas.Pen.Color:=clRed;

bmpGuid.Canvas.MoveTo(m_rcClient.right - 11 - 3, pbGuid.Height - m_yPreviousPos);
bmpGuid.Canvas.LineTo(m_rcClient.right - 11, pbGuid.Height - m_yPos);

m_yPreviousPos := m_yPos;

pbGuid.Invalidate;
end;

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
procedure TfrmMain.pbGuidPaint(Sender: TObject);
begin
pbGuid.Canvas.Draw(0,0,bmpGuid);
end;
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
963
DelphiTeacher的专栏
D
后退
顶部