المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Image corruption in picturebox



C# Programming
09-07-2010, 02:13 PM
In my application I have a picturebox control which displays a bitmap I have created from a byte array. This works quite well most of the time, however if I resize the form the image will sometimes get corrupt. Sometimes it even draws other bitmaps that are being used by completely different forms.

This (http://img230.imageshack.us/img230/4690/f32j.jpg)[^ (http://img230.imageshack.us/img230/4690/f32j.jpg)] is what the picturebox looks like when it's doing what it's supposed to.

Random corruption (http://img815.imageshack.us/img815/6181/wtffo.png)[^ (http://img815.imageshack.us/img815/6181/wtffo.png)] Note that this isn't actually random at all. Whenever I get a pattern similar to this, it's the exact same pattern.

More corruption (http://img832.imageshack.us/img832/1967/wtf2e.jpg)[^ (http://img832.imageshack.us/img832/1967/wtf2e.jpg)]

I haven't overridden the paint event for the picturebox or anything fancy like that. The only owner-drawn control in the form is the rainbow colour bar you can see on the right.

I've googled this to death and haven't been able to come up with anything, I'm really lost here. Help is well-appreciated.