Esempio n. 1
0
void CChart2D::OnPaint()
{
 CPaintDC dc(this); // device context for painting

 CDC memPlotDC;
 CBitmap *oldBitmap;
 CBitmap m_plotBitmap;

 // Check if background need to be redrawn
 if (m_updateBackground)
 {
  _DrawBackground(&dc);
  m_updateBackground = false;
 }
 memPlotDC.CreateCompatibleDC(&dc);
 m_plotBitmap.CreateCompatibleBitmap(&dc, m_ctlRect.Width(), m_ctlRect.Height());
 oldBitmap = (CBitmap*)memPlotDC.SelectObject(&m_plotBitmap);

 // BitBlt background
 memPlotDC.BitBlt(0, 0, m_ctlRect.Width(), m_ctlRect.Height(), &memBkDC,0,0,SRCCOPY);
 _PlotSeries(&memPlotDC);

 dc.BitBlt(0,0, m_ctlRect.Width(), m_ctlRect.Height(), &memPlotDC,0,0,SRCCOPY);
 memPlotDC.SelectObject(oldBitmap);
}
Esempio n. 2
0
// Draw-function: called by SCENE
void SliderX::draw(void)
{
	if(!vertexBufferID)
		return;

	glEnable(GL_CULL_FACE);
	glCullFace(GL_BACK);

	// at first, draw the slider's background image.
	_DrawBackground();

	if(DimensionsSwitched)	// then draw the colored slider-bar sized to it's actual value... 
		_DrawBar(4,ValueY,ValueY.MOVE);
	else
		_DrawBar(0,ValueX,ValueX.MOVE);

	// than draw the slider's main-image-frame...
	_DrawForeground();	

	glDisable(GL_CULL_FACE);
	glDisable(GL_TEXTURE_2D);
}