Date: | January 6, 2006 / year-entry #12 |
Tags: | code |
Orig Link: | https://blogs.msdn.microsoft.com/oldnewthing/20060106-35/?p=32743 |
Comments: | 12 |
Summary: | Two people pointed out that the ImageList_Add function and toolbars use horizontal strips even though we learned that vertical strips are much more efficient. While it's true that the images are passed to the ImageList_Add and CreateToolbarEx functions in horizontal strips, the image list and toolbar code copy them to a vertical strip. In other... |
Two people pointed out that the In other words, the horizontal strip is merely an interchange format. Internally, the image list and toolbar use the more efficient vertical arrangement. |
Comments (12)
Comments are closed. |
I never liked pixel 3 much anyway
And 9 days after I decided I didn’t like pixels 1, 7, A or F either.
Which prompts the question: why was it decided to use a horizontal strip in the first place? Logical for toolbars, though they run both ways, but irrelevant for image lists.
Is it continuity – the toolbar arrangement was decided first, so the image list follows – or convention? (I can only remember ever seeing animations done horizontally in sprite sheets, for example, never vertically.)
English language (and many others, like my russian) uses left-to-right order for writing. I think this is only one reason why all elements in GUI are aligned horizontally.
BTW usual cinema film uses vertical frames moving.
Interestingly, CreateToolbarEx has been marked as obsolete in recent versions of the SDK documentation… wonder if there’s any specific reason for that?
@Starfish, re: "I can only remember ever seeing animations done horizontally in sprite sheets, for example, never vertically".
The Internet Explorer "throbber" – the animation up at the top right when a page is loading – is a vertical sequence of frames. See
http://www.virtualplastic.net/html/logo_thr.html#throbber
for details of how to customise it.
@Nick: check the links in the post :)
PatriotB: you’re now supposed to use CreateWindowEx
Dupe. see: http://blogs.msdn.com/oldnewthing/archive/2005/08/05/448073.aspx
I took a look at MFC 2.53, which does toolbars on Win16 where there is no native toolbar control. That seems to store images side-by-side (bartool.cpp lines 208-210) so it may be what the Win32 toolbar is being compatible with.
On the other hand, MFC 2.53 is from April 1995, by which time Chicago betas existed; can someone confirm if CToolBar is the same in earlier MFCs?
PingBack from http://blogs.msdn.com/oldnewthing/archive/2007/01/29/1551916.aspx