描述:
最好有例子
解决方案1:
其实不是很复杂,根据opengl做就行了,我做过类似的控件,画曲线,不过怎样在控件上绘制按钮还没有实现。
解决方案2:不用在ActiveX中加载,直接放上去个控件就行了。
解决方案3: up,同意楼上的,用Picture控件,补充一下:
要想是一条平面的直线,就把控件的Type属性改成Rectangle,颜色自选
要想是立体的凹下去的,类似于菜单分割条,Type改为Frame,颜色改为Etched
void CDlgLineDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CClientDC pDC(this);
int red = 0;
int green = 0;
int blue = 0;
int width = 2;
int row = 20;
for (int x=0; x<8; ++x)
{
int color = RGB(red,green,blue);
CPen newPen(PS_SOLID, width, color);
CPen* oldPen = pDC.SelectObject(&newPen);
pDC.MoveTo(20, row);
pDC.LineTo(300, row);
pDC.SelectObject(oldPen);
red += 32;
green += 16;
blue += 8;
width += 2;
row += 30;
}
CDialog::OnPaint();
}
}
我一般是在OnPaint里自己画