Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

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 post
Share on other sites
17 minutes ago, Dobbsjr said:

Are you using WinForms or WPF? 

forgot to mention. im using winforms

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 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 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 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 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 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 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 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 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 post
Share on other sites
On 8/2/2017 at 9:53 AM, 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 not exactly true. It's really easy to get started in WPF. You slap down what you want in a WYSIWYG editor and call it a day. You don't need to care if your generated xaml is messy. The barrier to entry here is so low that you can't argue that complexity is a reason not to use it.

The benefit is that once you learn how xaml all works together with your code, you have the tools to satisfy your needs. I'm going to have to side with Nuluvius here, Winforms offers no significant advantage and you're handicapping yourself by continuing to use it. No one in the industry uses it except if you're maintaining legacy forms or something of that nature that haven't yet been redone in WPF.
 

On 8/2/2017 at 3:51 PM, DXMember said:

try dynamic opacity in a loop in a new thread


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

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 post
Share on other sites
6 hours ago, DXMember said:

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

Multi-threading is so difficult to implement well even when I'm designing a system I ask myself if it's really necessary, just to make sure.

 

System complexity should only ever be increased if it's the lowest hanging fruit. This includes using different technologies as another option.

 

---

OP, I hope you reconsider the development of your application. The willingness to adapt to new technologies is a good trait in a developer, and an over-reliance on the familiar can make you outdated. Even programming in old systems with old languages continually requires using modern techniques and integration with modern systems.

This is especially important when you're designing new to pick the best tool for the job. You'd think I wouldn't need to point this out, but using your limited time on a class that you're going to pass anyway is a waste; this is better spent learning technologies you may end up benefiting from from a job for the next 5-10 years or however long WPF is going to last. In my opinion it's going to last a while because it's simply a highly reliable, scalable, and powerful technology that only has potential to spread to other platforms. It wouldn't be unsurprising if XAML becomes the standard format for forms in many other languages (and some developers are intent on doing just that).

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

×