Results 1 to 2 of 2

Thread: Changing direction of an image!!!

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 1999
    Location
    Leeds,Yorkshire,England
    Posts
    5

    Post

    Hi, I started making a program in VB 5 in which I make an image of a car move around the form, when I turn it left or right it goes in that direction, but the only thing is that the image of the car doesn't change the same way and it looks silly. Can someone please HELP!!!

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Post

    Maybe not the best solution there is:
    Code:
    Option Explicit
    
    
    Private Sub FlipPicture(objPic As PictureBox)
        Dim FlippedPic As StdPicture, bAutoRedraw As Boolean
        With objPic
            bAutoRedraw = .AutoRedraw
            .AutoRedraw = True
            Set FlippedPic = .Image
            Set .Picture = Nothing
            Call .PaintPicture(FlippedPic, 0, 0, .Width, .Height, .Width, 0, -.Width, .Height)
            Set .Picture = .Image
            .AutoRedraw = bAutoRedraw
        End With
    End Sub
    
    
    ' Sample Usage:
    Private Sub Command1_Click()
        Call FlipPicture(Picture1)
    End Sub
    ------------------
    Yonatan
    Teenage Programmer
    E-Mail: [email protected]
    ICQ: 19552879



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