[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

Sizing a child/view...

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
skink
Asked:
skink
  • 4
  • 3
1 Solution
 
mbhaktaCommented:
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
 
skinkAuthor Commented:
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
 
mbhaktaCommented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
skinkAuthor Commented:
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
 
mbhaktaCommented:
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
 
skinkAuthor Commented:
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
 
skinkAuthor Commented:
I resolved the issue by copying some of the code from the MFC source for CScrollView::ResizeParentToFit().  Thanks.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now