Click here to Skip to main content
15,903,388 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Googolplex Program Pin
ericelysia1-Nov-05 6:39
ericelysia1-Nov-05 6:39 
Questionget bit rate supported by a portable device Pin
decang1-Nov-05 5:00
decang1-Nov-05 5:00 
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 
I need to import php-generated image data into a c++/mfc program as a variables and arrays. Here is the example of the file:
<br />
9<br />
11<br />
10<br />
COLORMAPSTART<br />
(0*37,70,56)(1*151,63,74)(2*66,100,81)****Snip****(8*114,45,72)(9*211,163,38)<br />
COLORMAPEND<br />
STITCHSTART<br />
(0,0)(1,0)(2,0)(3,0)(4,2)(5,2)(6,0)(7,0)****Snip****(96,4)(97,2)(98,2)<br />
STITCHEND<br />


In the first line (9) we have a total number of colours in the palette. Second line holds image width and the height is on the third line.
Between COLORMAPSTART and -END colors are indexed as follows (COLORINDEX*RED,GREEN,BLUE)
Between StitchSTART and -END we have the rest of the image (CURRENTPIXEL,COLORINDEX)

And this data should be read into variables and arrays...
So far I have read the data and hold it in CString ImportData but what now?

Here is some what I think what I should do:
<br />
int NumberColors=readthefirstline;<br />
int Width=ReadSecondline;<br />
int Height=readthirdline;<br />
Go to the end of "COLORMAPSTART"<br />
Do While(I am in the beginning of COLORMAPEND)<br />
{<br />
Get the text between "(" and ")"<br />
ArrayPaletteadd[ConverttoINT(What is left of "*"),CONVERTTORGB(What is right of "*")]<br />
GototheNext "()"<br />
}<br />

I have no idea how to achieve thisFrown | :(
"layout" of the textfile can be changed if it is easier that way...

Thanks,
Janne (sorry about that username i got frustrated when after few tries)
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 
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 

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.