Animations

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • EYE4U
    Banned
    New Member
    • Oct 2008
    • 76

    Animations

    Hi all,
    Do any body know how to resize a control from its center in vb6?

    Like if we do like this in a delayed loop:
    Code:
    image1.width=image1.width+10
    image1.height=imag1.height+10
    It will resize the image to the right side not from the center..

    The second is how to rotate some control on some angle like we can do with the lines..

    Thanx
    ARUZ
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    1. you need to handle the left and right properties as well for resizing from center.
    2. you need to use trigonometric functions SIN & COS for the rotation.

    Comment

    • EYE4U
      Banned
      New Member
      • Oct 2008
      • 76

      #3
      Do Sin and Cos functions can be applied on an image control?????

      I dont think so?

      Comment

      • vdraceil
        New Member
        • Jul 2007
        • 236

        #4
        Try this....


        'get center coordinates in x and y initially
        y=image1.top+(i mage1.height/2)
        x=image1.left+( mage1.width/2)
        'change dimensions
        image1.width=ne wwidth
        image1.height=n ewheight
        'set position so that center is same
        image1.left=y-(image1.width/2)
        image1.top=x-(inage1.height/2)

        Comment

        • vdraceil
          New Member
          • Jul 2007
          • 236

          #5
          i too dont think we can use SIN and COS for an image control..to rotate an image we have to extract every pixel color data..

          Comment

          • EYE4U
            Banned
            New Member
            • Oct 2008
            • 76

            #6
            Actually i m trying to make animation like Bounce. On mouse up it bounces up and again bounces down.

            Any Example will helpfull..

            Comment

            • vdraceil
              New Member
              • Jul 2007
              • 236

              #7
              For a ball bounce animation,you can just change the top property of the ball picture gradually in a timer...increas e top property to make the ball move down and decrease it to make the ball move up.Do not change the left property of the picture.
              You can also add elastic effect to the ball by reducing the height of the picture exactly at the moment when the ball reaches bottom position of bouncing.

              Comment

              • EYE4U
                Banned
                New Member
                • Oct 2008
                • 76

                #8
                If you have experienced rocket dock or object dock there is an zoom effect i want the exactly thing but with out smooth animation..

                The anim you are saying is different...

                Thanx

                Comment

                Working...