Click here to Skip to main content
14,548,943 members

C / C++ / MFC

 
GeneralRe: c libraries needed to deal with bitmaps Pin
fearless_13-Mar-20 21:07
Memberfearless_13-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
fearless_14-Mar-20 3:30
Memberfearless_14-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
fearless_14-Mar-20 7:11
Memberfearless_14-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
fearless_14-Mar-20 8:18
Memberfearless_14-Mar-20 8:18 
GeneralRe: c libraries needed to deal with bitmaps Pin
phil.o14-Mar-20 8:37
mvephil.o14-Mar-20 8:37 
This is a bitwise left-shift operation which is equivalent to
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 9:27
mveRichard MacCutchan14-Mar-20 9:27 
GeneralRe: c libraries needed to deal with bitmaps Pin
phil.o14-Mar-20 9:34
mvephil.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
fearless_12-Mar-20 0:35
Memberfearless_12-Mar-20 0:35 
GeneralRe: c libraries needed to deal with bitmaps Pin
Victor Nijegorodov11-Mar-20 22:45
MemberVictor Nijegorodov11-Mar-20 22:45 
GeneralRe: c libraries needed to deal with bitmaps Pin
fearless_12-Mar-20 0:43
Memberfearless_12-Mar-20 0:43 
AnswerRe: c libraries needed to deal with bitmaps Pin
leon de boer12-Mar-20 5:31
Memberleon de boer12-Mar-20 5:31 
GeneralRe: c libraries needed to deal with bitmaps Pin
Victor Nijegorodov12-Mar-20 8:39
MemberVictor Nijegorodov12-Mar-20 8:39 
GeneralRe: c libraries needed to deal with bitmaps Pin
leon de boer12-Mar-20 13:19
Memberleon de boer12-Mar-20 13:19 
QuestionWhat`s a palette in the parsing a bitmap context Pin
fearless_10-Mar-20 5:00
Memberfearless_10-Mar-20 5:00 
AnswerRe: What`s a palette in the parsing a bitmap context Pin
phil.o10-Mar-20 5:16
mvephil.o10-Mar-20 5:16 
GeneralRe: What`s a palette in the parsing a bitmap context Pin
fearless_10-Mar-20 6:34
Memberfearless_10-Mar-20 6:34 
GeneralRe: What`s a palette in the parsing a bitmap context Pin
phil.o10-Mar-20 7:05
mvephil.o10-Mar-20 7:05 
GeneralRe: What`s a palette in the parsing a bitmap context Pin
harold aptroot10-Mar-20 16:31
Memberharold aptroot10-Mar-20 16:31 
GeneralRe: What`s a palette in the parsing a bitmap context Pin
phil.o10-Mar-20 19:27
mvephil.o10-Mar-20 19:27 
GeneralRe: What`s a palette in the parsing a bitmap context Pin
fearless_10-Mar-20 21:06
Memberfearless_10-Mar-20 21:06 
GeneralRe: What`s a palette in the parsing a bitmap context Pin
phil.o10-Mar-20 21:11
mvephil.o10-Mar-20 21: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.