Click here to Skip to main content
15,887,683 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionPolyLine and graph scaling Pin
npuleio5-Feb-10 3:11
npuleio5-Feb-10 3:11 
AnswerRe: PolyLine and graph scaling Pin
CPallini5-Feb-10 3:51
mveCPallini5-Feb-10 3:51 
GeneralRe: PolyLine and graph scaling Pin
npuleio5-Feb-10 4:10
npuleio5-Feb-10 4:10 
AnswerRe: PolyLine and graph scaling - aka Fer shame Carlo. Pin
Iain Clarke, Warrior Programmer5-Feb-10 6:12
Iain Clarke, Warrior Programmer5-Feb-10 6:12 
GeneralRe: PolyLine and graph scaling - aka Fer shame Carlo. Pin
CPallini5-Feb-10 6:53
mveCPallini5-Feb-10 6:53 
GeneralRe: PolyLine and graph scaling - aka Fer shame Carlo. Pin
Iain Clarke, Warrior Programmer5-Feb-10 6:59
Iain Clarke, Warrior Programmer5-Feb-10 6:59 
GeneralRe: PolyLine and graph scaling - aka Fer shame Carlo. Pin
CPallini5-Feb-10 8:06
mveCPallini5-Feb-10 8:06 
GeneralRe: PolyLine and graph scaling - aka Fer shame Carlo. Pin
npuleio7-Feb-10 23:30
npuleio7-Feb-10 23:30 
Hello Iain,

I tried that Viewport of Joseph Newcomer and I would say in the array I'm using consecutive integers as X coordinates like 1,2,3,4,...,n...so in SetWindowExt, which should be the interested method for re-scaling I guess, I use current last X value in the array for X coord and in the place of Y I use rect.bottom since Y values in the array are actually random with this formula:

myarray[i].y = (LONG)( (double)rand() / (RAND_MAX + 1) * (rect.bottom
- 1) + 1 );

(the array is fixed size to the whole window resolution width where when I add new value at the last place I rotate before the array to shift-left it).
The matter is if I set SetWindowExt with last myarray[myarray.size() - 1].x and rect.bottom, which would be reasonably the right way to set for rescale, produces an assertion error.
Using Newcomer's Viewport example I found on codeproject, i figured to set the origin at bottom right having axis going back to bottom-left and top-right it made me setting SetViewportOrg and SetWindowOrg respectively to 0,0 and rect.BottomRight() so it would start from bottom-right... and setting SetWindowExt to rect.Width() and
rect.Height() didn't produced any assertion errors but doesn't repaints rescaled graphic. You can see the two results here:

http://img707.imageshack.us/img707/3444/44318805.jpg <---- this is the
control minimized

http://img16.imageshack.us/img16/4699/64174798.jpg <---- this is the
control maximized

Maybe I haven't got well in my mind about right settings of those
SetWindowOrg, SetWindowExt, SetViewportOrg, SetViewportExt...

Any suggest?...

Thanks
Ciao,
Luigi
QuestionDoubts about sockets in vc++ Pin
thangvel5-Feb-10 0:32
thangvel5-Feb-10 0:32 
AnswerRe: Doubts about sockets in vc++ Pin
Richard MacCutchan5-Feb-10 0:46
mveRichard MacCutchan5-Feb-10 0:46 
AnswerRe: Doubts about sockets in vc++ Pin
CPallini5-Feb-10 0:52
mveCPallini5-Feb-10 0:52 
AnswerRe: Doubts about sockets in vc++ Pin
fat_boy5-Feb-10 1:04
fat_boy5-Feb-10 1:04 
AnswerRe: Doubts about sockets in vc++ Pin
Moak5-Feb-10 2:26
Moak5-Feb-10 2:26 
QuestionIOCTL_STORAGE_GET_DEVICE_NUMBER fail to get disk number Pin
MKC0024-Feb-10 22:26
MKC0024-Feb-10 22:26 
AnswerRe: IOCTL_STORAGE_GET_DEVICE_NUMBER fail to get disk number Pin
vasu_sri4-Feb-10 22:36
vasu_sri4-Feb-10 22:36 
GeneralRe: IOCTL_STORAGE_GET_DEVICE_NUMBER fail to get disk number Pin
MKC0024-Feb-10 23:21
MKC0024-Feb-10 23:21 
GeneralRe: IOCTL_STORAGE_GET_DEVICE_NUMBER fail to get disk number Pin
vasu_sri4-Feb-10 23:40
vasu_sri4-Feb-10 23:40 
GeneralRe: IOCTL_STORAGE_GET_DEVICE_NUMBER fail to get disk number Pin
Adam Roderick J5-Feb-10 0:10
Adam Roderick J5-Feb-10 0:10 
Questionpicture control is hidden by static box Pin
learningvisualc4-Feb-10 21:48
learningvisualc4-Feb-10 21:48 
AnswerRe: picture control is hidden by static box Pin
KingsGambit4-Feb-10 22:14
KingsGambit4-Feb-10 22:14 
GeneralRe: picture control is hidden by static box Pin
learningvisualc4-Feb-10 22:26
learningvisualc4-Feb-10 22:26 
GeneralRe: picture control is hidden by static box Pin
KingsGambit4-Feb-10 22:38
KingsGambit4-Feb-10 22:38 
GeneralRe: picture control is hidden by static box Pin
learningvisualc4-Feb-10 22:53
learningvisualc4-Feb-10 22:53 
GeneralRe: picture control is hidden by static box Pin
Moak4-Feb-10 23:15
Moak4-Feb-10 23:15 
GeneralRe: picture control is hidden by static box Pin
KingsGambit4-Feb-10 23:21
KingsGambit4-Feb-10 23:21 

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.