Click here to Skip to main content
15,892,643 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan11-Mar-20 22:35
mveRichard MacCutchan11-Mar-20 22:35 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru11-Mar-20 23:27
Calin Negru11-Mar-20 23:27 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan11-Mar-20 23:36
mveRichard MacCutchan11-Mar-20 23:36 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru12-Mar-20 0:18
Calin Negru12-Mar-20 0:18 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan12-Mar-20 2:31
mveRichard MacCutchan12-Mar-20 2:31 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru12-Mar-20 4:40
Calin Negru12-Mar-20 4:40 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan12-Mar-20 5:10
mveRichard MacCutchan12-Mar-20 5:10 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru13-Mar-20 3:22
Calin Negru13-Mar-20 3:22 
I was only using a part of the bitmap processing code I was using as reference. I don`t need the palette part so I trimmed out a bit too much.

m_pDib = pDib;
	m_dwDibSize = dwDibSize;

	// Pointer our BITMAPINFOHEADER and RGBQUAD
	// variables to the correct place in the Dib data.
	m_pBIH = (BITMAPINFOHEADER *) m_pDib;
	m_pPalette =
		(RGBQUAD *) &m_pDib[sizeof(BITMAPINFOHEADER)];

	//	get image width and height
	m_width = m_pBIH->biWidth;
	m_height = m_pBIH->biHeight;

	// Calculate the number of palette entries.
	m_nPaletteEntries = 1 << m_pBIH->biBitCount;
	if( m_pBIH->biBitCount > 8 )
		m_nPaletteEntries = 0;
	else if( m_pBIH->biClrUsed != 0 )
		m_nPaletteEntries = m_pBIH->biClrUsed;

	// Point m_pDibBits to the actual Dib bits data.
	m_pDibBits =
		&m_pDib[sizeof(BITMAPINFOHEADER)+
			m_nPaletteEntries*sizeof(RGBQUAD)];

	// If we have a valid palette, delete it.
	if( m_Palette.GetSafeHandle() != NULL )
		m_Palette.DeleteObject();


I know I must go past the bitmapinfoheader to get to the pixels

modified 13-Mar-20 14:06pm.

GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan13-Mar-20 4:22
mveRichard MacCutchan13-Mar-20 4:22 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru13-Mar-20 7:50
Calin Negru13-Mar-20 7:50 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan13-Mar-20 8:07
mveRichard MacCutchan13-Mar-20 8:07 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru13-Mar-20 21:07
Calin Negru13-Mar-20 21:07 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan13-Mar-20 23:04
mveRichard MacCutchan13-Mar-20 23:04 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru14-Mar-20 3:30
Calin Negru14-Mar-20 3:30 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan14-Mar-20 3:47
mveRichard MacCutchan14-Mar-20 3:47 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru14-Mar-20 7:11
Calin Negru14-Mar-20 7:11 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan14-Mar-20 7:13
mveRichard MacCutchan14-Mar-20 7:13 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru14-Mar-20 8:18
Calin Negru14-Mar-20 8:18 
GeneralRe: c libraries needed to deal with bitmaps Pin
phil.o14-Mar-20 8:37
professionalphil.o14-Mar-20 8:37 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan14-Mar-20 9:27
mveRichard MacCutchan14-Mar-20 9:27 
GeneralRe: c libraries needed to deal with bitmaps Pin
phil.o14-Mar-20 9:34
professionalphil.o14-Mar-20 9:34 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan14-Mar-20 21:58
mveRichard MacCutchan14-Mar-20 21:58 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru12-Mar-20 0:35
Calin Negru12-Mar-20 0:35 
GeneralRe: c libraries needed to deal with bitmaps Pin
Victor Nijegorodov11-Mar-20 22:45
Victor Nijegorodov11-Mar-20 22:45 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru12-Mar-20 0:43
Calin Negru12-Mar-20 0:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.