Click here to Skip to main content
15,920,688 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem with Dumping Object (new of MFC) and FreeLibrary Pin
Alvaro Mendez4-Dec-02 9:34
Alvaro Mendez4-Dec-02 9:34 
Generaldrag on hDC Pin
Nicolas Siatras4-Dec-02 7:28
Nicolas Siatras4-Dec-02 7:28 
GeneralDrawing on a device independent bitmap Pin
David F Zimny4-Dec-02 6:50
David F Zimny4-Dec-02 6:50 
GeneralRe: Drawing on a device independent bitmap Pin
Christian Graus4-Dec-02 9:55
protectorChristian Graus4-Dec-02 9:55 
GeneralRe: Drawing on a device independent bitmap Pin
Paul M Watt4-Dec-02 14:44
mentorPaul M Watt4-Dec-02 14:44 
GeneralDisplaying Image From Data Array Pin
Rooster764-Dec-02 4:51
Rooster764-Dec-02 4:51 
GeneralRe: Displaying Image From Data Array Pin
Maximilien4-Dec-02 4:54
Maximilien4-Dec-02 4:54 
GeneralRe: Displaying Image From Data Array Pin
Chris Losinger4-Dec-02 4:58
professionalChris Losinger4-Dec-02 4:58 
you first need to convert that image into a DIB. this is Window's native image type.

1. a DIB is vertically flipped (first pixel is bottom-left)
2. all pixel rows in a DIB must be a multiple of four bytes wide. this may mean you have to add padding bytes to the end of the rows
3. a DIB starts with a BITMAPINFOHEADER struct
4. in an 8-bit DIB, the palette (256 entries in this case) immediately follows the header struct
5. the pixel bytes immediately follow the palette

so, to turn that image of yours in to a DIB:

find out how wide the pixel rows will be (accounting for the row padding), multiple that by the height. add 256 * sizeof(RGBQUAD) for the palette and sizeof(BITMAPINFOHEADER) for the header. allocate that much memory. then, fill in the header, copy the palette, copy the pixel rows (accounting for padding! and the vertical flip), and you're done!

Smile | :)

-c



There's one easy way to prove the effectiveness of 'letting the market decide' when it comes to environmental protection. It's spelt 'S-U-V'.
--Holgate, from Plastic

GeneralRe: Displaying Image From Data Array Pin
Roger Allen4-Dec-02 5:05
Roger Allen4-Dec-02 5:05 
GeneralRe: Displaying Image From Data Array Pin
Chris Losinger4-Dec-02 5:07
professionalChris Losinger4-Dec-02 5:07 
QuestionHow to Get the ChildWnd's CWnd* of Static SplitterWnd Pin
zhdleonid4-Dec-02 4:45
zhdleonid4-Dec-02 4:45 
AnswerRe: How to Get the ChildWnd's CWnd* of Static SplitterWnd Pin
valikac4-Dec-02 9:59
valikac4-Dec-02 9:59 
GeneralRe: How to Get the ChildWnd's CWnd* of Static SplitterWnd Pin
zhdleonid4-Dec-02 15:14
zhdleonid4-Dec-02 15:14 
GeneralGetClientRect disparity Pin
RalfPeter4-Dec-02 3:59
RalfPeter4-Dec-02 3:59 
GeneralRe: GetClientRect disparity Pin
Roger Allen4-Dec-02 4:39
Roger Allen4-Dec-02 4:39 
GeneralRe: GetClientRect disparity Pin
RalfPeter4-Dec-02 6:06
RalfPeter4-Dec-02 6:06 
GeneralTaskbar Pin
Victor Boctor4-Dec-02 2:36
Victor Boctor4-Dec-02 2:36 
GeneralRe: Taskbar Pin
Michael P Butler4-Dec-02 3:56
Michael P Butler4-Dec-02 3:56 
GeneralRe: Taskbar Pin
Ravi Bhavnani4-Dec-02 5:03
professionalRavi Bhavnani4-Dec-02 5:03 
GeneralNeed advice for modal window Pin
Johann Gerell4-Dec-02 2:23
Johann Gerell4-Dec-02 2:23 
GeneralRe: Need advice for modal window Pin
Paul M Watt4-Dec-02 4:20
mentorPaul M Watt4-Dec-02 4:20 
GeneralRe: Need advice for modal window Pin
Alvaro Mendez4-Dec-02 5:29
Alvaro Mendez4-Dec-02 5:29 
GeneralInternationalisation Pin
Patje4-Dec-02 2:12
Patje4-Dec-02 2:12 
GeneralRe: Internationalisation Pin
Maximilien4-Dec-02 2:56
Maximilien4-Dec-02 2:56 
GeneralRe: Internationalisation Pin
Patje4-Dec-02 3:21
Patje4-Dec-02 3:21 

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.