Hello All,

As the subject line say's, I would like to center graphics (pictures) in a picturebox control.

A) The pictureboxes border is fixed, creating a nice viewable frame.

B) I would like to center to fit large, small, and irregularly shaped pictures. Maintaining the aspect ratio of those pictures. An example of an irregularly shaped picture would be one that is taller than it is wide etc.....

I am able to display and center these types of pictures on a full sized screen (form), but unable to do so in a picturebox. I have tried the following:

Putting an imagebox on the picturebox and find that any image that is put in the image box is displayed on the form behind the picturebox.

Putting a second picturebox on the first one, the picture doesn't display within the first one. It kind of hovers above it, though it may be centering on the form, I'm not sure if this is the case though.

An imagebox set to stretch, distorts the irregularly shaped pictures. I can change the shape of the fixed imagebox so pictures are less or not distorted at all. This makes the GUI look terrible.

Does anyone have any ideas about what would work and allow me to do this? API calls might do it however I'm not sure how to proceed in doing that. Hmm... I've just recalled seeing something about placing pictures in rich textboxes some where, I'll look for that after I've posted this. If anyone has any ideas, suggestions, etc... I would appreciate it.


Thanks in advance.