Official BS.Player forums

Official BS.Player forums (http://forum.bsplayer.com/index.php)
-   Answered And Solved Questions (http://forum.bsplayer.com/forumdisplay.php?f=20)
-   -   Main Window Position and Movie Window Position (http://forum.bsplayer.com/showthread.php?t=37041)

UnknownName 28th July 2017 09:12 AM

Main Window Position and Movie Window Position
 
Hello guys,

I've got a little question. I've went into BSPlayer.xml configuration file and I've started to play with PlayWinPos (Movie Window position) and MainWinPos (Main Window Position). I've managed to change the location of these windows through the configuration file, but i can't seem to find the formula.

For example for value 39125179 the x = 603 and y = 187 and for value 28181034 the x = 436 and y = 554.

What i want ?
I'm trying to move the window through a network remote control through Android/iOS.

UnknownName 28th July 2017 01:04 PM

Ok. So, i'm going to answer my own question if somebody will be in need ever after this. After a lot of trial and error and some basic math i've found this :

using C# :

public void SetWindowScreen(Screen screen)
{
int PlayWinPos = ((screen.WorkingArea.X + X) * 65536 + screen.WorkingArea.Y + Y);
return PlayWinPos;
}

screen - it's the main screen or secondary screen
X - x position of top left corner of Movie Window
Y - y position of top left corner of Movie Window

Don't ask me why it's multiplied by 65536. Can't seem to find the connection between that value and screen resolution.

A moderator can close this thread.

bst2 28th July 2017 03:09 PM

It's 32 bit integer, HIWORD is x and LOWORD is y position of top left corner.

For ex.

Code:

position = 43254468  // 0x029402C4

x = 0x0294 -> 660
y = 0x02C4 -> 708

x = position >> 16;
y = position & 0xFFFF;

reverse:
position = (x << 16) | y;


UnknownName 31st July 2017 09:14 AM

Now it makes sense how they are calculated. Thank you. :teeth:


All times are GMT +1. The time now is 07:27 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
Ad Management plugin by RedTyger


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20