Picturebox SizeMode property

G

Guest

i have a problem on placing an image inside a picturebox.
My problem is that i have a picturebox with the SizeMode property as "Zoom",
which i must have, but when i insert the image in the picturebox, the image
is aligned to the center of the picturebox, not the left. Does someone knows
how can i align an image, to the left of a picturebox with the SizeMode
property as "Zoom"?

My thanks in advanced

Ricardo Furtado
 
P

Phillip Taylor

i have a problem on placing an image inside a picturebox.
My problem is that i have a picturebox with the SizeMode property as "Zoom",
which i must have, but when i insert the image in the picturebox, the image
is aligned to the center of the picturebox, not the left. Does someone knows
how can i align an image, to the left of a picturebox with the SizeMode
property as "Zoom"?

My thanks in advanced

Ricardo Furtado

In Zoom mode the image IS always aligned to the left. The image is
shrunk and expanded as the bounds of the box are changed. Is the ratio
of the image your showing the same as the box itself? And are you sure
the image doesn't have a transparent border or something preventing it
from lining up with the top and left picture box?
 
G

Guest

first of all thank you for your answer
I can show you the image example that i temporary inserted in web server
http://www.game4tress.com/images/Example.png
As you can see, the picturebox has a border arround it and the image is
aligned at the center. This hapens with all images, not just this one.
But now that you say that, i'm thinking of something else because if you
notice the red dot at the top of the image, that dot is there because i draw
a point at position 0,0 so that is part of the image. But then, another
question arrises:
Once i know the image and the image does not have those pixels that are of
the same color as the form, how did the image gained more pixels with de Zoom
SizeMode? Is that possible? how can i only show the real image im Zoom mode?



Best Regards

Ricardo Furtado
 
G

Guest

I've solved the problem

once again thank you for your answer. I think i wouldn't solve the problem
if i didn't read your answer.
The solution is this:
In Zoom mode, the image is always aligned at the center. If the
picturebox.height is smaller than the picturebox.image.height, and the
picturebox.width is bigger than the picturebox.image.width then the
picturebox (which was the case) the picturebox aligns the image at the center
in horizontally but vertically the image occupies all of the picturebox
height. So all that is needed is to resize the picturebox.width.

Thank you very much

Best regards

Ricardo Furtado
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top