Rubber band zoom

Dear Reader,
I am looking for way to implement a rubberband zoom function for a 2D
display. Unfortunately I have not found a solution.
Any suggestions ?

Thank you for your help

Regards

Marco