home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!microsoft!hexnut!blakeco
- From: blakeco@microsoft.com (Blake Coverett)
- Subject: Re: SetViewportExt and Screen Mapping
- Message-ID: <1992Sep01.030312.5301@microsoft.com>
- Date: 01 Sep 92 03:03:12 GMT
- Organization: Microsoft Canada Inc.
- References: <92242.153745IO70935@MAINE.MAINE.EDU>
- Lines: 27
-
- In article <92242.153745IO70935@MAINE.MAINE.EDU> <IO70935@MAINE.MAINE.EDU> writes:
- >I working on an application that requires a real time display for a data acqusi
- >stion program and I need to remap the window. I would like to map the window in
- > a user coordinate system such that one corner is x1,y1 and the other x2,y2. I
- >am looking for any information or examples of how to do this my BC 3.0 Manuals
- >are no help and Microsofts Reference Book little better. Thanks in advance.
-
- HDC GetScaledDC(HWND hwnd, int left, int top, int right, int bottom)
- {
- HDC hdc;
- RECT r;
-
- hdc = GetDC(hWnd);
- GetClientRect(hWnd, &r);
- SetMapMode(hdc, MM_ANISOTROPIC);
- SetWindowOrg(hdc, left, bottom);
- SetWindowExt(hdc, right-left, top-bottom);
- //SetViewportOrg(hdc, 0, 0); This is the default in a clean DC
- SetViewportExt(hdc, r.right, r.bottom);
-
- return hdc;
- }
-
- -Blake (typed off the top of my head, all disclaimers apply)
- --
- #include <std/disclaimer.h> blakeco@microsoft.com
- Mail Flames, Post Apologies. ...!uunet!microsoft!blakeco
-