code: def ms_zoom(self, viewer, event, data_x, data_y, msg=True):
          
          if not self.canzoom:
              return True
          msg = self.settings.get('msg_zoom', msg)
  
          x, y = self.get_win_xy(viewer)
  
          if event.state == 'move':
              self._zoom_xy(viewer, x, y)
  
          elif event.state == 'down':
              if msg:
                  viewer.onscreen_message("Zoom (drag mouse L-R)",
                                          delay=1.0)
              self._start_x, self._start_y = x, y
  
          else:
              viewer.onscreen_message(None)
          return True
docs: Zoom the image by dragging the cursor left or right.