Qbasicnews.com
the Mouse Mileage Tracker 2005 - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: Qbasic "like" compilers/interpreters (http://qbasicnews.com/newforum/forum-5.html)
+--- Forum: FB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-15.html)
+---- Forum: FB Projects (http://qbasicnews.com/newforum/forum-16.html)
+---- Thread: the Mouse Mileage Tracker 2005 (/thread-8283.html)

Pages: 1 2


the Mouse Mileage Tracker 2005 - speedlemon - 10-22-2005

well, I finally made this thing.. Kind of useless, but i think its pretty cool anyways. I might be adding more features later on. Right now, all it does it keep track of
pixels
inches
feet
yards
miles

another feature it has is to save and load it from a file to keep track of how far you went even if it acidentaly closes.
i forgot to mention it only saves after you do shift+escape to quit. so if you close it by rightclicking and closing on the bottom, it wont save your data

Download MM.zip


the Mouse Mileage Tracker 2005 - MystikShadows - 10-22-2005

kewl little tool....


the Mouse Mileage Tracker 2005 - Rattrapmax6 - 10-22-2005

Cool...

btw: [X] Close isn't enabled,. You can tho and make it do the same thing by either:

Code:
IF INKEY$ = CHR$(255) + "X" THEN EXIT DO

..or..

Code:
LOOP UNTIL INKEY$ = CHR$(255) + "X"

And the loop will exit then save the iformation.... :wink:

Also, does the Pixel to Inch stay correct on all screen res?


the Mouse Mileage Tracker 2005 - KiZ - 10-22-2005

how does it translate pixels into distance? They are not a fixed length.


the Mouse Mileage Tracker 2005 - SSC - 10-22-2005

thats kinda cool, but I was wondering the same thing, if the pixels to inches was accurate for diff resolutions.


the Mouse Mileage Tracker 2005 - speedlemon - 10-23-2005

the way i made it, it is 96 pixels=1 inch.
does it seem accurate on your resolutions?
the ones i tested on, and it seems accurate is 1024x768, 1280x800

thanks for the tip kevin, i never knew how to do that before. :oops:


the Mouse Mileage Tracker 2005 - Jofers - 10-23-2005

You should use the GetDeviceCaps function from the Windows API:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/devcons_88s3.asp

You can get the pixels per inch of the screen by feeding it GetDC(0), and either LOGPIXELSX or LOGPIXELSY.


the Mouse Mileage Tracker 2005 - KiZ - 10-23-2005

Speedlemon, Take my Laptop screen for example. It is 11.25 inches wide, at a res of 1024x768

If we are talking about true life distances,

that gives a horizontal res of ~91 px/inch

If I was to change the res to 800x600, I would get only ~71.1 px/inch

As you can see, with different screen sizes and different resolutions the actual pixels per inch differs.


the Mouse Mileage Tracker 2005 - Rattrapmax6 - 10-23-2005

@ Kiz: That's a good point too, if the screen is wider or narrower, that would effect it also.... Leaving no real way to measure it,... :roll:

Also screen settings, like now, I can size the screen position also effecting it....


the Mouse Mileage Tracker 2005 - Antoni Gual - 10-23-2005

Fortunately mouse has no oil to be changed at a fixed mileage Big Grin