Animation/pictures - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Animation/pictures

siskomikesiskomike Posts: 88Member
Hey, i'm using a student version of visual basic 6.0. How can i make smooth animation, ex. moving a picture across the screen without it flickering?

here is some general code i use to do movement = FLICKERING:(

Private Sub tmrMove_Timer()
Image1.Left = Image1.Left + 10
End Sub

Private Sub cmdMove_Click()
Image1.Left = Image1.Left + 10
End Sub

Is there something better i could use for more fluid motion/animation? thnx for any help, Mike

Comments

  • lionblionb Posts: 1,688Member ✭✭
    [b][red]This message was edited by lionb at 2006-2-15 9:8:35[/red][/b][hr]
    Is there something better i could use for more fluid motion/animation? thnx for any help, Mike
    :
    Try to use Picture instead of Image



  • siskomikesiskomike Posts: 88Member
    [b][red]This message was edited by siskomike at 2006-2-16 19:5:1[/red][/b][hr]

  • dokken2dokken2 Posts: 532Member
    : Hey, i'm using a student version of visual basic 6.0. How can i make smooth animation, ex. moving a picture across the screen without it flickering?
    :
    : here is some general code i use to do movement = FLICKERING:(
    :
    : Private Sub tmrMove_Timer()
    : Image1.Left = Image1.Left + 10
    : End Sub
    :
    : Private Sub cmdMove_Click()
    : Image1.Left = Image1.Left + 10
    : End Sub
    :
    : Is there something better i could use for more fluid motion/animation? thnx for any help, Mike
    :

    Although I have not used it, VB6 help indicates there is a "Sprite control" which may offer what you need.

  • Mike_AB1Mike_AB1 Posts: 49Member
    : : [b][red]This message was edited by lionb at 2006-2-15 9:8:35[/red][/b][hr]
    : : Is there something better i could use for more fluid motion/animation? thnx for any help, Mike
    : : :
    : : Try to use Picture instead of Image
    : :
    : :
    : :
    : :
    : That doesnt make much of a difference if any
    :

    I tried to use PaintPicture - it worked better if 'Autoredraw' property of the form is 'True'

    My timer interval was 40 ms

    Put to the declaration:
    Dim oPic As StdPicture
    Dim lCounter As Long

    Private Sub Form_Load()
    Set oPic = LoadPicture("c:MyFolderMyPicture.jpg")
    End Sub

    Private Sub Timer1_Timer()
    lCounter = lCounter + 15
    If lCounter > Form1.Width Then lCounter = 0
    Call Form1.Cls
    Call Form1.PaintPicture(oPic, lCounter, 100)
    End Sub


    Mike
  • lionblionb Posts: 1,688Member ✭✭
    [b][red]This message was edited by lionb at 2006-2-16 8:51:42[/red][/b][hr]
    : : [b][red]This message was edited by lionb at 2006-2-15 9:8:35[/red][/b][hr]
    : : Is there something better i could use for more fluid motion/animation? thnx for any help, Mike
    : : :
    : : Try to use Picture instead of Image
    : :
    : That doesnt make much of a difference if any
    :
    It does work better on my machine. I am not expert in this field but I do know that image/picture control flickering is the open issue of VB 6. I think this issue has been never resolved/closed and it's not going to be. VB 6 practically gone ...


Sign In or Register to comment.