Results 1 to 6 of 6

Thread: Images [Resolved]

  1. #1

    Thread Starter
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195

    Images [Resolved]

    I want to fade an image into a picture box.

    Basically make the picture box go from black to my image, in several seconds.

    Could someone please point me in the right durrection.

    I have no clue where to start

    Thanks
    Last edited by Hole-In-One; Mar 17th, 2004 at 12:48 PM.

  2. #2

    Thread Starter
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195
    Bump

  3. #3
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    Hi.

    The code might need a little cleaning up but you should get the idea.

    VB Code:
    1. Dim Img As Image = PictureBox1.Image.Clone
    2.         Dim G As Graphics = PictureBox2.CreateGraphics
    3.         Dim S As Single = 1
    4.  
    5.         Dim cm As New Imaging.ColorMatrix()
    6.         Dim attr As New Imaging.ImageAttributes()
    7.  
    8.         G.Clear(Color.Black)
    9.         Do While S >= 0
    10.             cm.Matrix00 = S 'Multiply the red color
    11.             cm.Matrix11 = S 'Multiply the green color
    12.             cm.Matrix22 = S 'Multiply the blue color
    13.  
    14.             attr.SetColorMatrix(cm)
    15.  
    16.             G.DrawImage(Img, New Rectangle(0, 0, Img.Width, Img.Height), 0, 0, Img.Width, Img.Height, GraphicsUnit.Pixel, attr)
    17.             Application.DoEvents()
    18.             S = S - 0.05
    19.         Loop
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

  4. #4

    Thread Starter
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195
    That works great!

    But How do I reverse it? (From Black to Picture "Fade In" the picture)

  5. #5

    Thread Starter
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195
    Nevermind I figured out!

    Thanks for the help

  6. #6
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    Anytime..
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width