I used the following code in a VB.Net forms application:
Dim btnShowHideSize As New Size(30, 30)
btnShowHide.Size = btnShowHideSize
Dim img As New Bitmap(Resources.change2)
Dim img2 As New Bitmap(img, btnShowHideSize)
btnShowHide.BackgroundImage = img2
btnShowHide.BackgroundImageLayout = ImageLayout.Stretch
The image will expand, but not shrink. When I step through, I see that img size is 80,80 and img2 size is 30,30. Howewver, the image is not shrinking - it is getting cut off. If I go above 80,80 e.g. 200,200, the image does expand.
Is shrinking an image not possible?