Thread: compiling error
View Single Post
Old Nov 2nd, 2006, 11:48 PM   #44
brad sue
Hobbyist Programmer
 
Join Date: Mar 2006
Posts: 120
Rep Power: 3 brad sue is on a distinguished road
Sorry the problem was as you said that it print a mix of good and garbage values. I just fix it. But the location is not conserved.

what happened is that the function constructs the newpixels not by cutting the row and column that are beyond the new range, but filling out the new pixel with the old values one after the other. That is it reads beyond the range and put those values in the newpixels. Here below is an example

OLD pixels(6x10)

8888999111
8888999111
5555999000
2222222222
2222222222
2222222222

NEW pixels with my function shrink(2)- reduce by 2 (3x5);

88889
99111
88889 WRONG!!

instead of the good format that must be:
88889
88889
55559
I don't know if you see what is happening.I cannot fix it
brad sue is offline   Reply With Quote