Solved

Sizing a child/view...

Posted on 1997-05-01
7
212 Views
Last Modified: 2013-11-20
I have an application, where the view contains visual representations of amplitudes of samples.  When I cut and paste varying numbers of these samples to a "NEW" document/view, I need to resize the child/view to be smaller - specifically, the number of samples copied.  What's the best way to do this?
0
Comment
Question by:skink
  • 4
  • 3
7 Comments
 
LVL 4

Accepted Solution

by:
mbhakta earned 40 total points
ID: 1301273
Your statement doesnot seem that clear. Can you clearly say what you are looking for? Are you planning to tile all your views ? Are you having a MDI / SDI , splitter application ? Do you want your mainframe to resize as well ?
0
 

Author Comment

by:skink
ID: 1301274
I'm sorry, I thought it was quite clear.  I want to resize my child window/view it contains.  That's it.  What do tiling, splitter windows, MDI/SDI have to do with it?
0
 
LVL 4

Expert Comment

by:mbhakta
ID: 1301275
I will have to repeat my question in again. What are these 'visual represe..... samples' ? Are they bitmaps, metafiles, text i/o etc. Also for your information resizing of views work differently for MDI's and SDI's. Please explain your objective/s properly, and u might someday find a quicker answer (we have already wasted 2 discussions).
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:skink
ID: 1301276
Again I apologize.  A sample is a numerical representation of an electronic signal (an integer or other type) which I represent in my View class visually.  I load a binary file of samples (quite similar to a .WAV file actually) and display the samples, with the ability to scroll through the file.  I am using a CView derivative, though, not a CScrollView derivative.  My application is MDI.
0
 
LVL 4

Expert Comment

by:mbhakta
ID: 1301277
Firstly, why are you not using a CScrollView derived class. Most of the scrolling headache is taken care by CScrollView for you. Now to your problem. Maybe, before you display the graphics inside the view you should calculate the size of the image yourselves. Convert the width to window co-ordinates, inform your view about the size of the bitmap SetWindowPos(), and use the generic calls ResizeParentToFit() etc. to get the complete image on the view.
0
 

Author Comment

by:skink
ID: 1301278
I was warned against using a CScrollView because of the size of my scrolling area - it was about a year ago so I don't remember the details.  But at any rate, the view class works fine.  So I would prefer not  to change CView to a CScrollView derivative unless I have to.  ResizeParentToFit() is a CScrollView member isn't it?  Is there anything similar for CView or should I roll my own?
0
 

Author Comment

by:skink
ID: 1301279
I resolved the issue by copying some of the code from the MFC source for CScrollView::ResizeParentToFit().  Thanks.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Macro to save highlighted rows as a separate file 5 43
string initialization in java 11 113
format the code in java 6 93
How to convert MFC::CString to UTF8 wchar_t* 10 210
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question