views:

37

answers:

1

Hi All

I was just wondering, is there any benefit in me drawing my own buttons (just rectangles) over loading 80 of them from resources?

Thanks

+1  A: 

It depends on the complexity of the drawn buttons..

"More complex drawings = more processing time .."

But images somehow have constant time loading

"Whatever the image looks like = nearly same processing time.."

Conculsion:

I will prefer drawing buttons if few simple operations are in
But in more complex cases (like color gradient or something) , I prefer stored images..

Also note that some UI must be done in gdi+ and can not be done otherwise.. for example circular buttons or animations..
Stored images don't have full flexibility of GDI+

Betamoo
There is a little error in your second statement. By an image the processing time scales with the size of the image. So if you have a huge button it makes maybe sense not put it into a resource and instead paint it directly (e.g. a gradient picture over 1600x1200 is much more to load than in 30x30)
Oliver
I took it to mean that given any object to be drawn, of a specific size, the time to manually render the object will increase as complexity increases, but for the same size object, loading an image of that object will be nearly constant. Are you saying that is would be faster to render pictures manually?
Greg McGuffey