Solved

restricting a picture's size in a dialog

Posted on 1998-09-06
3
234 Views
Last Modified: 2013-11-20
Using : NT 4.0, VC++ 5.0.

Hi all,
I have a dialog box which displays a frame of a .avi (for example) . My problem is that AVI files are in different frame size, so my picture is sometimes huge and sometimes  very small...
How can I restrict a pictures size in a dialog box, so it won't cover other dialog controls?

Thanks a lot..
Hilit
0
Comment
Question by:hilit
3 Comments
 
LVL 23

Expert Comment

by:chensu
ID: 1321774
What control are you using to display the picture in the dialog box?
0
 
LVL 1

Author Comment

by:hilit
ID: 1321775
It's a picture control, type frame.
Thanks!
0
 

Accepted Solution

by:
klingej earned 60 total points
ID: 1321776
I am displaying bitmaps in a dialog using a picture control, type rectangle, and code something like this:

RECT rectDest, rectParent;
CWnd *pwnd=GetDlgItem(IDC_PICTURE_CONTROL);

if(pwnd) {
                  pwnd->GetWindowRect(&rectDest);
GetWindowRect(&rectParent);
rectDest.left -= rectParent.left;
rectDest.right -= rectParent.left;
rectDest.top -= rectParent.top;
rectDest.bottom -= rectParent.top;

}

and then display the picture in the rectDest.

Could this help
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

839 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