Bonjour à tous...
J'utilise un picturebox qui est dans un Panel (Autosroll à true) pour faire affichier des images sélectionnée à partir d'uin listbox
Je veux faire un zoom (un qui s'éloigne (zoom out)et un autre qui s'approche (zoom In)).
J'ai réussi à faire cela pour un ordinateur de poche en compact framwork. Je n'y arrive pas en Framework normal...
Lorsuqe je zome in mon je vois que les scrollbar du panel se modifie mais mon image disparait et mon piucture box devient gris.
Je ne sais plus quoi faire...
Voici mon code.
Merci
'Variable déclaré lorsque l'.image se "load"
X_initial = PictureBox1.Width
Y_initial = PictureBox1.Height
<hr />
Private
Sub
btnZoomIn_Click(
ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
btnZoomIn.Click
Dim PB1Height
As
Integer, PB1Weight
As
Integer
PictureBox1.Height = Y_initial + 300
PictureBox1.Width = X_initial + 300
PB1Height = PictureBox1.Location.Y
PB1Weight = PictureBox1.Location.X
PictureBox1.Location =
New
Point(0, 0)
X_initial = PictureBox1.Width - 30
Y_initial = PictureBox1.Height - 30
Dim
objBitMap
As
New
Bitmap(X_initial, Y_initial)PictureBox1.Image =
New
System.Drawing.Bitmap(PictureBox1.Width, PictureBox1.Height)
Picturebox1_Graphics = System.Drawing.Graphics.FromImage(PictureBox1.Image)