Cutting a detailed image

Great thank you,
Is there also a way to put a line (either a solid or a dashed line) around an image or text?