Skip to content

feat: zoom the live camera view with the mouse wheel (#11322)#11325

Open
BenJule wants to merge 1 commit into
bambulab:masterfrom
BenJule:feat/11322-zoom-live-video
Open

feat: zoom the live camera view with the mouse wheel (#11322)#11325
BenJule wants to merge 1 commit into
bambulab:masterfrom
BenJule:feat/11322-zoom-live-video

Conversation

@BenJule

@BenJule BenJule commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #11322. The live camera view in the device tab couldn't be zoomed, unlike the pinch-zoom in Bambu Handy. This adds mouse-wheel digital zoom to the live view (1x fit up to 5x, centred on the view).

wxMediaCtrl3 already paints each decoded frame itself (wxPaintDC + DrawBitmap), so this is a client-side change: a zoom factor is applied on top of the existing contain-fit scale, and the image is re-centred (cropped to the window when zoomed in).

  • Scroll up to zoom in, down to zoom out; clamped to 1x–5x.
  • At 1x the rendering is mathematically identical to the previous letterboxed, centred output, so the default view is unchanged.

Implementation

  • wxMediaCtrl3.h: a double m_zoom member and a mouseWheelEvent handler.
  • wxMediaCtrl3.cpp: bind wxEVT_MOUSEWHEEL, adjust/clamp the zoom and Refresh(); the paint path multiplies the fit scale by the zoom and re-centres.

Test plan

  • Single self-contained control, no change to decoding or stream handling.
  • Verified by tracing the math that m_zoom == 1 reproduces the existing centring exactly (I don't have a GUI build here to capture a recording). A maintainer build is the way to confirm the feel; the step/limits (1.1x per notch, 1x–5x) are easy to tune if you'd prefer different values, and I can add cursor-anchored zoom instead of centre-anchored if that's preferred.

The device tab's live video could not be zoomed, unlike Bambu Handy. Add
mouse-wheel digital zoom (1x fit up to 5x, centred) to wxMediaCtrl3, which
already paints each decoded frame itself. The paint path now applies a zoom
factor on top of the existing contain-fit scale; at 1x the rendering is
identical to before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zoom Live Video

1 participant