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

  • SEARCH
  • Home
  • 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 6772375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:32:31+00:00 2026-05-26T15:32:31+00:00

I am trying to apply brightness/contrast on a image using track bar, since applying

  • 0

I am trying to apply brightness/contrast on a image using track bar, since applying on image taking long time. When track bar is scrolled, it’s not smooth, it’s getting lagged on my form. Here is my code,is this right method for separating out worker thread from UI (there is no improvement in user experience though)?

    private void bright_tbr_ValueChanged(object sender, EventArgs e)
    {
        brightness = bright_tbr.Value;
        contrast = contrast_tbr.Value;
        toolTip1.SetToolTip(bright_tbr, brightness.ToString());
        Thread thread = new Thread(new ThreadStart(applyBandC));
        thread.IsBackground = true;
        thread.Start();

    }
     private void applyBandC()
    {
        this.Invoke((MethodInvoker)delegate()
                {
                    lock (this)
                    {
                        create_pixmap(brightness, contrast, 0, 0, 255, 255);
                        Bitmap bmp1 = new Bitmap(bmp);
                        BitmapData data1 = bmp1.LockBits(new Rectangle(0, 0,                                                bmp1.Width, bmp1.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
                        MapLUT(bmp1.Height, bmp1.Width, data1.Scan0);
                        bmp1.UnlockBits(data1);
                        pictureBox2.Image = bmp1;
                    }
                }
    );

    }
  • 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-26T15:32:32+00:00Added an answer on May 26, 2026 at 3:32 pm

    Your solution doesn’t improve the user experience because your entire “multithreaded” code is wrapped in this.Invoke! The purpose of Invoke is to execute a delegate on the UI thread. Move all your processing code except for the pictureBox2.Image = bmp1; part out of the delegate passed to this.Invoke and it should work properly.

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

Sidebar

Related Questions

I am trying to apply effect (sepia, brightness, bloom and other image effects if
I am trying to apply a scale animation to a rectangle, using code not
I am trying to apply some transformations on images using a CGContextRef. I am
I am trying to apply a method to an existing object which involves using
I'm trying to apply different texture on cube with shaders using samplerCube and textureCube.
I'm trying to apply cursor to my app, however, the document is not clear
I am trying to apply a thirdparty LAF to a NetBeans RCP application (not
I'm trying to apply texture to a sprite using opengl as follows: int[] textures=new
I'm trying to apply the simplified algorithm in Prolog, but I'm not a Prolog
im trying to apply text wrap to td (table data) using: .gvUpdatesStyle .updateSummary {width:200px;

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.