I don't know if this will be helpful to you or not, but I would recommend separating your image manipulation from the rendering. Do all of your work on a bitmap object (which i'm sure you're already doing) and then clone it and assign the clone to render inside a regular old picturebox. The picturebox will take care of scrolling for you I believe.
Hmm, after re-reading this again, i think you may be trying to retain focus on a single point after the zoom. I do remember having some significant trouble with this using autoscroll. I'd suggest moving to a custom scroll bar solution, which is actually not as difficult as it would seem. It's really just a matter of setting Location coordinates of the image (I'd still use a picturebox) relative to the percent of scroll. Anyway, here's a little code that I just wrote (which may not work at all) which may help you when dealing with the scrollbars. The form I pasted this from is just one of my play projects, so bear with me as far as the variable names go. The vertical scrolling isn't quite right either. The scroll area is laid out such that there is a main panel. Inside that panel is another panel, docked right, with a vScrollBar inside it, docked fill, the panel has an 18 pixel DockPadding.Bottom. Also inside the main panel, is hScrollBar, docked bottom (18px tall). Also inside the main panel is another panel, docked fill. Inside that panel is an image, pictureBox2. NewImage is the method that is called when I am finished preparing an image. The xFactor and yFactor stuff should maintain the scroll position between images.
private void NewImage(Image image)
{
float xFactor = (float)image.Width / (float)this.pictureBox2.Image.Width;
float yFactor = (float)image.Height / (float)this.pictureBox2.Image.Height;
this.pictureBox2.Image = image;
this.pictureBox2.Size = this.pictureBox2.Image.Size;
this.vScrollBar1.Maximum = this.pictureBox2.Height;
this.vScrollBar1.Minimum = 0;
this.hScrollBar1.Maximum = this.pictureBox2.Width;
this.hScrollBar1.Minimum = 0;
this.vScrollBar1.Value = (int)((float)this.vScrollBar1.Value * yFactor);
this.hScrollBar1.Value = (int)((float)this.hScrollBar1.Value * xFactor);
this.vScrollBar1.SmallChange = 10; // totally random
this.hScrollBar1.SmallChange = 10; // totally random
this.vScrollBar1.LargeChange = this.vScrollBar1.Width;
this.hScrollBar1.LargeChange = this.hScrollBar1.Width;
SetPictureLocation();
}
private void SetPictureLocation()
{
this.pictureBox2.Left = -this.hScrollBar1.Value;
this.pictureBox2.Top = -this.vScrollBar1.Value;
}
private void hScrollBar1_Scroll(object sender, System.Windows.Forms.ScrollEventArgs e)
{
SetPictureLocation();
}
private void vScrollBar1_Scroll(object sender, System.Windows.Forms.ScrollEventArgs e)
{
SetPictureLocation();
}