Skip to content
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

Cache visible image portion for painting #27

Open
cyotek opened this issue Oct 8, 2017 · 0 comments
Open

Cache visible image portion for painting #27

cyotek opened this issue Oct 8, 2017 · 0 comments
Labels

Comments

@cyotek
Copy link
Owner

cyotek commented Oct 8, 2017

Each time an ImageBox control paints itself, it goes through the job of picking part of the image, scaling it, and then painting it.

While this is normally fine, if you manually invalidate an image box repeatedly (for example when drawing custom adornments in reaction to user input), this can affect the responsiveness of the application.

It would probably be a better idea of the ImageBox control created a cached bitmap of the part of the image currently displayed and then used that for painting, and only invalidated this when the layout is impacted, e.g. scrolled, zoomed etc.

See this thread for a sample project I created which identified the issue.

@cyotek cyotek added the bug label Oct 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant