Click here to Skip to main content
16,004,727 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Peculiar compiling differences. Pin
Michael Dunn17-May-01 18:59
sitebuilderMichael Dunn17-May-01 18:59 
GeneralRe: Peculiar compiling differences. Pin
David Fleming17-May-01 19:58
David Fleming17-May-01 19:58 
GeneralRe: Peculiar compiling differences. Pin
13-May-01 22:13
suss13-May-01 22:13 
QuestionCLongBinary --> CBitmap? Pin
13-May-01 4:44
suss13-May-01 4:44 
GeneralIn ActiveX Component MS Winsock Ver 6I can't senddata from server to client by client use getdata function but it can't receive data. Pin
12-May-01 19:09
suss12-May-01 19:09 
GeneralNeed code for Address Book... Pin
Ting12-May-01 12:08
Ting12-May-01 12:08 
GeneralA window into a big world Pin
Bilal Naveed12-May-01 8:36
Bilal Naveed12-May-01 8:36 
GeneralRe: A window into a big world Pin
Christian Graus12-May-01 11:42
protectorChristian Graus12-May-01 11:42 
Two things:

1/ If you're writing a game, you'll want to use DirectX, not just GDI/MFC.

2/ This sort of view is easy to achieve. You keep track of the whole world, and what it is doing, and remember the top left point you are at - then only try to draw things within the 50 x 50 box that is built from it, and compensate for these values when drawing. i.e. if I have an 800x600 screen ( you'd have to draw 600x600 to maintain aspect ratio - option bars on the edges ? ) and I am at point 1000/500, I draw anything between 1000/500 and 1050/550. I subtract 1000 from all X values and 500 from all Y values before I draw, and scale by 12 in both directions to go from 50 to 600. BTW, if you need to divide for any conversions you should multiply by a float, multiplication is faster than division.

As for your little view, again it's a case of taking the point clicked on, normalising it ( making it's top left edge 0,0 and moving the other points so the size is unchanged ) and then getting a co-ordinate by scaling betwen the size of the scanner box and the size of your world.



Christian

I've learned that you cannot make someone love you. All you can do is stalk them and hope they panic and give in.

The early bird may get the worm, but it's the second mouse that gets the cheese.
GeneralRe: A window into a big world Pin
Pros Chum12-May-01 12:20
Pros Chum12-May-01 12:20 
GeneralRe: A window into a big world Pin
Christian Graus12-May-01 13:29
protectorChristian Graus12-May-01 13:29 
GeneralRe: A window into a big world Pin
Ting16-May-01 11:16
Ting16-May-01 11:16 
GeneralRe: A window into a big world Pin
Christian Graus16-May-01 12:17
protectorChristian Graus16-May-01 12:17 
GeneralRe: A window into a big world Pin
David Fleming14-May-01 15:34
David Fleming14-May-01 15:34 
GeneralChallege Quistion: How to execute program from memory block Pin
12-May-01 7:02
suss12-May-01 7:02 
GeneralRe: Challege Quistion: How to execute program from memory block Pin
Gert Boddaert13-May-01 22:17
Gert Boddaert13-May-01 22:17 
GeneralAvoiding the windows error messageboxes to appear when WriteFile, CopyFile... and disk is removed Pin
Joan M12-May-01 0:44
professionalJoan M12-May-01 0:44 
GeneralRe: Avoiding the windows error messageboxes to appear when WriteFile, CopyFile... and disk is removed Pin
Tomasz Sowinski12-May-01 1:46
Tomasz Sowinski12-May-01 1:46 
Questionhow to convert a _variant_t to recordset in vc++? Pin
11-May-01 23:01
suss11-May-01 23:01 
AnswerRe: how to convert a _variant_t to recordset in vc++? Pin
chenzhu12-May-01 3:18
chenzhu12-May-01 3:18 
GeneralRe: how to convert a _variant_t to recordset in vc++? Pin
13-May-01 0:07
suss13-May-01 0:07 
Questionhow to PtinLine Function? Pin
11-May-01 17:00
suss11-May-01 17:00 
AnswerRe: how to PtinLine Function? Pin
Christian Graus12-May-01 2:55
protectorChristian Graus12-May-01 2:55 
GeneralglReadPixels() Help! Pin
11-May-01 16:52
suss11-May-01 16:52 
GeneralRe: glReadPixels() Help! Pin
l a u r e n11-May-01 21:16
l a u r e n11-May-01 21:16 
GeneralRe: glReadPixels() Help! Pin
Jonathan de Halleux30-Oct-01 1:23
Jonathan de Halleux30-Oct-01 1:23 

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.