Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
419 views
in Technique[技术] by (71.8m points)

performance - Efficient ways to manage GC Pressure while rendering images

I'm currently working on a project where I need to render images to the screen. I have a networking class that exposes an Observable that delivers the images in a Jpeg format byte[].

The way I'm currently doing it is converting the byte[] into a Bitmap and calling Invalidate() on the form. The image is then painted using e.Graphics.DrawImageUnscaled function.

The problem is it may get called anywhere from 20 to 100 times per second and creating a new Bitmap/MemoryStream and disposing them is ridiculous GC pressure that I'd like to avoid if possible.

What would be some possible solutions to minimize this pressure?

Also, I'm not currently loving GDI and so would like to hear some other options that might increase performance.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...