Hello, I have got the code below for making the scrollable PictureBox in C#. You can able to make use of it as per your use.
Code:
private void UserPictureBox_Paint(object provider, System.Windows.Forms.PaintEventArgs e)
{
Graphics gr = e.Graphics;
gr.FillRectangle(Brushes.White,this.CRect);
if (img != null)
{
gr.DrawImageUnscaled(img, -OffsetX, -OffsetY, img.Width, img.Height);
gr.FillRectangle(Brushes.Blue, CRect.Width - vscroll.Width, CRect.Height - hscroll.Height, vscroll.Width, hscroll.Height);
}
}
Bookmarks