Fade to Black? 
Author Message
 Fade to Black?

Does anyone know how to fade an image to black using VB4 ? Such as with a
splash screen that displays a BMP then fades away?  

Thanks in advance for any ideas

Wayne




Thu, 18 Feb 1999 03:00:00 GMT  
 Fade to Black?


Quote:
>Does anyone know how to fade an image to black using VB4 ? Such as with a
>splash screen that displays a BMP then fades away?  

   Dim x As Long

   For x = 0 To Picture1.Height
      Picture1.Line (0, x)-(Picture1.Width, x), 0
   Next x

Rainer

------------------------------------------------------



Fri, 19 Feb 1999 03:00:00 GMT  
 Fade to Black?


Quote:
>    For x = 0 To Picture1.Height
>       Picture1.Line (0, x)-(Picture1.Width, x), 0
>    Next x

Is this what people mean by "fading"? I thought it meant a slow decrease in
an image's readablilty, and it would require something other than VB code
to do quickly.

--
VB Info: http://home.sn.no/~balchen/vb/visual.htm
FAQ: http://home.sn.no/~balchen/vb/faq.htm
Knowledge Base: http://home.sn.no/~balchen/vb/kb.htm



Fri, 19 Feb 1999 03:00:00 GMT  
 Fade to Black?


"BSC> Does anyone know how to fade an image to black using VB4 ? Such as with
"BSC> a splash screen that displays a BMP then fades away?

Cause you don't use direct DOS, you should make an animation (FLI, FLC).  
Everything else is very hard to do, perhaps random black points has a  
similar effect???

Bertram



Fri, 19 Feb 1999 03:00:00 GMT  
 Fade to Black?

I would agree with you Jen.  My method is to paint pixels until
the image fades away.  This is not fast in VB.  I wrote just
such a program to paint the light bulbs on a Christmas tree for
a greeting card so they would appear as blinking bulbs.  VB was
slow to say the least, but it proved okay for the need for
something to a friend.

Bruce Murphy

Quote:
>==========Jens Balchen Jr., 9/2/96==========


>>    For x = 0 To Picture1.Height
>>       Picture1.Line (0, x)-(Picture1.Width, x), 0
>>    Next x

>Is this what people mean by "fading"? I thought it meant a slow
>decrease in
>an image's readablilty, and it would require something other
than VB code
>to do quickly.

>--
>VB Info: http://home.sn.no/~balchen/vb/visual.htm
>FAQ: http://home.sn.no/~balchen/vb/faq.htm
>Knowledge Base: http://home.sn.no/~balchen/vb/kb.htm



Sun, 21 Feb 1999 03:00:00 GMT  
 Fade to Black?


Quote:
> Does anyone know how to fade an image to black using VB4 ? Such as with a
> splash screen that displays a BMP then fades away?  

> Thanks in advance for any ideas

What I would do is make a control array of graphic boxes or picture boxes, and fill each one up
with a slightly
darker copy of the orginal image until the image is black.  Then i would display each one
individually based on a timer loaded up on the form.  Another option is to use the animate(?)
control that comes with VB 3.0 professional (I can't remember the name of the object)


Sun, 21 Feb 1999 03:00:00 GMT  
 Fade to Black?



Quote:

> "BSC> Does anyone know how to fade an image to black using VB4 ? Such as with
> "BSC> a splash screen that displays a BMP then fades away?
> Cause you don't use direct DOS, you should make an animation (FLI,

FLC).  > Everything else is very hard to do, perhaps random black
points has a  

Quote:
> similar effect???

Maybe:

create a transparent bitmap of a sparse grid of black dots, as a mask;
successively overlay this onto the picture, at slightly different
positions ?

Steve.



Sun, 21 Feb 1999 03:00:00 GMT  
 Fade to Black?


Quote:
> Is this what people mean by "fading"? I thought it meant a slow decrease in
> an image's readablilty, and it would require something other than VB code
> to do quickly.

