Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //some previous code
- this.pictureBox.Left = left;
- this.pictureBox.Top = top;
- this.AutoScroll = true;
- // add this line under:
- this.AutoScrollPosition = new Point(this.Width / 2, this.Height / 2);
- public ScalablePictureBox()
- {
- //some code ...
- this.pictureTracker.ScrollPictureEvent += new PictureTracker.ScrollPictureEventHandler(this.scalablePictureBoxImp.OnScrollPictureEvent);
- this.pictureTracker.PictureTrackerClosed += new PictureTracker.PictureTrackerClosedHandler(this.pictureTracker_PictureTrackerClosed);
- //Enter the line below to hook on event
- this.scalablePictureBoxImp.ZoomRateChangedEvent += ScalablePictureBoxImp_ZoomRateChangedEvent;
- }
- private void ScalablePictureBoxImp_ZoomRateChangedEvent(int zoomRate, bool isFullPictureShown)
- {
- this.scalablePictureBoxImp.AutoScrollPosition = new Point(this.Width / 2, this.Height / 2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement