I have allow users to draw a rectangular area, and the code is as follows. I want to achieve the following two points: 1. If the image is not loaded, users cannot use the mouse to draw layers; 2. After loading the image, the user can only draw a rectangular area layer within the size range of the image, and during the drawing process, the mouse cannot exceed the size range of the image. Thanks.