Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6330895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:57:14+00:00 2026-05-24T17:57:14+00:00

I have 1 picturebox and 1 VScrollbar ( vertical scrollbar ). When i change

  • 0

I have 1 picturebox and 1 “VScrollbar” ( vertical scrollbar ).
When i change the value of the scrollbar i want to get a picture from my folder in disk and show the image in the picturebox. I only want to show 1 picture a time.

It works but it is “laggy” because everytime i scroll, i get the index of the scroll, get the file from my folder ( depending on the index of the scroll ) and then making a bitmap and binding it to the picturebox.

private void ScreenBarScroller_ValueChanged(object sender, EventArgs e)
{
    int scrollValue = 
        ScreenBarScroller.Value == 0 ? 0 : ScreenBarScroller.Value - 1;

    ScreenClass currentScreen = ScreenList[scrollValue];

    using (Bitmap newPicture = new Bitmap(
                               new FileStream(currentScreen.Path,
                               FileMode.Open, FileAccess.ReadWrite, 
                           FileShare.Delete | FileShare.ReadWrite)))
    {
            pictureBox1.Image = 
               ResizeBitmap(newPicture, pictureBox1.Width, pictureBox1.Height);
    }
}

The code works but its so damn laggy , i want the “smooth” scrolling . How can i do that? Is there a better way to do this then VScrollbar?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T17:57:15+00:00Added an answer on May 24, 2026 at 5:57 pm

    One of possible solutions can be load also images in the range of, let’s say, next 5 images in background thread. So at the moment user goes to the next image it’s already loaded or at least in loading.

    Another solution can be use memory mapping on your bitmaps which will invrease performanse of reading from disk.

    Can also merge these 2 solutions.

    EDIT

    Important is, by me, if these are big enough images, to load them in another thread and notify to the user via message on UI that image is in loading, so you will give sence of responsivness to your app. There is nothing worse for UX to leave user without a clue what is going on now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have picturebox with picture cb. PBr1_1.Image = new Bitmap(@Logos\\Images\\cb.png); I'd like to change
I have a PictureBox control I want to display an image in it. I
I have a GUI window form. I want to set image to pictureBox and
I have PictureBox picture . I use: picture.Size = bmp.Size; picture.Image = bmp; Let's
I have a PictureBox and when I change the image for some reason the
I have a control (picturebox), in which I want to draw an 2D image
I have an image in a PictureBox, and I want to print it. No
I have a picturebox which displays an image of a music note. I want
I have a PictureBox on my Windows Forms application. I load a picture in
i have this code to show in a panel images with a pIctureBox :

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.