I have a case where I deal with fixed sized images but show these images with a sizeable form via a Tpanel in the OnPaint event.
All of this works fine and I also use HALF_TONE settings to get smooth glossy looking images when enlarge above their original size.
But this is the point, I also have an optional grabber/Rubber band, what ever you want to call it to block mark a section on the form which also represents the image it's displaying but at different sizes most of the time, mainly smaller in my case.
when ever I need to use this block reference which translate to a TRECT, I need to calculate the real reduced size and the offset so that I can get a correct TRECT value that matches the image location it is displaying..
To do this, you need to calculate first the ratio of reduction then you need to call a OffsetRect and then a inflateRect with slightly split values.
If such a function as I posted does not exist in the LCL libs, because $MS does not have it either, I purpose maybe one should be created and also added to the Trect helper ..
This would be a great benefit of plotting Rects on the display surface and then translate that TRECT to the real image that its showing with little work. Because I do this a lot in code. Currently I write a function but it would be nice to have a Function like this to help out the more serious graphic coders.
Any comments ?