javascriptpapaya

how to use pan tool in papaya viewer


Hi there I have tried to implement PAN Tool for papaya viewer but no luck, I came up with these two functions

papaya.viewer.Viewer.prototype.setCurrentPanLocation = function (xLoc, yLoc, sliceDirection) {

and papaya.viewer.Viewer.prototype.setStartPanLocation = function (xLoc, yLoc, sliceDirection) {

anyone help


Solution

  • After researching much detailed finally find this answer

    this.previousMousePosition.x = papaya.utilities.PlatformUtils.getMousePositionX(me);
    this.previousMousePosition.y = papaya.utilities.PlatformUtils.getMousePositionY(me);
                        //  this.setStartPanLocationNew(Cord1.x, Cord1.y, this.mainImage.sliceDirection);
                        
    this.setStartPanLocationNew(
                            this.convertScreenToImageCoordinateX(this.previousMousePosition.x, this.mainImage),
                            this.convertScreenToImageCoordinateY(this.previousMousePosition.y, this.mainImage),
                            this.mainImage.sliceDirection
                        );