Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. RGBTRIPLE* array_copy[bi.biWidth];
  2.  
  3. fread(&triple, sizeof(RGBTRIPLE), 1, inptr);
  4.  
  5. int count = 0;
  6. //add pixels for times n amount - WRITE TO ARRAY N TIMES
  7. while (count < n)
  8. {
  9.  
  10. array_copy[k] = &triple;
  11.  
  12. count++;
  13. k++;
  14. }
  15.  
  16.  
  17. //write array copy to outfile twice vertically
  18. for (int p = 0; p < n; p++)
  19. {
  20.  
  21. //write array_copy to outfile
  22. for (int x = 0; x < bi.biWidth; x++)
  23. {
  24.  
  25.  
  26. fwrite(*array_copy, sizeof(RGBTRIPLE), 1, outptr);
  27.  
  28. }
  29.  
  30. //add padding to horizontal row
  31. for (int j = 0; j < outfilepadding; j++)
  32. {
  33. fputc(0x0, outptr);
  34. }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement