Click here to Skip to main content
15,793,605 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
This is a bitwise left-shift operation which is equivalent to
C++
m_nPaletteEntries = pow(2, m_pBIH->biBitCount); // 2 to the power of bpp
What are shift operators in C++?[^]
This trick is used quite often, since a bitwise shift operation is way quicker than the pow() method, which is rather intense on processing time.

Edit: here's an interesting list of useful bitwise tricks:
Bit Twiddling Hacks[^]
"Five fruits and vegetables a day? What a joke!
Personally, after the third watermelon, I'm full."

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 
AnswerRe: c libraries needed to deal with bitmaps Pin
leon de boer12-Mar-20 6:31
leon de boer12-Mar-20 6:31 
GeneralRe: c libraries needed to deal with bitmaps Pin
Victor Nijegorodov12-Mar-20 9:39
Victor Nijegorodov12-Mar-20 9:39 
GeneralRe: c libraries needed to deal with bitmaps Pin
leon de boer12-Mar-20 14:19
leon de boer12-Mar-20 14:19 
QuestionWhat`s a palette in the parsing a bitmap context Pin
Calin Negru10-Mar-20 6:00
Calin Negru10-Mar-20 6:00 
AnswerRe: What`s a palette in the parsing a bitmap context Pin
phil.o10-Mar-20 6:16
professionalphil.o10-Mar-20 6:16 
GeneralRe: What`s a palette in the parsing a bitmap context Pin
Calin Negru10-Mar-20 7:34
Calin Negru10-Mar-20 7:34 
GeneralRe: What`s a palette in the parsing a bitmap context Pin
phil.o10-Mar-20 8:05
professionalphil.o10-Mar-20 8:05 
GeneralRe: What`s a palette in the parsing a bitmap context Pin
harold aptroot10-Mar-20 17:31
harold aptroot10-Mar-20 17:31 
GeneralRe: What`s a palette in the parsing a bitmap context Pin
phil.o10-Mar-20 20:27
professionalphil.o10-Mar-20 20:27 
GeneralRe: What`s a palette in the parsing a bitmap context Pin
Calin Negru10-Mar-20 22:06
Calin Negru10-Mar-20 22:06 
GeneralRe: What`s a palette in the parsing a bitmap context Pin
phil.o10-Mar-20 22:11
professionalphil.o10-Mar-20 22:11 

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.