I'm trying to implement an image viewer (that has zooming and panning capabilities) where I can place a "dot" or some sort of graphics thing over a specific part of the bitmap.
Of course if the image was only as big as the viewer, this would be easy (just drawing based on the window coordinates).. but since I'm supposed to support zoom and panning, I need information about the bitmap's coordinates in order to have the drawing on the bitmap to stay on the same place (and to know whether to display it or not when panning through a larger version of the image).
Does anyone know of any way to do this, or if there's a class other than CPAlbImageViewerBasic that can achieve this?
In Java, I managed to do this with Layer Managers, since those classes kept track of both the coordinates in the canvas and the coordinates of the window. Does Symbian C++ have something similar?
That's what I was trying to avoid - but it seems like I'll have to implement something like that anyway.
The problem still is, though, that the class doesn't offer an observer method that tells me where the Panning center is - it merely has a SetPanningCenter, but no GetPanningCenter.
The only solution I have thought of so far is to start with the image centered at the dot, and every time the user pans left or right, move the dot the same amount as the pan. This, however, messes up whenever a zoom in or zoom out operation is done *unless* I reset the Panning Center to the dot once again.
One cool thing I found was that CPAlbImageViewerBasic keeps consistent map coordinates throughout scaling - that is, point (x,y) at a certain zoom ratio corresponds to the same point (x,y) at any other zoom ratio. Unfortunately, there seems to be no method to simply draw at that point, since gc's draw method is relative to the window and not the canvas. And there seems to be no easy math way of doing this because I can't find an observer method that tells me where the current window is at in relation to the canvas.