Visual Basic image fade

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

cowplopmorris

Thread Starter
Joined
Jun 7, 2006
Messages
105
Hi,
I've seen bits of answers around on this topic, but am still quite lost. If anyone could point me in the right direction, that would be great.

Basically what I have is a Visual Basic Windows Forms project in Visual Studio 2008 with 2 PictureBoxes on top of one another and I want to be able to fade smoothly between them. At the moment I just have the top one have its visibility toggled, but is there any way to get them to fade?

Any pointers or suggestions would be much appreciated.

Thanks in advance.

Edit: I'm looking at using 2 forms, each with a picture box, and changing the opacity of one of them using the Opactiy property. However, it's quite jerky unless you want to do a very slow fade, since the minimum timer interval is 1ms. If there's a better solution, I'd still be interested.
 

Ent

Josiah
Retired Trusted Advisor
Joined
Apr 11, 2009
Messages
5,467
I understand that the best way is to manipulate the two images directly, having dimensioned both as images or arrays of pixels. The final picturebox contents is set to the result after all the fiddling is done. I've been messing around with the same thing, but can't work out how to avoid doing each pixel individually (which slows EVERYTHING down for large images.)
 

Ent

Josiah
Retired Trusted Advisor
Joined
Apr 11, 2009
Messages
5,467
Also, don't criticise a 1ms timer interval, which is 1000 fps. The problem is that the computer can't render the blend that fast, hence my need for a more efficient manipulation routine.
 

cowplopmorris

Thread Starter
Joined
Jun 7, 2006
Messages
105
I understand that the best way is to manipulate the two images directly, having dimensioned both as images or arrays of pixels. The final picturebox contents is set to the result after all the fiddling is done. I've been messing around with the same thing, but can't work out how to avoid doing each pixel individually (which slows EVERYTHING down for large images.)
Yeah. I've found a bit of info ColorMatrix and the like, so I'll take a deeper look into that. I will be using full screen images for this, so I'm not sure what to do about the doing each pixel individually part.

Ent said:
Also, don't criticise a 1ms timer interval, which is 1000 fps. The problem is that the computer can't render the blend that fast, hence my need for a more efficient manipulation routine.
I realised this a while after posting. After doing some calculations and adjusting of figures, it seems that indeed it isn't actually running the code every ms, as the computer can't keep up.
 

Ent

Josiah
Retired Trusted Advisor
Joined
Apr 11, 2009
Messages
5,467
I don't know whether you've sorted it out yet. I've managed to do this though, and figured I may as well share it. It's not polished (it actually seems to fade too quickly!) but I hope it'll help.
 

Attachments

cowplopmorris

Thread Starter
Joined
Jun 7, 2006
Messages
105
I don't know whether you've sorted it out yet. I've managed to do this though, and figured I may as well share it. It's not polished (it actually seems to fade too quickly!) but I hope it'll help.
That looks good! I'll have a play with it and see if I can use it.

I actually used another method. It was a bit of a bodge but worked. Basically a web browser object containing a simple web page with one function in, which used the proprietory MS filter. style.filter = "blendTrans(duration=0.7)"; etc. The app then passed it the next image url which it would display.

But thanks anyway, I'll take a look.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top