VB.Net Zoomer dans un picturebox

cs_MagDix Messages postés 531 Date d'inscription lundi 5 juin 2006 Statut Membre Dernière intervention 6 octobre 2012 - 5 nov. 2008 à 13:39
cs_MagDix Messages postés 531 Date d'inscription lundi 5 juin 2006 Statut Membre Dernière intervention 6 octobre 2012 - 5 nov. 2008 à 15:11
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)

1 réponse

cs_MagDix Messages postés 531 Date d'inscription lundi 5 juin 2006 Statut Membre Dernière intervention 6 octobre 2012 1
5 nov. 2008 à 15:11
J'ai fini pas bcp d'essai erreur à trouver...

il me manquais cette ligne de code afin de reloader l'image
PictureBox1.Image = Image.FromFile(...)

merci quand même
0
Rejoignez-nous