Click here to Skip to main content
15,913,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to calculate all columns amount? Pin
Saurabh.Garg26-Jun-08 0:05
Saurabh.Garg26-Jun-08 0:05 
GeneralRe: how to calculate all columns amount? [modified] Pin
gentleguy28-Jun-08 1:06
gentleguy28-Jun-08 1:06 
GeneralRe: how to calculate all columns amount? Pin
gentleguy28-Jun-08 23:02
gentleguy28-Jun-08 23:02 
AnswerRe: how to calculate all columns amount? Pin
Iain Clarke, Warrior Programmer25-Jun-08 23:44
Iain Clarke, Warrior Programmer25-Jun-08 23:44 
GeneralRe: how to calculate all columns amount? Pin
gentleguy25-Jun-08 23:51
gentleguy25-Jun-08 23:51 
GeneralRe: how to calculate all columns amount? Pin
Iain Clarke, Warrior Programmer26-Jun-08 0:17
Iain Clarke, Warrior Programmer26-Jun-08 0:17 
GeneralRe: how to calculate all columns amount? [modified] Pin
gentleguy26-Jun-08 1:28
gentleguy26-Jun-08 1:28 
GeneralRe: how to calculate all columns amount? Pin
Iain Clarke, Warrior Programmer26-Jun-08 2:23
Iain Clarke, Warrior Programmer26-Jun-08 2:23 
1st for loop is to zero out all the counts. I put the action bit on the same line as the loops, which might have been a bad idea...

2nd and 3rd loops are going through the x,y coords of your data. If you were just looking for the grand total of 255s, you could have done it in one. But as you need to keep track of which column you're on, you need a 2D loop pair.

As for saving the column amount - however you like. If you just take my code and use it, you're in trouble. It's there to help you write your own. The answer to your question depends on your application, and how you put data into your histogram.

You could create a CArray, and pass a pointer or reference to it to the count function, then the results would be available outside the function.

Or you could have a CHistogram::InitialiseFromBitmapData function, and keep the results internally.

Or... lots more choices.

Iain.

Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.

GeneralRe: how to calculate all columns amount? Pin
gentleguy26-Jun-08 15:23
gentleguy26-Jun-08 15:23 
GeneralRe: how to calculate all columns amount? Pin
Iain Clarke, Warrior Programmer26-Jun-08 21:46
Iain Clarke, Warrior Programmer26-Jun-08 21:46 
AnswerRe: how to calculate all columns amount? Pin
Hamid_RT27-Jun-08 8:13
Hamid_RT27-Jun-08 8:13 
GeneralRe: how to calculate all columns amount? Pin
gentleguy28-Jun-08 1:07
gentleguy28-Jun-08 1:07 
QuestionSort by Date Pin
manju#12325-Jun-08 23:05
manju#12325-Jun-08 23:05 
AnswerRe: Sort by Date Pin
Rajesh R Subramanian25-Jun-08 23:09
professionalRajesh R Subramanian25-Jun-08 23:09 
GeneralRe: Sort by Date Pin
manju#12325-Jun-08 23:24
manju#12325-Jun-08 23:24 
GeneralRe: Sort by Date Pin
Rajesh R Subramanian25-Jun-08 23:40
professionalRajesh R Subramanian25-Jun-08 23:40 
GeneralRe: Sort by Date Pin
manju#12325-Jun-08 23:44
manju#12325-Jun-08 23:44 
GeneralRe: Sort by Date Pin
manju#12325-Jun-08 23:45
manju#12325-Jun-08 23:45 
GeneralRe: Sort by Date Pin
manju#12325-Jun-08 23:47
manju#12325-Jun-08 23:47 
GeneralRe: Sort by Date Pin
Rajesh R Subramanian25-Jun-08 23:58
professionalRajesh R Subramanian25-Jun-08 23:58 
GeneralRe: Sort by Date Pin
manju#12326-Jun-08 0:09
manju#12326-Jun-08 0:09 
Questiondisplaying the integers in multiple lines in an edit box? Pin
MahaKh25-Jun-08 21:44
MahaKh25-Jun-08 21:44 
AnswerRe: displaying the integers in multiple lines in an edit box? Pin
Iain Clarke, Warrior Programmer25-Jun-08 21:56
Iain Clarke, Warrior Programmer25-Jun-08 21:56 
Questiondisplaing the integers in multiple lines in an edit box? Pin
MahaKh25-Jun-08 21:43
MahaKh25-Jun-08 21:43 
AnswerRe: displaing the integers in multiple lines in an edit box? Pin
_AnsHUMAN_ 25-Jun-08 21:50
_AnsHUMAN_ 25-Jun-08 21:50 

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.