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

Flowdocument's image memory usage exception #9164

Open
tingjiangcao opened this issue May 28, 2024 · 1 comment
Open

Flowdocument's image memory usage exception #9164

tingjiangcao opened this issue May 28, 2024 · 1 comment
Labels
Needs minimal repro project needs more information Not enough information has been provided. Please share more detail as requested

Comments

@tingjiangcao
Copy link

tingjiangcao commented May 28, 2024

Description

In richtextbox, pasting a lot of images, or embedding custom controls can cause memory spikes. This can be solved if you set the cache mode for images to none. But you can't set it for pasted-in images.

BitmapImage img = new BitmapImage(new Uri());
img.CacheOption = BitmapCacheOption.None;

Reproduction Steps

.

Expected behavior

.

Actual behavior

.

Regression?

No response

Known Workarounds

No response

Impact

No response

Configuration

No response

Other information

No response

@miloush
Copy link
Contributor

miloush commented May 28, 2024

Please include a repro project. What exception are you getting?

Either the clipboard contains a file reference, in which case you can create non-caching BitmapImage yourself, or it s a bitmap, in which case it is already in memory, so BitmapCacheOption.None does not make sense.

@singhashish-wpf singhashish-wpf added needs more information Not enough information has been provided. Please share more detail as requested Needs minimal repro project labels May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs minimal repro project needs more information Not enough information has been provided. Please share more detail as requested
Projects
None yet
Development

No branches or pull requests

3 participants