Click here to Skip to main content
15,794,475 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan11-Mar-20 23:35
mveRichard MacCutchan11-Mar-20 23:35 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru12-Mar-20 0:27
Calin Negru12-Mar-20 0:27 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan12-Mar-20 0:36
mveRichard MacCutchan12-Mar-20 0:36 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru12-Mar-20 1:18
Calin Negru12-Mar-20 1:18 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan12-Mar-20 3:31
mveRichard MacCutchan12-Mar-20 3:31 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru12-Mar-20 5:40
Calin Negru12-Mar-20 5:40 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan12-Mar-20 6:10
mveRichard MacCutchan12-Mar-20 6:10 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru13-Mar-20 4:22
Calin Negru13-Mar-20 4: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 5:22
mveRichard MacCutchan13-Mar-20 5:22 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru13-Mar-20 8:50
Calin Negru13-Mar-20 8:50 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan13-Mar-20 9:07
mveRichard MacCutchan13-Mar-20 9:07 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru13-Mar-20 22:07
Calin Negru13-Mar-20 22:07 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan14-Mar-20 0:04
mveRichard MacCutchan14-Mar-20 0:04 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru14-Mar-20 4:30
Calin Negru14-Mar-20 4:30 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan14-Mar-20 4:47
mveRichard MacCutchan14-Mar-20 4:47 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru14-Mar-20 8:11
Calin Negru14-Mar-20 8:11 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan14-Mar-20 8:13
mveRichard MacCutchan14-Mar-20 8:13 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru14-Mar-20 9:18
Calin Negru14-Mar-20 9:18 
GeneralRe: c libraries needed to deal with bitmaps Pin
phil.o14-Mar-20 9:37
professionalphil.o14-Mar-20 9:37 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan14-Mar-20 10:27
mveRichard MacCutchan14-Mar-20 10:27 
GeneralRe: c libraries needed to deal with bitmaps Pin
phil.o14-Mar-20 10:34
professionalphil.o14-Mar-20 10:34 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan14-Mar-20 22:58
mveRichard MacCutchan14-Mar-20 22:58 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru12-Mar-20 1:35
Calin Negru12-Mar-20 1:35 
GeneralRe: c libraries needed to deal with bitmaps Pin
Victor Nijegorodov11-Mar-20 23:45
Victor Nijegorodov11-Mar-20 23:45 
GeneralRe: c libraries needed to deal with bitmaps Pin
Calin Negru12-Mar-20 1:43
Calin Negru12-Mar-20 1: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.