Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int i = 0, biHeight = abs(biOld.biHeight); i < biHeight; i++)
- {
- //Vertical resizing
- RGBTRIPLE line[biNew.biWidth];
- int b = 0;
- // iterate over pixels in scanline
- for (int j = 0; j < biOld.biWidth; j++)
- {
- // temporary storage
- RGBTRIPLE triple;
- // read RGB triple from infile
- fread(&triple, sizeof(RGBTRIPLE), 1, inptr);
- // write RGB triple to outfile, Horizontal Resizing
- for(int k = 0; k < factor; k++)
- {
- line[b] = triple;
- b++;
- }
- }
- for(int c = 0; c < factor ; c++)
- {
- fwrite(&line, sizeof(RGBTRIPLE), biNew.biWidth, outptr);
- for (int k = 0; k < newpadding; k++)
- {
- fputc(0x00, outptr);
- }
- }
- // skip over padding, if any
- fseek(inptr, oldpadding, SEEK_CUR);
- // then add it back (to demonstrate how)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement