How to position a JPEG with the mouse?

  • Hello,

    I know the commands:

    COMPDF_GetViewPage
    COMPDF_GetPageWidth
    COMPDF_GetPageHeight
    COMPDF_GetPageRotation
    COMPDF_GetYPos
    COMPDF_GetXPos
    COMPDF_GetWidth
    COMPDF_GetHeight
    COMPDF_GetPageUnderMouse
    COMPDF_Zoom

    from onMouseMove I have the X and Y of the mouse position.

    How can I calculate the values for the UseImage call to position the JPEG exactly at the point the mouse was positioned last?

    A related question: How can I activate the onMouseDown and onMouseUp events?

    Regards
    Gerhard

    • Offizieller Beitrag

    There also the commands

    COMPDF_IGNOREMOUSE = 2004; // Use this command in MouseDown, MouseUp, MouseDown to let the viewer stop
    // processing the event further (similar to .Handled)
    COMPDF_GETMOUSE_X = 2005; // Read mouse X position in MouseMove event (72 dpi on page)
    COMPDF_GETMOUSE_Y = 2006; // Read mouse Y position in MouseMove event
    COMPDF_GETMOUSE_PAGE = 2007; // Read mouse page number

    which can be used inside the mouse events.