Jump to content

  • Log In with Google      Sign In   
  • Create Account

saman_artorious

Member Since 01 Jul 2013
Offline Last Active Jan 21 2014 09:34 AM

Posts I've Made

In Topic: bind a bitmap raw data as texture to gl

16 November 2013 - 12:01 AM

this shows how to bind an image to texture and not a bitmap.


In Topic: encircle any point on the screen

25 August 2013 - 06:34 AM

I solved the problem. I calculated the central coordinate of the target circle and added it to the original drawing which is rendered at (0,0).

 


In Topic: render image raw data to texture

17 August 2013 - 04:34 AM

I'm not sure what you are about at all, and that makes suggesting a more suitable solution problematic...

 

It looks like you want to do a remote GUI, but for what purpose? Is a separate, dedicated solution like VNC (Virtual Network Computing, a remote desktop solution) suitable? Is the function of VNC suitable, but you need to integrate it into an own program? If, on the other hand, replicating an exact image of the GUI is not necessary (or even the GUI need to exist only on the one machine at all), then an approach with command sending would be much more efficient.

 

You mentioned to use VLC (VideoLAN). If I understand it right ... I suspect that performing video compression / decompression on-the-fly could lower the CPU load. 

VNC is a good way, but, I don't think that it supports compression/decompression. That's why I need to write the app myself. Thanks for your idea though, I found it very useful.


In Topic: transfering x,y coordinates from one machine to another

17 August 2013 - 12:35 AM

it'll be accurate. monitor size doesn't matter.

 

(60,10) on 1024x768 will be (80,10) on 1360x768

 

At most you'll have a pixel offset of inaccuracy due to fractional component... but that shouldn't matter in practice, unless you could cook up some amazingly superb reason which would just happen to not based on practical experience smile.png

 

How do you calculate it?

I am looking for a general conversion function, is the below correct?

QPoint point = event->globalPos();
QSize size = qApp->desktop()->screen()->size();
point.setX(100 * point.x() / size.width());
point.setY(100 * point.y() / size.height());

reverse:

    QPoint point;
    // receive point
     
    QSize size = qApp->desktop()->screen()->size();
    point.setX(size.width() * point.x() / 100);
    point.setY(size.height() * point.y() / 100);
     
    //use the point

In Topic: transfering x,y coordinates from one machine to another

16 August 2013 - 11:44 PM

Do you want the retain the absolute coordinates (i.e. x:60,y:10 on machine1 is x:60,y:10 on machine2) or relative coordinates (i.w. x:25%,y50% on machine1 is x:25%,y50% on machine 2)? I'm assuming the latter so I'm not sure what the issue is with the thrust of 3TATUK2's suggestion. Working with coordinates in normalized form (i.e. [0,1] or [-1,+1]) would be the obvious solution as you can map these values to whatever size/resolution you want with more than enough accuracy but I guess I must be missing something?

I don't think so, what I was afraid of, and what the fellows told me was if the resolution and monitor sizes differ, relative or percentage values could not be accurate.

 

for example, x:60 y:10 on a machine one with resolution: 1024:768 19 inch may not absolutely refer to the same point on machine 2 with resolution: 1360:768 same size.

By the way, we came to an agreement to use the same widget size and resolution for two machines. However, I still like to know if the relative case can also direct me towards accurate results.


PARTNERS