Click here to Skip to main content
15,923,120 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: why? Pin
Joan M6-Feb-03 22:03
professionalJoan M6-Feb-03 22:03 
GeneralRe: Debugging functions placed in the header file... Pin
-=jarl=-6-Feb-03 10:13
-=jarl=-6-Feb-03 10:13 
GeneralRe: Debugging functions placed in the header file... Pin
Joan M6-Feb-03 20:16
professionalJoan M6-Feb-03 20:16 
GeneralDoubts printing Pin
doctorpi6-Feb-03 5:18
doctorpi6-Feb-03 5:18 
GeneralRe: Doubts printing Pin
Roger Allen6-Feb-03 5:44
Roger Allen6-Feb-03 5:44 
GeneralSimulating ToolBar Press Pin
Jawache6-Feb-03 4:43
Jawache6-Feb-03 4:43 
GeneralRe: Simulating ToolBar Press Pin
Roger Allen6-Feb-03 5:46
Roger Allen6-Feb-03 5:46 
GeneralRe: Simulating ToolBar Press Pin
Jawache6-Feb-03 5:58
Jawache6-Feb-03 5:58 
Generalprogram too big for mem Pin
stv6-Feb-03 4:29
stv6-Feb-03 4:29 
GeneralRe: program too big for mem Pin
Willem B6-Feb-03 4:33
Willem B6-Feb-03 4:33 
GeneralRe: program too big for mem Pin
AlexO6-Feb-03 4:48
AlexO6-Feb-03 4:48 
GeneralRe: program too big for mem Pin
stv6-Feb-03 17:24
stv6-Feb-03 17:24 
GeneralRe: program too big for mem Pin
Ted Ferenc6-Feb-03 7:46
Ted Ferenc6-Feb-03 7:46 
GeneralEncrypting technique for simple CString Pin
Willem B6-Feb-03 4:29
Willem B6-Feb-03 4:29 
GeneralRe: Encrypting technique for simple CString Pin
Chris Losinger6-Feb-03 5:01
professionalChris Losinger6-Feb-03 5:01 
GeneralRe: Encrypting technique for simple CString Pin
Miguel Ortiz6-Feb-03 8:43
Miguel Ortiz6-Feb-03 8:43 
GeneralCSplitterWnd is evil! Pin
SomeUser6-Feb-03 3:47
SomeUser6-Feb-03 3:47 
GeneralRe: CSplitterWnd is evil! Pin
Zdeslav Vojkovic6-Feb-03 5:54
Zdeslav Vojkovic6-Feb-03 5:54 
GeneralRe: CSplitterWnd is evil! Pin
SomeUser6-Feb-03 7:03
SomeUser6-Feb-03 7:03 
GeneralRegistry Reading with CRegKey Pin
naradaji6-Feb-03 3:42
naradaji6-Feb-03 3:42 
GeneralRe: Registry Reading with CRegKey Pin
naradaji6-Feb-03 4:04
naradaji6-Feb-03 4:04 
Generalcreating a grayscale "rainbow" in code Pin
ns6-Feb-03 3:17
ns6-Feb-03 3:17 
GeneralRe: creating a grayscale "rainbow" in code Pin
David Chamberlain6-Feb-03 10:18
David Chamberlain6-Feb-03 10:18 
I've had to do something similar to this, and it isn't too hard. (I'm recalling from memory here.) You need to look at creating a BITMAPINFO structure, with BITMAPINFOHEADER and color table. These define the dimensions in x and y, and specify your color depth, etc. If you use 8-bit depth and a palette, you can add a color table, which is an array of RGBQuad structures (defining the red, green, and blue components) and then each pixel in the bitmap has the value of the corresponding index into the color table.

If you use more than an 8-bit color depth, then each pixel is not an index to a color table, but the actual RGB triple. Then, allocate enough memory to hold the X-by-Y pixel data for the given color depth. Fill the allocated array with whatever pattern you want (rainbow, stripes, concentric circles, repetitive squares, etc), and you can fwrite the header and the contents of the array to a .bmp file.

It's not too different from creating a DIB in a memory DC. I can probably dig out some code samples if absolutely necessary, but this may be enough to help out (?).

Good luck,
Dave

"You can say that again." -- Dept. of Redundancy Dept.
GeneralRe: creating a grayscale "rainbow" in code Pin
ns7-Feb-03 5:05
ns7-Feb-03 5:05 
GeneralRe: Windows Service and MAPIInitialize() Pin
6-Feb-03 3:08
suss6-Feb-03 3:08 

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.