Results 1 to 2 of 2

Thread: rotating images

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2000
    Posts
    35

    Unhappy

    Hi, i recently posted this in the games forum but im not sure if anyone is in there...

    Currently I have a screen with a image i want to have controlled by the keyboard..the basic image.left = etc. but the image stays in the same position and only moves up down left or right...i needed to know if there was any way to where i can have it so...left and right rotate it accordingly and up and down control whether it moves forwards or backwards? Also, how do you make it so once its out of the screen, it loops around to the other side? thanx in advance.
    "..Follow the white rabbit.."

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Read this tip on rotating bitmaps. The problem is that you can't use it on a Image control because you can't draw on one.
    I would say that the easiest way is to make the different pictures yourself and add them into a ImageList and then swap the picture in the image control.
    To "loop" the image to the other side of the screen is pretty straitforward:
    Code:
    If Image1.Left > Me.ScaleWidth Then
        Image1.Left = -Image1.Width
    ElseIf Image1.Left < -Image1.Width Then
        Image1.Left = Me.ScaleWidth
    ElseIf Image1.Top < -Image1.Height Then
        Image1.Top = Me.ScaleHeight
    ElseIf Image1.Top > Me.ScaleHeight Then
        Image1.Top = -Image1.Height
    End If
    Good luck!

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