Click here to Skip to main content
16,011,374 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalwebcam implementation in vc++ Pin
ps_diwanji12-Dec-04 17:11
ps_diwanji12-Dec-04 17:11 
GeneralRe: webcam implementation in vc++ Pin
Cyberizen12-Dec-04 19:20
Cyberizen12-Dec-04 19:20 
GeneralRe: webcam implementation in vc++ Pin
tspramod12-Dec-04 22:37
tspramod12-Dec-04 22:37 
GeneralRe: webcam implementation in vc++ Pin
Antti Keskinen12-Dec-04 23:27
Antti Keskinen12-Dec-04 23:27 
GeneralRe: webcam implementation in vc++ Pin
Cyberizen13-Dec-04 5:30
Cyberizen13-Dec-04 5:30 
GeneralRe: webcam implementation in vc++ Pin
Antti Keskinen13-Dec-04 7:46
Antti Keskinen13-Dec-04 7:46 
GeneralRe: webcam implementation in vc++ Pin
tspramod13-Dec-04 20:04
tspramod13-Dec-04 20:04 
GeneralConfused by the "Mapping Mode" Pin
LiYS12-Dec-04 17:07
LiYS12-Dec-04 17:07 
Hi all:
Recently I've been reading Charles Petzold's Programming Windows, but in the The GDI Mapping Mode chapter I encounter a few sentences for which I think they're contradict with each other. I'm sure It just because I'm just don't fully understand the priciple in it. But, for now it really confused me. So I hope if someone had readed this book or have a understanding about Mapping Mode can show me the way! The following is the excerpt for the book that confused me!


Charles Petzold said "If you change the viewport origin to (xViewOrg, yViewOrg), the logical point (0, 0) will be mapped to the device point (xViewOrg, yViewOrg). If you change the window origin to (xWinOrg, yWinOrg), the logical point (xWinOrg, yWinOrg) will be mapped to the device point (0, 0), which is the upper left corner. Regardless of any changes you make to the window and viewport origins, the device point (0, 0) is always the upper left corner of the client area."

given the code
<br />
SetViewportOrgEx (hdc, cxClient / 2, cyClient / 2, NULL) ;//cxClient is the client coordinate's X axis, the cyClient is the same<br />
SetWindowOrgEx (hdc, -cxClient / 2, -cyClient / 2, NULL) ;


and he says "This means that the logical point (-cxClient/2, -cyClient/2) is mapped to the device point (cxClient/2, cyClient/2)"

Here's the confusion comes. the first line of code mapped the logical point (0,0) to the device point (0,0) which lies in the center after the call SetViewportOrgEx(...), I have no problem with that, but according to "If you change the window origin to (xWinOrg, yWinOrg), the logical point (xWinOrg, yWinOrg) will be mapped to the device point (0, 0)" how's the (-cxClient / 2 ,-cyClient / 2) which is in the upper left corner mapped to the (cxClient/2, cyClient/2) which is in the lower right corner???? Since the device point (0,0) can't be changed, It always lies in the upper left corner??Smile | :)
note: the mapping mode is in the default!MM_TEXT
GeneralRe: Confused by the &quot;Mapping Mode&quot; Pin
Antti Keskinen12-Dec-04 22:51
Antti Keskinen12-Dec-04 22:51 
QuestionHow to create a dialog like this? Pin
Arcrest12-Dec-04 15:26
Arcrest12-Dec-04 15:26 
AnswerRe: How to create a dialog like this? Pin
Prakash Nadar12-Dec-04 17:21
Prakash Nadar12-Dec-04 17:21 
GeneralRe: How to create a dialog like this? Pin
Arcrest13-Dec-04 17:22
Arcrest13-Dec-04 17:22 
Questiondefinition file? Pin
nm_11412-Dec-04 11:48
nm_11412-Dec-04 11:48 
AnswerRe: definition file? Pin
Jack Puppy12-Dec-04 13:38
Jack Puppy12-Dec-04 13:38 
AnswerRe: definition file? Pin
bmzhao12-Dec-04 14:18
bmzhao12-Dec-04 14:18 
Generaltable like structure(multiple collumns) Pin
Spiritofamerica12-Dec-04 9:46
Spiritofamerica12-Dec-04 9:46 
GeneralRe: table like structure(multiple collumns) Pin
PJ Arends12-Dec-04 10:17
professionalPJ Arends12-Dec-04 10:17 
GeneralRe: table like structure(multiple collumns) Pin
lisoft12-Dec-04 13:55
lisoft12-Dec-04 13:55 
GeneralRe: table like structure(multiple collumns) Pin
bmzhao12-Dec-04 14:11
bmzhao12-Dec-04 14:11 
GeneralCEdit select text highlight Pin
Anonymous12-Dec-04 8:26
Anonymous12-Dec-04 8:26 
GeneralRe: CEdit select text highlight Pin
PJ Arends12-Dec-04 9:14
professionalPJ Arends12-Dec-04 9:14 
QuestionCannot ever open fstream object in DLL? Pin
registering12-Dec-04 8:23
registering12-Dec-04 8:23 
AnswerRe: Cannot ever open fstream object in DLL? Pin
bmzhao12-Dec-04 14:04
bmzhao12-Dec-04 14:04 
GeneralRe: Cannot ever open fstream object in DLL? Pin
registering12-Dec-04 14:31
registering12-Dec-04 14:31 
GeneralConfused by the &quot;Mapping Mode&quot; Pin
LiYS12-Dec-04 4:41
LiYS12-Dec-04 4:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.