Just thought of something: Fading is i.e. making the picture darker and
darker, right? Is it possible to alter the palette in any way, to make all
colours look darker?

--
VB Info: http://home.sn.no/~balchen/vb/visual.htm
FAQ: http://home.sn.no/~balchen/vb/faq.htm
Knowledge Base: http://home.sn.no/~balchen/vb/kb.htm



Mon, 22 Feb 1999 03:00:00 GMT  
 Fade to Black?

Quote:
> "BSC> Does anyone know how to fade an image to black using VB4 ? Such as with
> "BSC> a splash screen that displays a BMP then fades away?

I wonder why no one bothered to mention that the bitmaps palette has a byte for
red, a byte for green, a byte for blue, and a byte for transparency! (Commonly
called Alpha Channel)

To fade to black the programmer would overlay the splash screen with a black
bitmap that is transparent.  Slowly increaseing the opaque-ness will give the
appearence of fading to black.

By "fade away" do you mean to fade into the background?  This also could be done
using the same byte.

REF: Visual Basic Power Tool Kit   Ventana Press      ISBN 1-56604-190-2
     See page 273 for details



Tue, 23 Feb 1999 03:00:00 GMT  
 Fade to Black?

Quote:

>I would agree with you Jen.  My method is to paint pixels until
>the image fades away.  This is not fast in VB.  I wrote just
>such a program to paint the light bulbs on a Christmas tree for
>a greeting card so they would appear as blinking bulbs.  VB was
>slow to say the least, but it proved okay for the need for
>something to a friend.
>Bruce Murphy
>>==========Jens Balchen Jr., 9/2/96==========


>>>    For x = 0 To Picture1.Height
>>>       Picture1.Line (0, x)-(Picture1.Width, x), 0
>>>    Next x

>>Is this what people mean by "fading"? I thought it meant a slow
>>decrease in
>>an image's readablilty, and it would require something other
>than VB code
>>to do quickly.

If you are interested in fading one picture into another you could try
looking at the book Graphics Gems.  In their frame buffer section they
have an explanation of a "Digital Dissolve Effect" by Mike Morton.
The paper describes a method of getting a nonrepeating sequence that
is large enough to use as the coordinates that you change to black.
In the edition that I have it is on page 221.

Its very interesting and should provide a pseudorandom nonrepeating
dissolve or fade that could fade a whole screen in about three seconds
if written in C.

Enjoy.



Wed, 24 Feb 1999 03:00:00 GMT  
 Fade to Black?


Quote:
>Does anyone know how to fade an image to black using VB4 ? Such as with a
>splash screen that displays a BMP then fades away?  

The best method therefore I know is the following (It worked in VB3.0)

Make another (invisible) picture box.
Make a loop that changes the backcolor of that picturebox from white
to black. Probably RGB(i, i, i) is best. Put a Bitblt function call in
the loop. With this function you AND the splash screen and the other
picturebox. The (VB3.0) code would be  like this:

    picture2.Width = picture1.Width
    picture2.Height = picture1.Height
    For i% = 255 To 0 Step -5
        kleur& = RGB(i%, i%, i%)
        picture2.BackColor = kleur&
        h = BitBlt(picture1.hDC, 0, 0, picture1.ScaleWidth,
picture1.ScaleHeight, picture2.hDC, 0, 0, SRCAND)
        DoEvents
    Next i%

Hope this works. Another person couldn.t get this code working in
VB4.0

Matthijs Sypkens Smit



Wed, 24 Feb 1999 03:00:00 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Fade to Black

2. Fade into black

3. Fade To black?

4. Help: Resized picture fades to black !!

5. HELP! Fade To Black...

6. Fading Blue to Black

7. Fading picture/image colors from black to color

8. Real Fade-in and Fade-out

9. Fade-in and Fade-out of button controls

10. Fade in and Fade out images???

11. Fade-in, Fade-out images???

12. Fade-in, Fade-out effect

 

 
Powered by phpBB® Forum Software