|
-
Apr 5th, 2000, 08:39 PM
#1
Thread Starter
New Member
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
-
Apr 5th, 2000, 08:57 PM
#2
Junior Member
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.
-
Apr 6th, 2000, 01:36 PM
#3
Thread Starter
New Member
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)
-
Apr 6th, 2000, 06:24 PM
#4
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|