Results 1 to 4 of 4

Thread: move picture

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Posts
    5
    I try to move 1 picture, in a picturebox to a other place in the same picturebox. Ime looking allready 2 weeks for these resource code. Please, can you help me?

    greeting

    expodium
    beginning vb6

  2. #2
    Junior Member
    Join Date
    Apr 2000
    Posts
    24

    BitBlt

    Try BitBlt. Like this:

    Put this into your general declarations:

    Declare Function BitBlt Lib "gdi32" _
    (ByVal hDestDC As Long, ByVal x As Long, _
    ByVal y As Long, ByVal nWidth As Long, _
    ByVal nHeight As Long, ByVal hSrcDC As _
    Long, ByVal xSrc As Long, ByVal ySrc As _
    Long, ByVal dwRop As Long) As Long

    ' Thats the API call for it



    PictureWithOtherPicsInIt.Cls

    BitBlt PictureWithOtherPicsInIt.hDC, DestinationX, _
    DestinationY, PictureToMove.ScaleHeight, _
    PictureToMove.ScaleWidth, PictureToMove.hDC, _
    (Where in the picture picture one is in relation to X), _
    (Where in the picture picture one is in relation to Y), _
    vbSrcCopy



    That should do it...Sorry if that was a bit confusing.



  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Posts
    5

    one example (if possible)

    the picturebox that i use where the picture ase to be plase called "picdisplay" and the picture in the picturebox called "picdisplaycomponent"

    Is it possible that you have a full but short example for these method. I try it but i dont know what i hafe to do whit the second chapter of the resource code.

    Again, thank's

    Best regards

    van Steenpaal P.
    Belgium (europe)
    beginning vb6

  4. #4
    Junior Member
    Join Date
    Apr 2000
    Posts
    24

    Ok

    Just plug this in:

    Code:
    Declare Function BitBlt Lib "gdi32" _ 
    (ByVal hDestDC As Long, ByVal x As Long, _ 
    ByVal y As Long, ByVal nWidth As Long, _ 
    ByVal nHeight As Long, ByVal hSrcDC As _ 
    Long, ByVal xSrc As Long, ByVal ySrc As _ 
    Long, ByVal dwRop As Long) As Long 
    
    ' Thats the API call for 
    
    BitBlt picdisplaycomponent.hDC, DestinationX, _ 
    DestinationY, picdisplay.ScaleHeight, _ 
    picdisplay.ScaleWidth, picdisplay.hDC, _ 
    SrcX, SrcY, vbSrcCopy 
    ' Destination X and Y are where in the picture 
    ' you are moving it to.
    
    ' picdisplay.scaleheight and width are the width of your pic
    
    ' SrcX and Y are where in the pic 'picdisplay' originated 
    ' from
    I hope that helps...You can read the tutorial here:
    http://www.vb-world.net/graphics/lander/

    If you still can't get it to work just post your source code here and I'll work on it myself.

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