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

Refreshing pictures causes high CPU usage. #4510

Closed
ChengYen-Tang opened this issue May 12, 2021 · 6 comments
Closed

Refreshing pictures causes high CPU usage. #4510

ChengYen-Tang opened this issue May 12, 2021 · 6 comments
Labels
Performance Performance related issue

Comments

@ChengYen-Tang
Copy link

Because I need to draw the bounding box in the video, I take out each frame of the video to draw the bounding box, and then refresh the Image component. But this is causing high CPU usage. Is there any suggestion to solve the high CPU usage caused by high frequency refresh of the form?

Thank you.

@miloush
Copy link
Contributor

miloush commented May 24, 2021

Can you elaborate on how you refresh the Image component? Are you using the WriteableBitmap?

@ChengYen-Tang
Copy link
Author

ChengYen-Tang commented May 25, 2021

Sorry, I deleted the test project a few weeks ago.
Yes, I use WriteableBitmap, and I will start the official project soon.
But I have another question. If there are N Image component on a Page, and each component updates the content asynchronously, will the refresh rate of the Page become N times?

Thank you.

@lindexi
Copy link
Contributor

lindexi commented May 27, 2021

@ChengYen-Tang It will refresh one time when some picture updates in a dispatcher time.

@ChengYen-Tang
Copy link
Author

If my source is a jpeg byte array, is there any better way besides using BitmapFrame.Create?
Thank you.

@ChengYen-Tang
Copy link
Author

@ChengYen-Tang It will refresh one time when some picture updates in a dispatcher time.

Hi @lindexi,
So, if I use timmer to call Dispatcher.Invoke at a frequency of 30HZ, then Invoke includes the action of updating 4 pictures. In this way, the 4 Image components on my page will be updated at a frequency of 30HZ at the same time. right?

@lindexi
Copy link
Contributor

lindexi commented Jun 24, 2021

@ChengYen-Tang Try and test. I do not know

@ryalanms ryalanms added this to the Future milestone Sep 2, 2021
@ryalanms ryalanms added the Performance Performance related issue label Sep 2, 2021
@ghost ghost removed this from the Future milestone Dec 7, 2022
@dotnet dotnet locked as resolved and limited conversation to collaborators Jan 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Performance Performance related issue
Projects
None yet
Development

No branches or pull requests

4 participants