Click here to Skip to main content
15,902,938 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionLooking for API method to find component version ... Pin
Yanshof1-Nov-05 4:00
Yanshof1-Nov-05 4:00 
AnswerRe: Looking for API method to find component version ... Pin
Chris Losinger1-Nov-05 4:44
professionalChris Losinger1-Nov-05 4:44 
Questionif (23 == x) or if (x == 23) Pin
Anorexic Tribble1-Nov-05 2:58
Anorexic Tribble1-Nov-05 2:58 
AnswerRe: if (23 == x) or if (x == 23) Pin
Justin Hallet1-Nov-05 3:11
Justin Hallet1-Nov-05 3:11 
AnswerRe: if (23 == x) or if (x == 23) Pin
grigsoft1-Nov-05 3:16
grigsoft1-Nov-05 3:16 
QuestionHow to convert textfile into variables and arrays? Pin
jedenddhsakjldf1-Nov-05 2:00
jedenddhsakjldf1-Nov-05 2:00 
QuestionRe: How to convert textfile into variables and arrays? Pin
David Crow1-Nov-05 2:25
David Crow1-Nov-05 2:25 
AnswerRe: How to convert textfile into variables and arrays? Pin
kakan1-Nov-05 19:22
professionalkakan1-Nov-05 19:22 
Hello.

See the answer from DavidCrow for the answer to the first of your questions.

For the COLORMAP, I suggest you do like this:

Create an UIntArray, and store the values for every record (i.e. (0*37,70,56)) as a RGB value in the array.
Get the index (0 in the above case) and use it as the index (position) in the array.
Convert the rest of the record (37,70,56) to a single value via the RGB macro. Store the RGB value in the index (gotten above).
Use the SetAt()-member (or better still: SetAtGrow()) of the UIntArray.
(Shortcut: If you can be 100% sure the indexes is in perfect order at all times, and without gaps, then you can use the Add()-member of UIntArray).

When you later want to get a value from the UIntArray, use the GetAt()-member, and retrieve the RGB-value.
That's it, provided you are using MFC. You can use a similar method if you are using STL.

About Stitch, you can use the same metod as above, but you must considder the datatype to use for the array.
If you know for sure that the value never will exceed 255, then you can use unsigned char to store the value in. Then have a look at the ObjArray class. Else, use an UIntArray here too (but a different array than the COLORMAP-array, of course.) But it might be a waste of memory...

Good luck
Kakan







QuestionStuck again... Pin
jedenddhsakjldf7-Nov-05 13:29
jedenddhsakjldf7-Nov-05 13:29 
AnswerRe: Stuck again... Pin
kakan7-Nov-05 21:02
professionalkakan7-Nov-05 21:02 
GeneralRe: Stuck again... Pin
jedenddhsakjldf8-Nov-05 9:21
jedenddhsakjldf8-Nov-05 9:21 
GeneralRe: Stuck again... Pin
kakan8-Nov-05 20:47
professionalkakan8-Nov-05 20:47 
GeneralRe: Stuck again... Pin
kakan8-Nov-05 21:38
professionalkakan8-Nov-05 21:38 
Question[Message Deleted] Pin
BeautyLord31-Oct-05 23:38
BeautyLord31-Oct-05 23:38 
AnswerRe: how about your hands in here? Pin
toxcct1-Nov-05 0:07
toxcct1-Nov-05 0:07 
AnswerRe: how about your hands in here? Pin
#realJSOP1-Nov-05 1:56
professional#realJSOP1-Nov-05 1:56 
QuestionImages from an internet explorer images Pin
ThG6431-Oct-05 23:28
ThG6431-Oct-05 23:28 
AnswerRe: Images from an internet explorer images Pin
Maximilien1-Nov-05 2:23
Maximilien1-Nov-05 2:23 
GeneralRe: Images from an internet explorer images Pin
David Crow1-Nov-05 2:31
David Crow1-Nov-05 2:31 
GeneralRe: Images from an internet explorer images Pin
ThG642-Nov-05 7:58
ThG642-Nov-05 7:58 
Questionhow to get IWebbrowser2 by using HWND? Pin
yj31-Oct-05 22:41
yj31-Oct-05 22:41 
AnswerRe: how to get IWebbrowser2 by using HWND? Pin
yj2-Nov-05 21:38
yj2-Nov-05 21:38 
QuestionBinary files again... Pin
Aqueel31-Oct-05 20:35
Aqueel31-Oct-05 20:35 
AnswerRe: Binary files again... Pin
kakan31-Oct-05 21:22
professionalkakan31-Oct-05 21:22 
AnswerRe: Binary files again... Pin
Aqueel31-Oct-05 23:11
Aqueel31-Oct-05 23: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.