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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:45:56+00:00 2026-05-24T04:45:56+00:00

I have 3 pictures, each one has a colored circle in it. The 3

  • 0

I have 3 pictures, each one has a colored circle in it. The 3 pictures are red, green and yellow.

I’m putting it in a PictureBox in a windows form. I want to switch these images from green to yelow to red or otherwise.

Is there anything I can make them fade to each other instead of switching them the normal way?

I know this could be done using flash/j-query easily, but I was wondering how far I can achieve .

Something similar in windows forms using normal windows forms functionality.

Note: I’m using .net framework 4 and windows forms.

  • 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-24T04:45:57+00:00Added an answer on May 24, 2026 at 4:45 am

    See Transition of images in Windows Forms Picture box. There is a solution that transitions the images using a timer on this page.

    Code from site:

    public class BlendPanel : Panel 
    {
       private Image mImg1;
       private Image mImg2;
       private float mBlend;
       public BlendPanel()
       {
          SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint |
            ControlStyles.OptimizedDoubleBuffer, true);
       }
    
       public Image Image1 
       {
          get { return mImg1; }
          set { mImg1 = value; Invalidate(); }
       }
    
       public Image Image2 
       {
          get { return mImg2; }
          set { mImg2 = value; Invalidate(); }
       }
    
       public float Blend 
       {
          get { return mBlend; }
          set { mBlend = value; Invalidate(); }
       }
    
       protected override void OnPaint(PaintEventArgs e)
       {
          if (mImg1 == null || mImg2 == null)
          {
             e.Graphics.FillRectangle(new SolidBrush(this.BackColor), 
                new Rectangle(0, 0, this.Width, this.Height));
          }
          else
          {
             Rectangle rc = new Rectangle(0, 0, this.Width, this.Height);
             ColorMatrix cm = new ColorMatrix();
             ImageAttributes ia = new ImageAttributes();
             cm.Matrix33 = mBlend;
             ia.SetColorMatrix(cm);
             e.Graphics.DrawImage(mImg2, rc, 0, 0, mImg2.Width, 
                mImg2.Height, GraphicsUnit.Pixel, ia);
             cm.Matrix33 = 1F - mBlend;
             ia.SetColorMatrix(cm);
             e.Graphics.DrawImage(mImg1, rc, 0, 0, mImg1.Width, 
                mImg1.Height, GraphicsUnit.Pixel, ia);
          }
          base.OnPaint(e);
       }
    }
    

    Build your project. You can now drop a BlendPanel from the top of the toolbox onto your form. Here’s a sample program that uses it:

    namespace WindowsApplication1 
    {
       public partial class Form1 : Form
       {
          private float mBlend;
          private int mDir = 1;
          public Form1()
          {
             InitializeComponent();
             timer1.Interval = 30;
             timer1.Tick += BlendTick;
             blendPanel1.Image1 = Bitmap.FromFile(@"c:\temp\test1.bmp");
             blendPanel1.Image2 = Bitmap.FromFile(@"c:\temp\test2.bmp");
             timer1.Enabled = true;
          }
    
          private void BlendTick(object sender, EventArgs e)
          {
             mBlend += mDir * 0.02F;
             if (mBlend < 0) { mBlend = 0; mDir = 1; }
             if (mBlend > 1) { mBlend = 1; mDir = -1; }
             blendPanel1.Blend = mBlend;
          }
       }
    }
    

    You’ll need to modify the Bitmap.FromFile() calls. Build and run. You should see the displayed image smoothly morph from your first image to your second image without any flickering. Lots of ways to tweak the code, have fun.

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

Sidebar

Related Questions

I have embedded 3 'TABS' on top of a form. Each tab has a
User has pets , pets may have pictures One picture may be set as
I have this problem: $id is id for each user $img = 'http://www.somesite.com/pictures/'; $no_img
So i have a picture gallery with eight categories. Each category has 400+ images,
I have a few pictures for a product and I want the user to
I have scanned a set of about 100 printed photographs, giving each one a
I have a form that has two views. These views are controlled by radio
I have a ListView where each row has two webviews side by side, taking
I have a ListView, and I want to customize the layout of each item
I have a page which lists several messages, and each of these messages has

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.