Click here to Skip to main content
15,911,848 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: dll creation in win32 * Pin
hrishiS3-Mar-09 23:20
hrishiS3-Mar-09 23:20 
GeneralRe: dll creation in win32 * Pin
Eytukan3-Mar-09 23:25
Eytukan3-Mar-09 23:25 
AnswerRe: dll creation in win32 Pin
Hamid_RT3-Mar-09 19:08
Hamid_RT3-Mar-09 19:08 
QuestionConvert 16bit grayscale bitmap to 8bit grayscale bitmap Pin
Akt_4_U3-Mar-09 18:12
Akt_4_U3-Mar-09 18:12 
QuestionWriting 8-bit grayscale bitmap data Pin
Member 21167363-Mar-09 17:36
Member 21167363-Mar-09 17:36 
AnswerRe: Writing 8-bit grayscale bitmap data Pin
Akt_4_U3-Mar-09 18:08
Akt_4_U3-Mar-09 18:08 
GeneralRe: Writing 8-bit grayscale bitmap data Pin
Member 21167363-Mar-09 21:03
Member 21167363-Mar-09 21:03 
GeneralRe: Writing 8-bit grayscale bitmap data Pin
Akt_4_U3-Mar-09 22:01
Akt_4_U3-Mar-09 22:01 
Hope you have read the ColorMap completely from source bitmap. That is you have to allocate enough memory for reading the complete ColorMap(256 colors) for source image.
The following code will do this.

BYTE* pbyThumbImage // This is your source bitmap buffer.
const ULONG COLORMAP_START_OFFSET = sizeof( BITMAPFILEHEADER ) + sizeof( BITMAPINFOHEADER ); // Color map starts after Bitmap file header and Bitmap info header.
UINT uColorMapSize = 256 * sizeof( RGBQUAD );
pBmpInfoHdr = reinterpret_cast<lpbitmapinfo>( GlobalAllocPtr( GHND, sizeof( BITMAPINFOHEADER ) + uColorMapSize ));
memcpy( pBmpInfoHdr->bmiColors, ( pbyThumbImage + COLORMAP_START_OFFSET ), uColorMapSize ); // Now complete colormap information is within your pBmpInfoHdr->bmiColors.

Now you can write this colormap to destination file using fwrite with input buffer as pBmpInfoHdr->bmiColors and size to be written as uColorMapSize.

akt

GeneralRe: Writing 8-bit grayscale bitmap data Pin
Member 21167364-Mar-09 4:09
Member 21167364-Mar-09 4:09 
GeneralRe: Writing 8-bit grayscale bitmap data Pin
Akt_4_U4-Mar-09 22:19
Akt_4_U4-Mar-09 22:19 
GeneralRe: Writing 8-bit grayscale bitmap data Pin
Member 21167364-Mar-09 22:40
Member 21167364-Mar-09 22:40 
Questionhow to clear editbox with vc2005 Pin
chenfengrugao3-Mar-09 17:12
chenfengrugao3-Mar-09 17:12 
AnswerRe: how to clear editbox with vc2005 Pin
Eytukan3-Mar-09 17:28
Eytukan3-Mar-09 17:28 
GeneralRe: how to clear editbox with vc2005 Pin
chenfengrugao3-Mar-09 17:38
chenfengrugao3-Mar-09 17:38 
AnswerRe: how to clear editbox with vc2005 Pin
David Crow4-Mar-09 3:24
David Crow4-Mar-09 3:24 
QuestionRe: how to clear editbox with vc2005 Pin
Eytukan4-Mar-09 3:27
Eytukan4-Mar-09 3:27 
AnswerRe: how to clear editbox with vc2005 Pin
David Crow4-Mar-09 3:33
David Crow4-Mar-09 3:33 
GeneralRe: how to clear editbox with vc2005 Pin
Eytukan4-Mar-09 6:50
Eytukan4-Mar-09 6:50 
GeneralRe: how to clear editbox with vc2005 Pin
David Crow4-Mar-09 6:53
David Crow4-Mar-09 6:53 
GeneralRe: how to clear editbox with vc2005 Pin
Eytukan4-Mar-09 6:54
Eytukan4-Mar-09 6:54 
Question[MFC] How to draw an eclipse with any color and line width on memory device context ( using bitmap )? Pin
Un Suthee3-Mar-09 14:49
Un Suthee3-Mar-09 14:49 
AnswerRe: [MFC] How to draw an eclipse with any color and line width on memory device context ( using bitmap )? Pin
«_Superman_»3-Mar-09 16:07
professional«_Superman_»3-Mar-09 16:07 
AnswerRe: [MFC] How to draw an eclipse with any color and line width on memory device context ( using bitmap )? Pin
Stuart Dootson3-Mar-09 22:10
professionalStuart Dootson3-Mar-09 22:10 
QuestionRe: [MFC] How to draw an eclipse with any color and line width on memory device context ( using bitmap )? Pin
CPallini3-Mar-09 22:21
mveCPallini3-Mar-09 22:21 
AnswerRe: [MFC] How to draw an eclipse with any color and line width on memory device context ( using bitmap )? Pin
Iain Clarke, Warrior Programmer3-Mar-09 22:36
Iain Clarke, Warrior Programmer3-Mar-09 22:36 

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.