Thursday 12 September 2013

How to adjust all the Points in the screen using CImg

How to adjust all the Points in the screen using CImg

I have to draw Lines which has bigger double values like (3000.00,4500.45).
CImg<unsigned char> img(800,800,1,3,20);
img.draw_line( 3000.00, 4500.45, 3478.567, 4500.45, RED);
But i want to keep my screen size limited to 800x800
I thought to take Modulus of the Point's coordinates within 800 Like
3000.00%800=600
I can fit 600 in my Screen . But the problem is , CPP does not support
modulus of double value .
double a = 3000.00;
printf("%lf",a%800.0); //Expected 600 but exception
**Invalid operand of type double,double to binary operator%**
How can I fit these large points in my screen using CImg ?

No comments:

Post a Comment