The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
naved momin wrote:what as a developer i can do to make sure that the co-ordinates will be same regardless of the screen resolution ?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
naved momin wrote:what as a developer i can do to make sure that the co-ordinates will be same regardless of the screen resolution ?
I'm no GUI expert, but I suspect strongly that you're confusing the problem with the solution (or rather, a solution).
Even assuming that you do have to move your mouse to the correct location (and I suspect you don't), there are several possible solutions to the issue; just one of which is that every visible component on a screen has a "rectangle" that it fits in, which is defined by its 'origin' (the location of its top left corner), its width and its height.
Given those 3, it should be a simple matter to move the mouse pointer to the centre of the component, regardless of screen resolution.
Winston
The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
Winston Gutkowski wrote:
naved momin wrote:what as a developer i can do to make sure that the co-ordinates will be same regardless of the screen resolution ?
I'm no GUI expert, but I suspect strongly that you're confusing the problem with the solution (or rather, a solution).
Even assuming that you do have to move your mouse to the correct location (and I suspect you don't), there are several possible solutions to the issue; just one of which is that every visible component on a screen has a "rectangle" that it fits in, which is defined by its 'origin' (the location of its top left corner), its width and its height.
Given those 3, it should be a simple matter to move the mouse pointer to the centre of the component, regardless of screen resolution.
Winston
The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
naved momin wrote:and if the screen resolution changes then this pixels address (ie x and y coordinates) might change so how to solve this ....
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
naved momin wrote:and if the screen resolution changes then this pixels address (ie x and y coordinates) might change so how to solve this ....
Surely, if the screen resolution changes, those values will change.
Winston
The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
naved momin wrote:so whats your solution for that to keep the x and y co-ordinates same regardless of resolution ?
naved momin wrote:so whats your solution for that to keep the x and y co-ordinates same regardless of resolution ?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Martin Vajsar wrote:
naved momin wrote:so whats your solution for that to keep the x and y co-ordinates same regardless of resolution ?
The coordinates depend on many things, and screen resolution is not one of them. At least not directly.
The coordinates are determined by (among others):
the position and size of the browser window (there could even be multiple displays, complicating things further), extensions and themes installed in the browser (since these can influence eg. the size and number of displayed toolbars), font sizes and types used by the browser, which are user configurable, OS visual themes or personalisations (as these can change sizes of window borders and titles), possible user customization of the Google homepage, last but not least, on the number and location of links Google decides to put on its home page.
I completely fail to see what you're actually trying to do, but given existing constraints listed above, I'd say it is not possible to derive the coordinates just from the screen resolution. For a very limited case (such as two computers with given settings, maximized browser window, fixed configuration etc.) some formula for determining the coordinates might perhaps be found. (If I was forced to do something like this, I'd simply note the coordinates for every screen resolution that would be ever used on the computers.)
The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
naved momin wrote:let me explain to you and @wiston , i have to develop and app that allows you to take control over the mouse of another pc and ofcource both will be connect through socket...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
naved momin wrote:let me explain to you and @wiston , i have to develop and app that allows you to take control over the mouse of another pc and ofcource both will be connect through socket...
Ooof. I see your problem (finally); and I suspect you have quite a task ahead of you.
VNC, which was created via a joint development team of Olivetti Labs with Cambridge University, took more than 2 years to develop. Remote desktop software is NOT easy (and the problem you've uncovered is merely one in a LONG list).
First: Is this a development project for school/university, or do you simply need the capability? If the latter, I'd just download a copy of VNC or Butterfly and use that (the latter may not be free - certainly wasn't in my time; but it's nice. VNC is).
Second: I suspect you'd still be better off coupling "remote screen" (for you) and "remote mouse" (for them) software together and simply running the GUI on the client as normal; however, since both are driver-based, the chances are you'll have problems writing a Java application for either, unless you want to get down-and-dirty with things like X.
Even if this is a class exercise:
1. Sometimes the best solution has already been written.
2. Sometimes the correct answer is: N/A (not applicable). But be sure you can back up your answer.![]()
Winston
The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
naved momin wrote:
Winston Gutkowski wrote:
naved momin wrote:let me explain to you and @wiston , i have to develop and app that allows you to take control over the mouse of another pc and ofcource both will be connect through socket...
Ooof. I see your problem (finally); and I suspect you have quite a task ahead of you.
VNC, which was created via a joint development team of Olivetti Labs with Cambridge University, took more than 2 years to develop. Remote desktop software is NOT easy (and the problem you've uncovered is merely one in a LONG list).
First: Is this a development project for school/university, or do you simply need the capability? If the latter, I'd just download a copy of VNC or Butterfly and use that (the latter may not be free - certainly wasn't in my time; but it's nice. VNC is).
Second: I suspect you'd still be better off coupling "remote screen" (for you) and "remote mouse" (for them) software together and simply running the GUI on the client as normal; however, since both are driver-based, the chances are you'll have problems writing a Java application for either, unless you want to get down-and-dirty with things like X.
Even if this is a class exercise:
1. Sometimes the best solution has already been written.
2. Sometimes the correct answer is: N/A (not applicable). But be sure you can back up your answer.![]()
Winston
thanks winston and martin and i would like to say you guys couple of things
1. this is not and school project nor i need this functionality because TeamViewer is on my desktop , but i like the idea, working and application of developing this application and that's why i need to develop this application
2. after all the cakes and watermelon you guys means this is impossible in java , i need to go down to c or c++
3. if i write this same application in c or c++, I thing i m goona stuck at the same level where display co-ordinates differs from computer to computer
4. so what can we do ? we have to find a middle way to accomplish this task ? does you guys know any ?
let us rephrase what this application is , this application is not Remote control software but it is a kind of remote control software in which one person can take over the control of another computers mouse and perform "web" related task just for now , for e.g: clicking gmail button , etc
The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
Consider Paul's rocket mass heater. |