I have a main image into which sequential images are copied for pixel analysis. All that is fine. However, I want to control how the images are StretchDrawn into the main image.
Basically, I need to determine how many times I can increase the image size before it no longer fits into the main image.
I have an integer variable 'zoomlevel', set to 1 to 10. I then multiply the sourceimage.width integer by zoom level. If the result is > than 875 it won't fit, so I know only to zoom by zoomlevel - 1 for that iteration.
Sounds simple - work out zoomlevel for each image in turn. However due to severe brain fade I cannot come up with a simple piece of code to calculate largest zoomlevel that will return an image width nearest but not greater than 875.
Can anyone help. I am sure the solution is simple and obvious but it will not come to me!
Thanks.
Basically, I need to determine how many times I can increase the image size before it no longer fits into the main image.
I have an integer variable 'zoomlevel', set to 1 to 10. I then multiply the sourceimage.width integer by zoom level. If the result is > than 875 it won't fit, so I know only to zoom by zoomlevel - 1 for that iteration.
Sounds simple - work out zoomlevel for each image in turn. However due to severe brain fade I cannot come up with a simple piece of code to calculate largest zoomlevel that will return an image width nearest but not greater than 875.
Can anyone help. I am sure the solution is simple and obvious but it will not come to me!
Thanks.