I want to make it so that an image maintains its aspect ratio, and instead becomes cropped when the image box is resized. How can I do this?
If you want to preserve the original aspect of the sprite then tick the Preserve aspect in your Image.
If you want to crop the Image then Make a parent object with a RectMask2D then put your Image as a child of that object, add to your Image object an AspectRatioFitter and tweak it as you like.
If you want to add an image to your canvas which:
-
acts as a background,
-
maintains its aspect ratio,
-
and automatically scales to fit the game view’s width and height,
add new object with an Image component and with an Aspect Ratio Fitter component. Add the image to the source image, select Envelope Parent in the Aspect Mode and make it stretch horizontally and vertically in the Rect Transform component.

Alter the size in the Transform → Size section.
Also be careful with the gizmo you choose: the one with the three colour squares can resize aspect ratio if you drag the center square (yeah a fourth square).
The gizmo that puts blue spheres around the selection only crops everything.
