Hi,
Es gibt die Möglichkeit die gesammte PictureBox zu vergrößern.
Bei VergrößerungsButton:
Size X = new
Size(picbox.Width += 10 ,picbox.Height += 10 );
Bitmap n= new
Bitmap (picbox.Image ,X);
picbox.Image = new
Bitmap("//Pfad der File"
);
Bei VerkleinerungsButton:
try
{
Size X = new
Size(picbox.Width -= 10, picbox.Height -= 10);
Bitmap n = new
Bitmap(picbox.Image, X);
picbox.Image = new
Bitmap("//Pfad der Image"
);
}
finally
{ }
Der Nachteil ist, dass die PB irgendwann größer ist als das Fenster und man nur noch den oberen Teil sieht.
Die Lösung:
Buttons zum Verschieben der PB
nach rechts:
int
X = picbox.Location.X;
int
Y = picbox.Location.Y;
X += 20;
picbox.Location = new
Point(X, Y);
nach links:
try
{
int X = picbox.Location.X;
int Y = picbox.Location.Y;
X -= 20;
picbox.Location = new Point(X, Y);
}
finally { }
nach oben:
try
{
int X = picbox.Location.X;
int Y = picbox.Location.Y;
Y -= 20;
picbox.Location = new Point(X, Y);
}
finally { }
nach unten:
try
{
int
X = picbox.Location.X;
int
Y = picbox.Location.Y;<br/>
Y -= 20;
picbox.Location = new
Point(X, Y);
}
finally
{ }