Ejemplo n.º 1
0
void CVisionTestDlg::ShowViewports()
{
	for (int i=0; i<MAX_CHANNELS ; i++ )
	{
		if ( m_Channels[i].bEnabled )
		{
			CImage * img;
			img = new CImage();

			switch ( m_Channels[i].unBpp )
			{
			case 1:
				// TODO:
				break;

			case 8:
				if (m_Channels[i].bIndexed)
					img->CreateFromIndexed8BPP( m_Channels[i].unWidth, m_Channels[i].unHeight, m_Channels[i].pBuffer );
				else
					img->CreateFromGray( m_Channels[i].unWidth, m_Channels[i].unHeight, m_Channels[i].pBuffer );
				break;

			case 32:
				img->CreateFromRGB( m_Channels[i].unWidth, m_Channels[i].unHeight, m_Channels[i].pBuffer );
				break;
			}
		
			// Copy the image to the dialog and show it
			m_Channels[i].pImageDialog->AddImage( *img );
			m_Channels[i].pImageDialog->ShowWindow( SW_SHOW );

			// Since the image is fully copied, we won't need it anymore.
			delete img;
		}
	}
}