Question GUI Optimization

ALXX9

New member
Joined
Aug 11, 2010
Messages
1
Programming Experience
1-3
Hello everyone,
I'm building a GUI that requires a lot of thumbnails to be show on the screen. As of now I'm using PictureBoxes to draw them on the screen. But considering the worst case, I may need to draw as many as a 1000 of these thumbnails as once. Right now I'm dynamically allocating PictureBoxes as and when they are required. Each PictureBox loads a small PNG image from disc. I need them to move around and animate fluidly. This I am currently doing using timers. I've noticed an occasional lag. Do you think this is an optimum approach? Are there any alternate implementations to this?
 

Jamie Delo

New member
Joined
Aug 10, 2010
Messages
3
Programming Experience
1-3
Pictureboxes aren't probably the best way to go about doing this, as you've found out it can be quite slow at times :)

Look into different types of drawing them to the scene, instead of using a form. GDI+ is notoriously slow when rendering many objects, but is easiest to code. WPF is new, and I don't know much about it, but I've read it's quicker than GDI+, and it quite easy to code. DirectX and DirectDraw are the hardest to code for sure, but are very quick when you get into drawing and animating larger scenes.

Personally I'd go for either WPF or DirectDraw, but it's really up to you. :)
 

Jamie Delo

New member
Joined
Aug 10, 2010
Messages
3
Programming Experience
1-3
If you want to stick with WinForms/GDI+ then you should probably use a single PictureBox and your images onto it directly.

Seconded, it'd save alot of the hassle, and would still allow you to move the .PNG's around. Depends what you're going to use this GUI for I suppose, if it's for a game or a fullscreen application I'd go for either DirectDraw (even though it's deprecated, it's still really easy to use), or DirectX (Spriting in DirectX is suprisingly easy), if it's for a windows form application, go for the above suggestion. :)
 
Top Bottom