Click here to Skip to main content
15,905,967 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRecurrence detection Pin
RChin6-Feb-03 2:09
RChin6-Feb-03 2:09 
Generalwhat is the question? Pin
6-Feb-03 2:34
suss6-Feb-03 2:34 
GeneralRe: what is the question? Pin
RChin6-Feb-03 3:43
RChin6-Feb-03 3:43 
GeneralRe: what is the question? Pin
AlexO6-Feb-03 4:08
AlexO6-Feb-03 4:08 
GeneralPrgramatic Control of Toolbar Pin
Jawache6-Feb-03 1:51
Jawache6-Feb-03 1:51 
GeneralRe: Prgramatic Control of Toolbar Pin
KarstenK6-Feb-03 2:23
mveKarstenK6-Feb-03 2:23 
GeneralRe: Prgramatic Control of Toolbar Pin
Jawache6-Feb-03 3:48
Jawache6-Feb-03 3:48 
GeneralGradient Progress Bar Pin
Ambit6-Feb-03 1:50
Ambit6-Feb-03 1:50 
GeneralRe: Gradient Progress Bar Pin
Kayembi6-Feb-03 9:04
Kayembi6-Feb-03 9:04 
GeneralRe: Gradient Progress Bar Pin
Chris Richardson6-Feb-03 18:52
Chris Richardson6-Feb-03 18:52 
GeneralRe: Gradient Progress Bar Pin
Ambit7-Feb-03 5:06
Ambit7-Feb-03 5:06 
General#define Pin
Rage6-Feb-03 1:30
professionalRage6-Feb-03 1:30 
GeneralRe: #define Pin
Christian Graus6-Feb-03 1:59
protectorChristian Graus6-Feb-03 1:59 
GeneralRe: #define Pin
Anders Molin6-Feb-03 8:33
professionalAnders Molin6-Feb-03 8:33 
GeneralRe: #define Pin
Christian Graus6-Feb-03 9:38
protectorChristian Graus6-Feb-03 9:38 

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.