Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have developed an MFC MDI application for image viewing with one view and document class.
I need to display upto four image files in the same application window. Also the user can have provision to dynamically select number of images files displaying( ie sometimes user will need to display; only one image file in full application window area other time may need to simultaneously display four image files in four quadrants of the screen) and dynamically change position of images files displaying(for example sometimes the user have to interchange image files displayed in right-bottom quadrant and top-left quadrant of application window etc).

Is splitter window technique is the best way to split the application window?
How can I dynamically (on running of application)control image files displaying in different split panes?
How can I assign an image file to a specific pane of the split window while opening an image file?
Posted

1 solution

It actually doesn't matter how you do the physicals on screen to do it you have to have the data stored and accessed by a Handle of some form.

The handle could be a file handle (temp files), a global memory handle (all the data in memory) or a pointer to storage class object like a stream or database (all the data in the stream/database)

Then each view must display, draw and edit only using the handle.

To pass an image you simply pass the handle and issue a redraw command.

If you look at Visual Studio itself it does exactly that when you open a file it reads the file into a memory handle. You are then free to edit or do whatever you want with the text on screen and it does nothing to the file unless you choose to save it when it will write the memory data back down to the physical file.
 
Share this answer
 
v2
Comments
the vacuum 7-May-14 5:44am    
Thanks for your reply?, Sorry, I'm new in MFC, I couldn't get what you explained?
Did you mean to use splitter window?
If so.. for example I have splitted the window to two part with two columns and one row ie Pan(0, 0) & Pan(0, 1).
Then if I need to display first opening image file(using CDocument::OnOpenDocument) in Splitter Pan(0, 1), how can I do this? where I specify to display it in second splitter pan(0,1)?
I'm using CView::OnDraw to display the image. The image have been copy to a memory dc before writing to the window. Can I use this handle to do..?
What I understanding that each splitter pan in splitter window has a handle & I can map the image file or memory dc to that handle. Is it right? If so how can I get the handle of a particular splitter pan?
Also, I have implemented facility for zooming and panning image. For its calculations I'm using size of frame that displaying particular image file. So I have to get size of the window(splitter) pan where a particular image is displayed for zooming and panning it individually?

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