WinForms performance mystery: derived PictureBox control slower than the original?

Getting an image resized by PB to fit the control is very expensive. GDI+ has a very good filter but it doesn't come for free. Resize the image yourself before you assign it to the Image property so the PB doesn't have to resize it.

Getting an image resized by PB to fit the control is very expensive. GDI+ has a very good filter but it doesn't come for free. Resize the image yourself before you assign it to the Image property so the PB doesn't have to resize it.

Using a bitmap created with Format32bppPArgb can make a big difference too, it is 10 times faster than any other format.

Either way, I can't figure out why an empty derived class can cause such different behaviors. Thanks for the tips though, I will definitely give them a try. – Dan7 Jan 28 '10 at 2:57 No, resize it, the same way PB does.

This problem is definitely not caused by the derived class, that's just not the way WF works. – Hans Passant Jan 28 '10 at 4:14 In my example I set SizeMode to Normal so only the upper-left corner of the picture is shown. But I followed your advice and set Image property to a pre-clipped bitmap and it did improve!

Still why is the difference between the base control and the does-nothing-new derived control in the first place? – Dan7 Jan 28 '10 at 16:19.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions