Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I need to create a filmstrip view using MFC or WIN32 API and C++.

I thought of doing it by using a list view control, disabling the scroll bar and simulating the scroll bar events using buttons (for the filmstrip feel).

I guess it can also be done by just using Picture controls but that would require a lot of re-painting and the approach looks naive.

I'm relatively new to Win32 or MFC programming so please suggest me if there are any better approaches.

Thanks!

[Update]

It looks something like this - http://www.google.co.in/imgres?imgurl=http%3A%2F%2Fwww.techlicious.com%2Fimages%2Fcomputers%2Fwindows-xp-filmstrip-view.jpg&imgrefurl=http%3A%2F%2Fdriverlayer.com%2Fimg%2Ffilmstrip%2520view%2F20%2Fany&h=571&w=798&tbnid=4Bs-Iz9WkURxKM%3A&zoom=1&docid=84zN9PZpVnmfaM&hl=en&ei=7qyiVNfIF8qKuASpnoF4&tbm=isch&ved=0CBsQMygBMAE&iact=rc&uact=3&dur=407&page=1&start=0&ndsp=19[^]

The explorer being replaced with the main dialog :) I will try to find a more convincing image.
Posted
Updated 30-Dec-14 4:44am
v3
Comments
Richard MacCutchan 30-Dec-14 9:56am    
What do you mean by "filmstrip"? Without some more specific detail it is difficult to suggest anything.
enhzflep 30-Dec-14 10:35am    
Further to Richard's question, I also wonder what it would look like, would it have vertical or horizontal orientation, how would a user interact with it an finally, what is it's purpose? Is it a static device or is a control that the user can interact with?

I'd possibly make a new window-class and handle everything myself, from maintaining a list of the images displayed, to appropriate scroll behaviour, to drawing and to image get/set functions, finally to handle user interaction (clicking on an image, or scrolling the strip).

I would write the control in plain c or perhaps c++, implementing the standard model for control/interaction, namely the use of sending messages. At a later stage, I would wrap this window class into a c++ class for ease of use. While the tempting method may be to implement a c++ class to wrap the window class straight off the bat, performing all operations as class member functions, this effectively makes your control useless if you wish to use it from a different language that doesn't understand c++ objects.

The (linux) wine project has a bunch of examples of how to go about implementing a Windows control from scratch. I've got a vague feeling that my current control template is one I made after reviewing the code for button controls, found in as re-implemented by the WINE team when recreating user32.dll

You can find the button.c file here: wine/dlls/user32/button.c
enhzflep 30-Dec-14 12:07pm    
Uh-huh, gotcha. You'd like a control that behaves like the 'Filmstrip View' shown by Explorer of a folder that only contains images, as implemented by Windows XP.

Hmmmm, hmm, hmmmmm. Except for the fact that a list-view doesn't appear to be able to scroll horizontally, it would be perfect for the job. Seems like a rather large control to roll-your-own. I'd probably look for a listView control alternative that allows for horizontal scrolling when using the LVS_ICON style.

In the event that you don't find one, I'd consider viewing the listview.c file in the Wine source-code and altering the implementation for the LVS_ICON style.
wine/dlls/comctl32/listview.c (beware - it's 11,864 lines of code. The ListView control is rather complicated)

A pre-existing library would be preferable and the quickest. A modification of the Wine code would be the next best thing. Finally, from-scratch implementation yourself is the remaining option.

I wouldn't use picture-controls myself if I were hand-rolling it. I'd do all the drawing myself, allowing for fairly easy horizontal centering of the text for each item.

Here's another one of the reasons why I'd steer well clear of picture controls.
When will the static control automatically delete the image loaded into it, and when is it the responsibility of the application?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900