Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Transparent Rectangle
Message
 
À
06/06/2003 10:12:18
Information générale
Forum:
Visual C++
Catégorie:
Autre
Divers
Thread ID:
00795934
Message ID:
00797442
Vues:
25
It should be something like this:
void CMouseDlg::DrawSquare(int X, int Y) {
	if ((m_iPrevX != X) || (m_iPrevY != Y)) {
		// Get the Device Context
		CClientDC dc(this);
		// Select null brush
		CBrush* oldBrush = dc.SelectStockObject(NULL_BRUSH);
		// Draw a square based on coord
		dc.Rectangle(m_iPrevX, m_iPrevY, X, Y);
		// Select old brush
		dc.SelectObject(oldBrush);
		m_iPrevX = -1;
		m_iPrevY = -1;	
	}
}

void CMouseDlg::DrawCircle(int X, int Y) {
	if ((m_iPrevX != X) || (m_iPrevY != Y)) {
		// Get the Device Context
		CClientDC dc(this);
		// Select null brush
		CBrush* oldBrush = dc.SelectStockObject(NULL_BRUSH);
		// Draw an ellipse based on coord
		dc.Ellipse(m_iPrevX, m_iPrevY, X, Y);
		// Select old brush
		dc.SelectObject(oldBrush);
		m_iPrevX = -1;
		m_iPrevY = -1;	
	}
}
>I am starting in vc++ and this is a little project of University.

Good luck!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform