How to fit to client area (MFC)

This is a discussion on How to fit to client area (MFC) within the Windows Programming forums, part of the Platform Specific Boards category; Hi, Im completely new to Visual C++ & have a question! I feel its a strange question, but I couldnt ...

  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    1

    How to fit to client area (MFC)

    Hi,
    Im completely new to Visual C++ & have a question! I feel its a strange question, but I couldnt find the answer

    Ive plotted a signal in the client area. When the child window is in the normal state (not maximized), the signal is fit to it.

    How can I scale the plotted signal so that it is fit to client area when the window get resized or maximized? (probably using onSize()... I actually need to know how to get "client area size" when the window get resized)

    (Please excuse my poor English)
    Last edited by sorrowful; 04-21-2012 at 09:22 AM.

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,859
    It may be best to stop the user from re-sizing your application....

    >>How can I scale the plotted signal so that it is fit to client area when the window get resized or maximized?

    Depends...

    In OnPaint() use copy the image using StretchBlt(). This will probably not produce good results with a line drawing like a plot.

    >>how to get "client area size" when the window get resized

    In the OnSized() [check this is when the window has finsihed changing size not is about to be resized, been a while since I wrote MFC]
    Use GetClientRect() to find the size

    You might find AdjustWindowRect() helpful.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. drawing outside client area
    By h_howee in forum Windows Programming
    Replies: 8
    Last Post: 03-28-2007, 07:40 AM
  2. Removing the non-client area
    By bennyandthejets in forum Windows Programming
    Replies: 3
    Last Post: 07-22-2003, 06:23 AM
  3. when the client area is created
    By bennyandthejets in forum Windows Programming
    Replies: 1
    Last Post: 01-08-2003, 10:35 PM
  4. Help resizing client area
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 07-07-2002, 08:33 PM
  5. Clearing the client area
    By Isometric in forum Windows Programming
    Replies: 15
    Last Post: 01-29-2002, 09:07 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21