0

below is the code for vertical resize

fsetpos(outptr,&position);

        RGBTRIPLE temp[bi2.biWidth+ paddingnew ];

        for(int l=0;l<(bi2.biWidth + paddingnew);l++)
        {
            fread(&temp[l],sizeof(RGBTRIPLE),1,inptr);
            }



      for(int i=0;i<n;i++)

      { 
         for(int j=0;j<(bi2.biWidth + paddingnew );j++)

         {  
           fwrite(&temp[j],sizeof(RGBTRIPLE),1,outptr);

           }


          }        
1

Because you are reading old files using the new padding. And you also read triples, whereas padding is done using bytes.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .