A
nein, klappt eindeutig nicht. Ich habs jetzt mal simplerweise ins Paint-event mit rein genommen, da das ja jedesmal ausgeführt wird, wenn sich was ändert.
System::Void pictureBox1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {
Graphics ^gc = e->Graphics;
gc->Clear(SystemColors::ControlLight);
if (pictureBox1->Image != nullptr)
{
// Korrektur für möglicherweise eingeblendete Bildlaufleisten
int corrW = 0;
int corrH = 0;
if (vScrollBar1->Visible)
corrW = vScrollBar1->Width;
if (hScrollBar1->Visible)
corrH = hScrollBar1->Height;
pictureBox1->SizeMode = PictureBoxSizeMode::CenterImage;
gc->DrawImage(pictureBox1->Image,
Rectangle(0, 0,
pictureBox1->Right - corrW,
pictureBox1->Bottom - corrH),
Rectangle(hScrollBar1->Value, vScrollBar1->Value,
pictureBox1->Right - corrW,
pictureBox1->Bottom - corrH),
GraphicsUnit::Pixel);
}
}
also so klappt es z.b. nicht... da ändert sich nix weiter.