Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Vb Animation

Options
  • 10-02-2003 7:00pm
    #1
    Registered Users Posts: 446 ✭✭


    Anyone know where I can get a tutorial on animating images in VB?


Comments

  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    Isnt one of the sample apps which ships with VB about exactly this?

    jc


  • Closed Accounts Posts: 9,314 ✭✭✭Talliesin


    Can you be a bit more detailed about exactly what you mean?
    There are a few different ways to do animation in VB. The easiest is sticking in an AVI control and an AVI file, the trickiest involves hacking around with DirectDraw API.
    As such there are about 50 different answers that are correct but not what you are looking for! What do you have in mind?


  • Registered Users Posts: 446 ✭✭kegan5


    I just want something like an image becoming larger so that it appears like its moving towards the user, that type of thing nothing too Ott.
    Thanks.


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    STFW!!!

    FFS! ARE YOU LAZY OR JUST DUMB?


  • Registered Users Posts: 446 ✭✭kegan5


    Wow your really polite aren't ya?


  • Advertisement
  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Look, I'm going to assume that you're and adult and take the gloves off.

    Your question was one that could be answered with a ridiculously simple search on Google. Even Talliesin gave you the benefit of the doubt and assumed that you must have omitted something in your original post to make your problem more complex.

    No. You wanted spoon-feeding. It was a simple case of a ridiculously simple search on Google, after all. Thus, the only two logical conclusions I can come up with are that you are:
    1. Lazy to the point that if you could get away with it you’d get an Iron lung to do all your breathing for you, or
    2. so stupid that you should probably not be encouraged to breed.
    Either way, you can either decide to get off your arse and make even a limited attempt to answer your own questions before blubbering over to us for help or take up a different profession, preferably that does not require the ability to chew gum and walk simultaneously as a prerequisite.

    So you’ll excuse me if I hence appear rude, but either you’re in need of a metaphorical slap to wake you up, or my behaviour towards you should be treated as appropriate as we’re, strictly speaking, not of the same species.


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Originally posted by RicardoSmith
    kegan5 - don't bother with this forum its full of bottom feeders who talk a lot but say little.
    LOL. Pot. Kettle. Black.


  • Closed Accounts Posts: 9,314 ✭✭✭Talliesin


    Right. I'm hardly known suffering fools gladly. I dislike people asking questions they should be able to answer for themselves, for both their sake and my own, and I despise people who try to use this board in an attempt to obtain a programming or CS qualification without actually obtaining any programming or CS experience.

    But kegan5's question isn't something that is easy to STFW for, she doesn't have a clear idea of exactly what she wants to do, which makes STFW as likely to find something that will lead her along the wrong track.

    Hence the new STFW Rule.
    don't bother with this forum its full of bottom feeders who talk a lot but say little.
    Don't worry Ricardo, it looks like you're beginning to fit in.


  • Closed Accounts Posts: 9,314 ✭✭✭Talliesin


    Originally posted by kegan5
    I just want something like an image becoming larger so that it appears like its moving towards the user, that type of thing nothing too Ott.
    Thanks.

    Here's something to start experimenting with.

    Create a new EXE project, place a Shape and a Timer on the form it begins with. Leave their names and properties for now. Paste the following into the code of the Form:
    Option Explicit
    
    Const RATE As Long = 40 '25 a second, enough for phi-effect.
    'Constants for centre of shape
    Const SHAPE_CENT_X As Long = 600
    Const SHAPE_CENT_Y As Long = 800
    'Constant for size change.
    Const DELTA_SIZE As Long = 20
    
    Private Sub Form_Load()
        With Shape1
            .BackColor = vbRed
            .BorderColor = vbBlack
            .BackStyle = 1
            .Shape = 0
        End With
        With Timer1
            .Interval = RATE
            .Enabled = True
        End With
    End Sub
    
    Private Sub Timer1_Timer()
        'Statics for Size and direction of change
        Static lSize As Long
        Static boShrinking As Boolean
        lSize = lSize + IIf(boShrinking, -DELTA_SIZE, DELTA_SIZE)
        Select Case lSize
            Case 0
                boShrinking = False
            Case 1200
                boShrinking = True
        End Select
        'The following call takes singles. However
        'We used Longs for the aritmetic as 32-bit integer aritmetic
        'is considerably faster.
        Shape1.Move SHAPE_CENT_X - lSize \ 2, SHAPE_CENT_Y - lSize \ 2, lSize, lSize
    End Sub
    
    

    Next run it.
    Next step through the code and see what it's doing and how it works.
    Next change the values of the constants. Understand how the affect what is going on.
    Next experiment with the AutoRedraw property of the Form.

    Next change the code so that it uses an image, and doesn't have to be square, but can have a rectangle of different proportions.

    Finally, work out a completely different way of doing roughly the same thing.


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Originally posted by Talliesin
    But kegan5's question isn't something that is easy to STFW for, she doesn't have a clear idea of exactly what she wants to do, which makes STFW as likely to find something that will lead her along the wrong track.
    With respects, it doesn't get more simple than this, where in the first few links returned there are already a number of tutorials that would be directly applicable to what she is seeking.

    As for the wrong path, I would agree with you, had the solution sought been more specific, but it was not. It's too generic to for someone to go down a wrong path.

    I may have come across a wee bit harsh on the girl, but tbh, it's long past September and so she really should know better by now.


  • Advertisement
  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Originally posted by Talliesin
    Here's something to start experimenting with.
    Great. Next, I suppose, you'll want to burp her.


  • Registered Users Posts: 446 ✭✭kegan5


    Why bother putting a reply up then The C if all u were gonna do is slag!

    I'm not lazy...simply DIDNT know what form or how to animate in VB!

    In other words I did do a search in google under "Animation in Visual Basic and VB" and all the sites that came up were either too advanced or not what I was looking for so get ur facts straight before you start slagging people!

    Or in turn you could just take a few chill pills!

    :)


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Originally posted by kegan5
    Why bother putting a reply up then The C if all u were gonna do is slag!
    So that you might learn to stand on your own or stop wasting my bandwith. Either is fine with me.
    In other words I did do a search in google under "Animation in Visual Basic and VB" and all the sites that came up were either too advanced or not what I was looking for so get ur facts straight before you start slagging people!
    You did one search on Google and gave up? Or did terms such as 'tutorial' (like you used in your inital post), 'example' or 'simple' not pop into that 'mind' of yours when you STFW'ed?


  • Closed Accounts Posts: 9,314 ✭✭✭Talliesin


    Originally posted by The Corinthian
    Great. Next, I suppose, you'll want to burp her.

    No. I want to give her enough to work out the basic principals. The google link you posted had one applicable page (poorly written) that couldn't be distinguished on the listings from others that were OT, used a control that wasn't applicable, or used Bltting techniques that a scary number of professional VB coders don't know (and many haven't even heard of).

    Bltting is needed for a lot of animation work, but learning the principals of animation and more static uses of Bltting is necessary first steps before you can combine the two.


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Thread... Lock... Please!


  • Closed Accounts Posts: 9,314 ✭✭✭Talliesin


    Nah, I'm gonna leave it for a while for discussion of VB animation.


Advertisement