I have a picturebox with a tiled background image (plane white bitmap), and an “image” resource centered in the middle of it, I would like to chance the size of this centered image within the picturebox.
I tried:
picScaledRepresentation.SizeMode = PictureBoxSizeMode.CenterImage
picScaledRepresentation.Size = New Size(Width, Height)
But this just changed the the size of the whole picturebox, rather than the image within it.
Thanks, have a good day
The
CenterImageoption does not allow for scaling etc. Take a look at thePictureBoxSizeModeEnumeration: http://msdn.microsoft.com/en-us/library/system.windows.forms.pictureboxsizemode.aspx .You probably want
StretchImage,AutoSize, orZoom