void WglBitmapBufferedContext::deleteOffScreen()
{
	// free-up the off-screen DC
	if (oldBmp_)
	{
		SelectObject(memDC_, oldBmp_);
		oldBmp_ = NULL;
		dibBits_ = NULL;
	}
	if (memBmp_)
	{
		DeleteObject(memBmp_);
		memBmp_ = NULL;
	}

	if (memDC_)
	{
		// use palette: when using 256 color
		if (isPaletteUsed_)	deletePalette(memDC_);

		DeleteDC(memDC_);
		memDC_ = NULL;
	}

	// release DC
	if (hDC_)
	{
		ReleaseDC(hWnd_, hDC_);
		hDC_ = NULL;
	}
}
Ejemplo n.º 2
0
AlignmentView::~AlignmentView()
{
	deletePalette();
	
	for ( int i = 0; i < refByLcb.size(); i++ )
	{
		delete refByLcb[i];
	}
}
void GdiPrintContext::deleteOffScreen()
{
	// free-up the off-screen DC
	if (oldBmp_)
	{
		SelectObject(memDC_, oldBmp_);
		oldBmp_ = NULL;
		dibBits_ = NULL;
	}
	if (memBmp_)
	{
		DeleteObject(memBmp_);
		memBmp_ = NULL;
	}

	if (memDC_)
	{
		// use palette: when using 256 color
		if (isPaletteUsed_)	deletePalette(memDC_);

		DeleteDC(memDC_);
		memDC_ = NULL;
	}
}