I'm done with resize [more]. And check50 was ok. But when i check my program for not 0.25/0.5 size, but for size 0.2/0.4 the image was fail ./resize .2 large.bmp student.bmp
- .1 - OK .15 - OK
- .2 - err .25 - OK
- .3 - err .35 - err
- .4 - err .45 - err
- .5 - OK .55 - err
- .6 - err .65 - err
- .7 - err .75 - OK
- .8 - err .85 - err
- .9 - err .95 - err
I tried to change (int)(bi.biWidth * f) to (int)round(bi.biWidth * f) and/or (out_bi.biWidth * sizeof(RGBTRIPLE)) to ((int)round(out_bi.biWidth * sizeof(RGBTRIPLE))) but it does not help.
I tried to use ceil floor, but it does not help.
Anyone have idea how to fix it?
my code
EDIT:
int row = 0;
int col = 0;
row += abs(out_bi.biHeight);
while (row > 1)
col += out_bi.biWidth;
while (col > 1)
col-=bi.biWidth;
row-=abs(bi.biHeight);
I tried to change row and col before 'cycle' and change it in 'while' but it does not help. I miss something, but i don't know what.