shaigem / BlazorPanzoom

Blazor wrapper for timmywil's panzoom library that helps make zooming and panning of Blazor components and elements easier
https://shaigem.github.io/BlazorPanzoom/
MIT License
44 stars 12 forks source link

Disable BlazorPanzoom in Blazor event #27

Open PmE8HW0KRfqa opened 4 months ago

PmE8HW0KRfqa commented 4 months ago

How can I enable/disable BlazorPanzoom (completely or only the wheelmouse events) in a Blazor onclick event?

I've tried

_panzoom.WheelMode = WheelMode.None;

** DO STUFF HERE

_panzoom.WheelMode = WheelMode.ZoomWithWheel;

But this has no effect.

albertliu63 commented 3 months ago

Hi, Have you solved this problem? I met similar issue. I need to get mousedown event to drawing box in canvas but seems blocked by panzoom element. My situation is :

<Panzoom @ref="_panzoomSrc_markup" WheelMode="WheelMode.ZoomWithWheel" > <div @ref="@context.ElementReference"> <Canvas @ref="srcCanvas_markup" id="opencvCanvas_markup" width="@imgWidth" height="@imgHeight" onmousemove="@HandleMouseMove" onmousedown="@HandleMouseDown" onmouseup="@HandleMouseUp">

        Your browser does not support the HTML5 canvas tag.
    </Canvas>
</div>

It seems the canvas can't do the mousedown event which is blocked by panzoom I guess. Is there way to swtich to annotation mode to select a bounding box for a note in the canvas image?