1) how do you transpose scaled coordinates to the coordinates of original image?Originally Posted by SkripT
2) actually what kind of errors you mean?
1) how do you transpose scaled coordinates to the coordinates of original image?Originally Posted by SkripT
2) actually what kind of errors you mean?
Well I have a variable "double scaleFactor" with the result of: size of the scaled image / size of the original image. When I have the coordinates of the scaled images, I calcule the coordinates at the original image with: (x, y) = (x' / scaleFactor, y' / scaleFactor) where x' and y' are the coordinates in the scaled image.1) how do you transpose scaled coordinates to the coordinates of original image?
Errors of precition with the operation above.2) actually what kind of errors you mean?
there is no way to avoid information loss when scaling down.
It would be better if you use the QImage scaling and not do it your self.
When you zoom in an image, and edit, dont edit the original, but the zoomed image, and then scale it down to original when saving, this way QImage will do the work for you.
Sorry I don't understand what you want to say. When the user zooms an image this don't means change the size of the original image, only of the image that I show on the screen. But if the user modifies this zoomed image, this operation has to be done under the original image and not on the scaled image. As I think
Exactly.When the user zooms an image this don't means change the size of the original image
Thats why:
In simple words: alwas edit what you see.dont edit the original, but the zoomed image, and then scale it down to original when saving
So in your opinion, in case that the user selects a rectangular part of the image, once some zoom is aplied, to be painted of another color, this painting has to be done from the image scaled or from the original image?
yes,on the zoomed image.
If you are implementing it so, that the user only sees the zoomed area and not a zoom image in a scrolled area, then you will have to remeber the zoomed rectangle coordinates on the original image, so that you "paste" there the edited zoomed area when the user returns to the original image view.
If on the other side you let the image be zoomed and apply scroll bars, then you dont need to remember any thing, just scale the zommed (edited) image back.
Sorry but in the case of the scroll bars, the changes on the edited image in which moment are "updated" at the original image?
Last edited by SkripT; 20th January 2006 at 18:07.
if you use the scroll bar option you dont need two images, only one, the one that you see, in the size it is at the moment, so when you edit it you are editing the image it self, no need to remember anything aside the original size.
Well so here's the question that i make at the beginning of the thread: if you work only with the edited image and you apply recursive zooming to the image, it will lose quality, won't it?
yes it will as I said, you can't put the same amount of information in less "space".
When you scale down you loos information.
I thought your question was about the error you get from calculating your self the scaling, and my point was that you dont need to do it your self, but can let Qt do it for you.
Hi, finally I have solved the problem. It's a little complicated to explain; in a little words the problem was that I was scaling at any "ratio" while all the other editors scale in order of 1/2, 1/3, 1/4, 1/5, .. Doing it in this way solves the problem of loss of precition. Thanks high_flyer
Bookmarks