|
-
Sep 28th, 2001, 01:06 PM
#1
Thread Starter
Frenzied Member
DirectX Fading
Ok, i would like to know how you would fade things in and out with DirectX or something on a VB Form. Like, for instance you would click a command button and the picture would fade out and then you would click another command button and the picture would fade back in. What is the code for that? Can you use DirectX for that or should i use something else?
-
Sep 28th, 2001, 03:26 PM
#2
Fading basically involves interpolating one color value to another for each pixel in an image. For Fade to black, you just interpolate from original color->black. The algorithm for interpolation is:
Code:
let s equal a value from 0 to 1, where 0 equals the original value, and one is the destination value:
currVal = OriginalVal + s * (OriginalVal - DestVal)
Basically, loop through every pixel in an image, and get the pixel value. Retrieve each color component and run it through the equation above. Using VB, this is impossible to do in real-time.
Z.
[edit]
using VB, this is impossible, without DirectX, or other custom C++ DLL.
-
Sep 28th, 2001, 03:29 PM
#3
Thread Starter
Frenzied Member
Ok well what i really want to do is fade menus like if you click File. Just like Windows 2000 but i want to make it work on Windows 9x. I was wondering if i could use directx or some fading code that could do that.
-
Sep 29th, 2001, 10:19 PM
#4
Addicted Member
I was trying to do the same sort of thing a while back, but i couldent get it done.
You will need to use the AlphaBlend API function, i managed to get a form semi-transperent, but i could never get the menus to do anything for me.
Private Declare Function AlphaBlend Lib "msimg32.dll" (ByVal hdc As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal hdc As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal BLENDFUNCT As Long) As Long
-
Sep 29th, 2001, 10:26 PM
#5
Thread Starter
Frenzied Member
would any of this alphablending stuff be on MSDN online?
-
Sep 29th, 2001, 10:29 PM
#6
Addicted Member
probably, i remember looking it up their at one point
me and a few others on this board worked it out on this forum, if it keeps stuff from like, half a year ago, you should beable to find it ;o
-
Sep 29th, 2001, 11:10 PM
#7
Good Ol' Platypus
Heh its simple to do in VBScript on an HTML webpage you should try it.. If you want to see the effects I got with it visit the ToW thread in the discussion area, look for a nice pic
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|