要在启动对话框时画幅图,要怎么调用函数? 20
voidCalgorithm_ChessBoard_Page20Dlg::OnPaint(){CPaintDCdc(this);if(IsIconic()){//用于绘制...
void Calgorithm_ChessBoard_Page20Dlg::OnPaint()
{
CPaintDC dc(this);
if (IsIconic())
{
// 用于绘制的设备上下文
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
// 使图标在工作区矩形中居中
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;
// 绘制图标
}
else
{
CDialog::OnPaint();
}
for ( int i=0; i<=16; i++ )
{
dc.Rectangle(i*WIDTH,0,i*WIDTH,16*WIDTH);运行过,但最后没有显示
dc.Rectangle(0,i*WIDTH,16*WIDTH,i*WIDTH);
}
} 展开
{
CPaintDC dc(this);
if (IsIconic())
{
// 用于绘制的设备上下文
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
// 使图标在工作区矩形中居中
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;
// 绘制图标
}
else
{
CDialog::OnPaint();
}
for ( int i=0; i<=16; i++ )
{
dc.Rectangle(i*WIDTH,0,i*WIDTH,16*WIDTH);运行过,但最后没有显示
dc.Rectangle(0,i*WIDTH,16*WIDTH,i*WIDTH);
}
} 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询