Click here to Skip to main content
15,899,474 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to calculate all columns amount? [modified] Pin
gentleguy25-Jun-08 23:08
gentleguy25-Jun-08 23:08 
QuestionRe: how to calculate all columns amount? Pin
Rajesh R Subramanian25-Jun-08 23:11
professionalRajesh R Subramanian25-Jun-08 23:11 
AnswerRe: how to calculate all columns amount? Pin
gentleguy25-Jun-08 23:36
gentleguy25-Jun-08 23:36 
AnswerRe: how to calculate all columns amount? Pin
Saurabh.Garg25-Jun-08 23:35
Saurabh.Garg25-Jun-08 23:35 
GeneralRe: how to calculate all columns amount? Pin
gentleguy25-Jun-08 23:46
gentleguy25-Jun-08 23:46 
GeneralRe: how to calculate all columns amount? Pin
gentleguy25-Jun-08 23:55
gentleguy25-Jun-08 23:55 
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 
thanks for your help, my data is from binary image, different binary image has different dimension, when i load one 2-D binary image, depend on image size, but i can obtain width and height of image via access image definition. do you understand me? i can declare a 2-D dinamic array.thanks

unsigned char *ucImgdata1 =m_vicImg.ibuff;
 int iWidth1 = m_vicImg.endx-m_vicImg.stx+1;
 int iHeight1 = m_vicImg.endy-m_vicImg.sty+1;
 int iWidthbyte1=m_vicImg.buffwidth;
 int *nColumnCounts=new int[iWidth1];


 for (int i=0;i<iwidth1;iwidth1;i++)
 {
     nColumnCounts[i]=0;
 }
 for(int iY=0;iY<iheight;iheight1;iy++)
 {
     for(int iX=0;iX<iwidth1;iwidth1;ix++)
     {

         if (imgArray [iX+iY*iwidth1] == 255)
         {

             nColumnCounts[iX]++;

             FILE* stream;
             stream=fopen("C:\\TestArray.txt","w");
             fprintf(stream," Array=%d\n",nColumnCounts[iX]);
             fclose(stream);
         }
     }


but i couldn't get the correct result. i would like to get one array including how many amount of 255 for each column.help me,thanks.

gentleguy




modified on Sunday, June 29, 2008 4:53 AM

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 
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 

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.