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 287473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:43:44+00:00 2026-05-12T05:43:44+00:00

In windows when you click on an icon on your desktop, the icon darkens

  • 0

In windows when you click on an icon on your desktop, the icon darkens with a shade that is based on your windows theme that is currently used.

I have a custom control that displays an image. I would like to have the same functionality as the windows icon click. How do I obtain the same result in WinForms by selecting my custom control?

  • 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-12T05:43:44+00:00Added an answer on May 12, 2026 at 5:43 am

    Right now I’m using the following code… if anyone has something better, I’ll be glad to change it!

      private void drawAndShadeTheImage(Graphics g)
      {
         //if the image is null then there is nothing to do.
         if (Image != null)
         {
            Bitmap bitMap = new Bitmap(Image);
    
            //if this control is selected, shade the image to allow the user to
            //visual identify what is selected.
            if (ContainsFocus)
            {               
               //The delta is the percentage of change in color shading of 
               //the image.
               int delta = 70;
    
               //zero is the lowest value (0 - 255) that can be represented by
               //a color component.
               int zero = 0;
    
               //Get each pixel in the image and shade it.
               for (int y = 0; y < bitMap.Height; y++)
               {
                  for (int x = 0; x < bitMap.Width; x++)
                  {
                     Color oColor = bitMap.GetPixel(x, y);
    
                     //Lime is the background color on the image and should
                     //always be transparent, if this check is removed the
                     //background will be displayed.
                     if (oColor.ToArgb() != Color.Lime.ToArgb())
                     {
                        int oR = oColor.R - delta < zero ? zero : 
                           oColor.R - delta;
                        int oG = oColor.G - delta < zero ? zero : 
                           oColor.G - delta;
                        int oB = oColor.B - delta < zero ? zero : 
                           oColor.B - delta;
                        int oA = oColor.A - delta < zero ? zero : 
                           oColor.A - delta;
    
                        Color nColor = Color.FromArgb(oA, oR, oG, oB);
    
                        bitMap.SetPixel(x, y, nColor);
                     }
                  }
               }
            }
    
            //Make the background of the image transparent.
            bitMap.MakeTransparent();
    
            g.DrawImage(bitMap, this.ClientRectangle);            
         }
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using windows server, I have a path to a file that, when you click
I have a form created in Windows Forms which is draggable wherever I click.
I have two event handlers wired up to a button click in a Windows
I have a feature of my application which depends on alternate-click. Windows users don't
I have a Windows form app that I've published but the end result is
In windows, when you click the small icon in the upper left of the
I have a simple application. When you click a button, the tasbar icon changes.
I have a Qt application with a system tray icon and a menu that
I am trying to invoke an ANT target from Windows (right-click) file context menu.
Apparantly when users right-click in our WPF application, and they use the Windows Classic

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.