Red de conocimiento informático - Problemas con los teléfonos móviles - VC Drawing Establece el color de la imagen, similar a moveto() y lineto(). Cambiarlos cambiará el color del dibujo.

VC Drawing Establece el color de la imagen, similar a moveto() y lineto(). Cambiarlos cambiará el color del dibujo.

Haga esto en OnPaint

CDialog::OnPaint();

CDC *pDC=GetDC()

for (int i=0; ilt ;= 100; i )

{

CPen pNewPen;

pNewPen.CreatePen(PS_SOLID, 1, RGB(rand()255, rand()255, i255 )); // Color aleatorio

CPen* poldPen=pDC-gt; SelectObject(amp; pNewPen

pDC-gt; /p>

pDC-gt; LineTo(300, i*4);

pDC-gt;