codematrix
codematrix

Reputation: 1611

ScaleTransform and Image size

I have a Canvas which has an image as background. When I do the ScaleTransform to increase the size of the image, the image blows out of the Canvas. Although I increase the size, I don't want the image to go out of the Canvas, I just want it to fit inside the Canvas. How to fix this issue in WPF?

Upvotes: 0

Views: 526

Answers (1)

Brad Cunningham
Brad Cunningham

Reputation: 6501

Set ClipToBounds=True on the Canvas

Upvotes: 1

Related Questions