Canvas, zooming, and coordinates

Hi all,

How would you deal with the problem that arises because coordinates are integer:

Lest say on a canvas you set a point at (5,5)
You magnify to 2x, so the pixel appears now at (10,10)
You add another puxel at (7,9)
How do you save the coordinates? Everything at 2x?

You magnify to 3x
The first pixel is at (15,15)
Where do you draw the secoond pixel?

I guess there is an established way of dealing with the problem, but as I don’t know it I’d appreciate any pointers.

TiA

Markus

As always the answer it “it depends”. Do you do anything when magnifying like a next neighbor or some interpolation? Do you change the magnified picture in any way? Then I’d save the magnified picture. If the larger picture is just the same image as the original one: why bother?

Thanks Beatrix. Well, it seems to me I will need to save the coordinates as double, and in the drawing routine convert to the nearest integer.