123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365 |
- var maxSizeX = 100; // �ִ� ũ��
- var minSizeX = 10; // �ּ� ũ��
- var curSizeX = 100; // ���� ũ��
- var maxSizeY = 80; // �ִ� ũ��
- var minSizeY = 8; // �ּ� ũ��
- var curSizeY = 80; // ���� ũ��
- var unitSizeX = 5; // �̵� ����
- var unitSizeY = 4; // �̵� ����
- var curX = 0; // ���� ��ġ X
- var curY = 0; // ���� ��ġ Y
- var prevzoomX = 0;
- var prevzoomY = 0;
- var prevzoomSizeX = 100; // ���� ũ��
- var onLayer = false;
- function ImageChange()
- {
- eval("document.getElementById('remote').style.background = 'url(/resources/img/"+curSizeX+"_"+curSizeY+".jpg)';");
- document.getElementById('remote').style.backgroundRepeat = "no-repeat";
- }
- function movepic(img_name, img_src)
- {
- document[img_name].src = img_src;
- }
- function MoveUp()
- {
- if( curY < unitSizeY ) // �� �̻� �ö� �� ����
- return;
- curY = curY - unitSizeY;
- document.getElementById('remote').style.position = "relative";
- document.getElementById('remote').style.top = curY+"px";;
- }
- function MoveDown()
- {
- if( curY + curSizeY == maxSizeY) // �� �̻� ������ �� ����
- return;
- curY = curY + unitSizeY;
- if(curY + curSizeY > maxSizeY){
- curY = maxSizeY - curSizeY;
- }
- document.getElementById('remote').style.position = "relative";
- document.getElementById('remote').style.top = curY+"px";;
- }
- function MoveLeft()
- {
- if( curX < unitSizeX ) // �� �̻� �������� �̵��� �� ����
- return;
- curX = curX - unitSizeX;
- document.getElementById('remote').style.position = "relative";
- document.getElementById('remote').style.left = curX+"px";;
- }
- function MoveRight()
- {
- if( curX + curSizeX == maxSizeX) // �� �̻� ���������� �̵��� �� ����
- return;
- curX = curX + unitSizeX;
- document.getElementById('remote').style.position = "relative";
- document.getElementById('remote').style.left = curX+"px";;
- }
- function Move( moveX, moveY )
- {
- curX = moveX;
- curY = moveY;
- if ( curX + curSizeX > maxSizeX )
- curX = maxSizeX - curSizeX;
- if ( curY + curSizeY > maxSizeY )
- curY = maxSizeY - curSizeY;
- document.getElementById('remote').style.position = "relative";
- document.getElementById('remote').style.top = curY+"px";;
- document.getElementById('remote').style.left = curX+"px";;
- }
- function ZoomIn()
- {
- if( curSizeX <= minSizeX ) // �� �̻� �۾��� �� ����
- return;
-
- curSizeX = curSizeX - ( unitSizeX * 2 );
- curSizeY = curSizeY - ( unitSizeY * 2 );
- document.getElementById('remote').style.width = curSizeX+"px";
- document.getElementById('remote').style.height = curSizeY+"px";
- MoveDown();
- MoveRight();
- SetDigitalZoom(0);
- ImageChange();
- }
- function ZoomOut()
- {
- if( curSizeX >= maxSizeX ) // ���̻� Ŀ�� �� ����
- return;
-
- curSizeX = curSizeX + ( unitSizeX * 2 );
- curSizeY = curSizeY + ( unitSizeY * 2 );
- document.getElementById('remote').style.width = curSizeX+"px";
- document.getElementById('remote').style.height = curSizeY+"px";
-
- MoveUp();
- MoveLeft();
- if( curY + curSizeY > maxSizeY )
- MoveUp();
- if( curX + curSizeX > maxSizeX )
- MoveLeft();
- SetDigitalZoom(0);
- ImageChange();
- }
- function ZoomHome()
- {
- curSizeX = maxSizeX;
- curSizeY = maxSizeY;
- curX = 0;
- curY = 0;
- document.getElementById('remote').style.width = curSizeX+"px";
- document.getElementById('remote').style.height = curSizeY+"px";
- document.getElementById('remote').style.position = "relative";
- document.getElementById('remote').style.top = curY+"px";;
- document.getElementById('remote').style.left = curX+"px";;
-
- SetDigitalZoom(0);
- ImageChange();
- }
- function ButtonUp()
- {
- MoveUp();
- SetDigitalZoom(0);
- }
- function ButtonDown()
- {
- MoveDown();
- SetDigitalZoom(0);
- }
- function ButtonLeft()
- {
- MoveLeft();
- SetDigitalZoom(0);
- }
- function ButtonRight()
- {
- MoveRight();
- SetDigitalZoom(0);
- }
- function ButtonLeftUp()
- {
- MoveLeft();
- MoveUp();
- SetDigitalZoom(0);
- }
- function ButtonRightUp()
- {
- MoveRight();
- MoveUp();
- SetDigitalZoom(0);
- }
- function ButtonLeftDown()
- {
- MoveLeft();
- MoveDown();
- SetDigitalZoom(0);
- }
- function ButtonRightDown()
- {
- MoveRight();
- MoveDown();
- SetDigitalZoom(0);
- }
- function RedrawDzoom()
- {
- SetDigitalZoom(1);
- }
- function SetDigitalZoom(force)
- {
- var ratio = 0;
- var relativeposX = 0;
- var relativeposY = 0;
- if((prevzoomX != curX) || (prevzoomY != curY) || (prevzoomSizeX != curSizeX) || (force == 1)){
- prevzoomX = curX;
- prevzoomY = curY;
- prevzoomSizeX = curSizeX;
-
- if(trnPlayer == PLAYER_ACTIVEX){
- // ���⼭ tvs control
- // infoStr = "curSize : " + curSizeX + " / curX : " + curX + " / curY : " + curY;
- // document.iForm.result.value = document.iForm.result.value + infoStr + "\n";
- relativeposX = Math.round((tvs_get_width()) * curX / 100);
- relativeposY = Math.round((tvs_get_height()) * curY / 80);
- // alert("relativeposX = " + relativeposX + "relativeposY = " + relativeposY + "curSizeX = " + curSizeX);
- if(curSizeX == 100){
- tvs_digitalzoom(100, relativeposX, relativeposY);
- }
- else if(curSizeX == 90){
- tvs_digitalzoom(111, relativeposX, relativeposY);
- }
- else if(curSizeX == 80){
- tvs_digitalzoom(125, relativeposX, relativeposY);
- }
- else if(curSizeX == 70){
- tvs_digitalzoom(143, relativeposX, relativeposY);
- }
- else if(curSizeX == 60){
- tvs_digitalzoom(167, relativeposX, relativeposY);
- }
- else if(curSizeX == 50){
- tvs_digitalzoom(200, relativeposX, relativeposY);
- }
- else if(curSizeX == 40){
- tvs_digitalzoom(250, relativeposX, relativeposY);
- }
- else if(curSizeX == 30){
- tvs_digitalzoom(333, relativeposX, relativeposY);
- }
- else if(curSizeX == 20){
- tvs_digitalzoom(500, relativeposX, relativeposY);
- }
- else if(curSizeX == 10){
- tvs_digitalzoom(1000, relativeposX, relativeposY);
- }
- }
- else if(trnPlayer == PLAYER_CHROMEPLUGIN){
- var size = VXGMP_GetsizePlayer('vxgplayer1');
- relativeposX = Math.round((size.width) * curX / 100);
- relativeposY = Math.round((size.height) * curY / 80);
- // alert("relativeposX = " + relativeposX + "relativeposY = " + relativeposY + "curSizeX = " + curSizeX);
- if(curSizeX == 100){
- VXGMP_CustomDigitalZoom('vxgplayer1', 100, relativeposX, relativeposY);
- }
- else if(curSizeX == 90){
- VXGMP_CustomDigitalZoom('vxgplayer1', 111, relativeposX, relativeposY);
- }
- else if(curSizeX == 80){
- VXGMP_CustomDigitalZoom('vxgplayer1', 125, relativeposX, relativeposY);
- }
- else if(curSizeX == 70){
- VXGMP_CustomDigitalZoom('vxgplayer1', 143, relativeposX, relativeposY);
- }
- else if(curSizeX == 60){
- VXGMP_CustomDigitalZoom('vxgplayer1', 167, relativeposX, relativeposY);
- }
- else if(curSizeX == 50){
- VXGMP_CustomDigitalZoom('vxgplayer1', 200, relativeposX, relativeposY);
- }
- else if(curSizeX == 40){
- VXGMP_CustomDigitalZoom('vxgplayer1', 250, relativeposX, relativeposY);
- }
- else if(curSizeX == 30){
- VXGMP_CustomDigitalZoom('vxgplayer1', 333, relativeposX, relativeposY);
- }
- else if(curSizeX == 20){
- VXGMP_CustomDigitalZoom('vxgplayer1', 500, relativeposX, relativeposY);
- }
- else if(curSizeX == 10){
- VXGMP_CustomDigitalZoom('vxgplayer1', 1000, relativeposX, relativeposY);
- }
- }
- else if(trnPlayer == PLAYER_WEBSOCKET){
- var size = VXGWSMP_GetsizePlayer('vxgwsplayer1');
- relativeposX = Math.round((size.width) * curX / 100);
- relativeposY = Math.round((size.height) * curY / 80);
- // alert("relativeposX = " + relativeposX + "relativeposY = " + relativeposY + "curSizeX = " + curSizeX);
- if(curSizeX == 100){
- VXGWSMP_CustomDigitalZoom('vxgwsplayer1', 100, relativeposX, relativeposY);
- }
- else if(curSizeX == 90){
- VXGWSMP_CustomDigitalZoom('vxgwsplayer1', 111, relativeposX, relativeposY);
- }
- else if(curSizeX == 80){
- VXGWSMP_CustomDigitalZoom('vxgwsplayer1', 125, relativeposX, relativeposY);
- }
- else if(curSizeX == 70){
- VXGWSMP_CustomDigitalZoom('vxgwsplayer1', 143, relativeposX, relativeposY);
- }
- else if(curSizeX == 60){
- VXGWSMP_CustomDigitalZoom('vxgwsplayer1', 167, relativeposX, relativeposY);
- }
- else if(curSizeX == 50){
- VXGWSMP_CustomDigitalZoom('vxgwsplayer1', 200, relativeposX, relativeposY);
- }
- else if(curSizeX == 40){
- VXGWSMP_CustomDigitalZoom('vxgwsplayer1', 250, relativeposX, relativeposY);
- }
- else if(curSizeX == 30){
- VXGWSMP_CustomDigitalZoom('vxgwsplayer1', 333, relativeposX, relativeposY);
- }
- else if(curSizeX == 20){
- VXGWSMP_CustomDigitalZoom('vxgwsplayer1', 500, relativeposX, relativeposY);
- }
- else if(curSizeX == 10){
- VXGWSMP_CustomDigitalZoom('vxgwsplayer1', 1000, relativeposX, relativeposY);
- }
- }
- }
- }
- function onLayerSet( val )
- {
- onLayer = val;
- }
- function clickLayer()
- {
- clickX = window.event.offsetX; // Ŭ���� ��ġ ( ���� ���̾� �»�� ���� ��� ��ǥ )
- clickY = window.event.offsetY; // Ŭ���� ��ġ ( ���� ���̾� �»�� ���� ��� ��ǥ )
- clickMove ( clickX + curX, clickY + curY );
- SetDigitalZoom(0);
- }
- function clickTable()
- {
- if( onLayer )
- return;
-
- clickX = window.event.offsetX; // Ŭ���� ��ġ ( 100x100 ���̺� �»�� ���� ��� ��ǥ )
- clickY = window.event.offsetY; // Ŭ���� ��ġ ( 100x100 ���̺� �»�� ���� ��� ��ǥ )
- clickMove ( clickX, clickY );
- SetDigitalZoom(0);
- }
- function clickMove( x, y )
- {
- clickX = x; // Ŭ���� ��ġ ( 100x100 ���̺� �»�� ���� ��� ��ǥ )
- clickY = y; // Ŭ���� ��ġ ( 100x100 ���̺� �»�� ���� ��� ��ǥ )
- clickX = clickX - ( clickX % unitSizeX );
- clickY = clickY - ( clickY % unitSizeY );
- clickX = clickX - ( curSizeX / 2 );
- clickY = clickY - ( curSizeY / 2 );
- if( clickX < 0 )
- clickX = 0;
- if( clickY < 0 )
- clickY = 0;
- Move( clickX, clickY );
- }
|