-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solution to: Exception 'Out of Memory' while drawing a big image #37
Comments
Good grief - this never crossed my mind. Curiously enough I had a support ticket recently for another user who was having difficulties with the ImageBox and giant images. I'd made a "rainy day note" after that to try and do a demo where multiple separate images are drawn as though they were a single image, similar to how things like online maps work. It just didn't twig that I could have done the same thing as you suggest. Thanks very much for the tip - I will give that a go! |
I write a control derived from ImageBox. I would like to share the code here, and hope it could be useful. And hope the new version could be improved. Thanks! public class PictureBox : ImageBox
|
While load a big image, for example 15000*8000 pixels, DrawImage almost always throw an exception 'Out of Memeory'.
I tested a solution, which works very well. Its key point is to divide image into several small parts and then draw each part one by one.
The code as follow:
The text was updated successfully, but these errors were encountered: