Results 1 to 2 of 2

Thread: Move Picture

  1. #1

    Thread Starter
    Hyperactive Member Matt-D's Avatar
    Join Date
    Nov 1999
    Location
    Mettmann, Germany
    Posts
    305

    Post

    English:
    I want that I can move a picture (which is bigger than the screen) by pressing the right mouse-button and moving the mouse.
    Is this possible ?
    (VB 3, but normally this doesn't matter. I've also VB6, but for this Program I Use VB3)

    Deutsch:
    Ich möchte, daß ich ein Bild, das größer als der Bildschirm ist, mit der rechten Maustaste bewegen kann (wie in "Die Sidler"). Ist das möglich in VB3 ?

  2. #2
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Cleveland, Ohio
    Posts
    263

    Post

    Well I would answer you in Deutsch, but I've only learned 2 years worth, and I don't think that's enough for me to form a coherent sentence for you

    Well, there's several ways about doing this.

    1.) You could just have a picturebox within a picturebox that moves around.
    2.) You could use the paintpicture method to recursivly redraw the picture to the new coordinates.
    3. Faster than 2, but same idea, use bitblt to move redraw the picture.

    Well, no matter how you do it, you're going to be using a picturebox's mousemove event.

    It should be something like this:

    If button = 2 Then
    Picture1.PaintPicture Picture1.Picture, X, Y
    End If

    You'll have to do that math to prevent the picture from being drawn so that it might not fill the picturebox completely (What I mean is, if I dragged the upper-left corner of the picture down to the bottom-right corner, this shouldn't be allowed because then you'd see the blank back of the picture box.)

    I hope this helps. Guten Tag!

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