In resize problem, we have to update the headers of image.
Which attributes should be updated and how do i update bfSize
attribute?
1 Answer
You have to update all the attributes that have to change after a resize: bi.biWidth
, bi.biHeight
, padding
, bi.biSizeImage
& bf.bfSize
.
bf.bfSize = (updated bi.biSizeImage) + 54
-
-
updated bi.biSizeImage = ((updated bi.biWidth) * sizeof(RGBTRIPLE) + (updated padding)) * absolute value of (updated bi.biHeight); Commented Jun 29, 2014 at 15:57
-
-
-
1for updating bi.biSizeImage, why do we need to time size of RGBTRIPLE? Commented Feb 25, 2015 at 6:44
bf.bfSize = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + bi_new.biSize;