Jump to content

Are there any Fade in/ Fade out effects for pictureboxes in C#?

i have gone through the internet a lot, but i have failed to find any solution for this. after 5 seconds i want to fade out a image. how can i achieve this?

Link to comment
Share on other sites

Link to post
Share on other sites

17 minutes ago, Dobbsjr said:

Are you using WinForms or WPF? 

forgot to mention. im using winforms

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Shammikit said:

forgot to mention. im using winforms

WinForms doesn't have any support for animations, it's usually better to use WPF if you want to have animations or such thing as it provide animation classes and smooth animating objects. Anyways, you'll have to make your own function in WinForms for fading. You could use a Color Matrix, like in this example from MSDN, with a timer.  

Did my post help you? Then make sure to rate it!

Check out my post on symbolic links! || PSU ranking and tiers || Pokemon Thread

 

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, Shammikit said:

forgot to mention. im using winforms

You are just not listening to the advice that's already been given to you countless times already. You are messing around in a deprecating technology that was simply never really equipped to support all of this kind of stuff without significant work; work that is completely pointless given that:

  1. WinForms is deprecating
  2. There are already newer technologies that do support this sort of thing such as WPF

Continually making new threads asking the same kind of questions will not inspire people to tell you anything different!

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Nuluvius said:

You are just not listening to the advice that's already been given to you countless times already. You are messing around in a deprecating technology that was simply never really equipped to support all of this kind of stuff without significant work; work that is completely pointless given that:

  1. WinForms is deprecating
  2. There are already newer technologies that do support this sort of thing such as WPF

Continually making new threads asking the same kind of questions will not inspire people to tell you anything different!

While everything you said is true, WinForms still has it's advantages. It's faster and easier for beginners to learn. Maybe he just needs to hack something together quick. I'm not trying to start an argument about WinForms vs WPF, nor do I disagree with your post. Just wanted to point that out. :) 

Did my post help you? Then make sure to rate it!

Check out my post on symbolic links! || PSU ranking and tiers || Pokemon Thread

 

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, Nuluvius said:

You are just not listening to the advice that's already been given to you countless times already. You are messing around in a deprecating technology that was simply never really equipped to support all of this kind of stuff without significant work; work that is completely pointless given that:

  1. WinForms is deprecating
  2. There are already newer technologies that do support this sort of thing such as WPF

Continually making new threads asking the same kind of questions will not inspire people to tell you anything different!

im sorry but i have only been taught about winforms. thats why im messing around trying to get myself prepared for the tests thats coming at the end of the year.

Link to comment
Share on other sites

Link to post
Share on other sites

Once again, go WPF, please. I cannot bear the thought that you are using WinForms :D I swear, if you have any problems with WPF, I'll help you with it, but just leave WinForms for business applications with no creativity.

Try, fail, learn, repeat...

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, Dobbsjr said:

While everything you said is true, WinForms still has it's advantages. It's faster and easier for beginners to learn. Maybe he just needs to hack something together quick. I'm not trying to start an argument about WinForms vs WPF, nor do I disagree with your post. Just wanted to point that out. :) 

That's fine if you'd like to dress it up that way but I'd still be well inclined to maintain that it's a piss poor excuse in general. Be that a failing of effort or ability on the part of the individual or (and what has historically been the case) a failing on the part of academia to keep up with and promote current industry relevant technologies and best practices.

 

No I'm afraid that you'll not find me so forgiving.

2 hours ago, zwirek2201 said:

Once again, go WPF, please.

Indeed.

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, Shammikit said:

im sorry but i have only been taught about winforms. thats why im messing around trying to get myself prepared for the tests thats coming at the end of the year.

Sounds like this is for school, in which case he doesn't have a choice and has to use WinForms.

 

6 hours ago, Shammikit said:

i have gone through the internet a lot, but i have failed to find any solution for this. after 5 seconds i want to fade out a image. how can i achieve this?

Here's an example that shows you how you can fade an image in a picturebox

 

StackOverflow: Fading out an image with transparency in WinForms UI (.NET3.5)

Link to comment
Share on other sites

Link to post
Share on other sites

6 hours ago, Shammikit said:

forgot to mention. im using winforms

try dynamic opacity in a loop in a new thread

CPU: Intel i7 5820K @ 4.20 GHz | MotherboardMSI X99S SLI PLUS | RAM: Corsair LPX 16GB DDR4 @ 2666MHz | GPU: Sapphire R9 Fury (x2 CrossFire)
Storage: Samsung 950Pro 512GB // OCZ Vector150 240GB // Seagate 1TB | PSU: Seasonic 1050 Snow Silent | Case: NZXT H440 | Cooling: Nepton 240M
FireStrike // Extreme // Ultra // 8K // 16K

 

Link to comment
Share on other sites

Link to post
Share on other sites

On 02/08/2017 at 8:37 PM, madknight3 said:

Sounds like this is for school, in which case he doesn't have a choice and has to use WinForms.

As one ascends the academic echelons there's supposed to be a degree of freedom and Independence permitted and even encouraged. Though it's entirely up to the individual to capitalise upon the opportunity. Therefore I still find this to be a rather weak supposition.

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

10 hours ago, Erik Sieghart said:

I don't like this idea at all. You shouldn't need multi-threading for the sake of an animation.

you might not need it for animation, but it's a good enough reason to start learning how to do threading

CPU: Intel i7 5820K @ 4.20 GHz | MotherboardMSI X99S SLI PLUS | RAM: Corsair LPX 16GB DDR4 @ 2666MHz | GPU: Sapphire R9 Fury (x2 CrossFire)
Storage: Samsung 950Pro 512GB // OCZ Vector150 240GB // Seagate 1TB | PSU: Seasonic 1050 Snow Silent | Case: NZXT H440 | Cooling: Nepton 240M
FireStrike // Extreme // Ultra // 8K // 16K

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×