While we appreciate comments from our users, please follow our posting guidelines. Have you tried the Cyotek Forums for support from Cyotek and the community?
Styling with Markdown is supported
27 July 2012 Reply
If anyone is seeing this, here are some enhancements:
To correctly transform check background (stop the flickering):
Rectangle fillRect = this.GetImageViewport();
x = (int)(((point.X) - viewport.X)/this.ZoomFactor);
y = (int)(((point.Y) - viewport.Y)/this.ZoomFactor);
Thanks for your comments. In regards to "fixing PointToImage"... I'm not entirely sure what it is you are fixing, unless you mean the fact it returns +1 for the position. This was a deliberate design decision so that hovering over 0,0 doesn't return Point.Empty. So I don't really count that as a bug, although it's probably not suitable for everyone! Saying that, as I wrote this reply I recalled that there used to be a bug in the formula but this was fixed at the start of the year when another user spotted it - that's probably in the recent part 5 source code though, rather than this older version.
I haven't tested your checkbox fix as it doesn't look like it matches my copy (which uses a different way of generating the texture) but I suspect that won't work either as it doesn't account for the controls border's, and I know they are affected by the flicker too. Another user provided me with some code some time ago which used a custom scroll control and a helping of Win32 interop to fix the scroll issue, however I didn't want to complicate these examples with code of this nature. I should probably dig it out and add them to the site for interested parties anyway!
Thanks again for the comment.
Oh sorry i didn't see part 5 :) I'm making an image editor so PointToImage in part 4 was wrong, when i clicked on image it painted slighty off position, just a matter of applying scalefactor to the whole expression. Anyway i'll take a look at part 5. Thanks.