{
qDebug() << "Start paint function";
HDC hdc = this->getDC();
if (hdc == NULL)
{
qDebug() << "HDC error";
return;
}
qDebug() << "Start painting";
HPEN hPen = CreatePen(PS_SOLID, 4, RGB(0, 255, 0));
if (hPen == NULL)
qDebug() << "CreatePen error";
if (SelectObject(hdc, hPen) == HGDI_ERROR)
qDebug() << "SelectObject error";
if (MoveToEx(hdc, 0, 0, NULL) == 0)
qDebug() << "MoveToEx error";
if (LineTo(hdc, 200, 200) == 0)
qDebug() << "LineTo error";
qDebug() << "End painting";
this->releaseDC(hdc);
qDebug() << "End paint function";
}
void ShotView::paintEvent(QPaintEvent *event)
{
qDebug() << "Start paint function";
HDC hdc = this->getDC();
if (hdc == NULL)
{
qDebug() << "HDC error";
return;
}
qDebug() << "Start painting";
HPEN hPen = CreatePen(PS_SOLID, 4, RGB(0, 255, 0));
if (hPen == NULL)
qDebug() << "CreatePen error";
if (SelectObject(hdc, hPen) == HGDI_ERROR)
qDebug() << "SelectObject error";
if (MoveToEx(hdc, 0, 0, NULL) == 0)
qDebug() << "MoveToEx error";
if (LineTo(hdc, 200, 200) == 0)
qDebug() << "LineTo error";
qDebug() << "End painting";
this->releaseDC(hdc);
qDebug() << "End paint function";
}
To copy to clipboard, switch view to plain text mode
Bookmarks