|
-
Oct 8th, 2001, 07:53 PM
#1
Thread Starter
Hyperactive Member
Making a "stamp" picture function?
How could I make a function that, where you click, it makes a "stamp" kind of thing and places the picture where you clicked? For example, let's say I wanted to make a collage of the same picture... so I start clicking all over the form, and where I clicked, it will leave the picture, even if it overlaps another one. I need to know how to do this without using a bunch of image controls; I just pick one picture and start clicking. BitBlt has something to do with it I'm sure. Thanks.
[vbcode]
' comment
Rem remark
[/vbcode]
-
Oct 8th, 2001, 07:59 PM
#2
VB Code:
Option Explicit
Private 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
Private Const SRCCOPY = &HCC0020
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
BitBlt Me.hDC, ScaleX(X, vbTwips, vbPixels), ScaleY(Y, vbTwips, vbPixels), Picture1.Width, Picture1.Height, Picture1.hDC, 0, 0, SRCCOPY
End If
End Sub
Have a picturebox on your form with the picture in it.
-
Oct 8th, 2001, 08:00 PM
#3
PowerPoster
Or..
Code:
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.PaintPicture Picture1.Picture, X, Y
End Sub
-
Oct 8th, 2001, 08:05 PM
#4
Thread Starter
Hyperactive Member
Oh my god, why didn't I know that (As I smack myself)? Brain fart I guess... thanks.
[vbcode]
' comment
Rem remark
[/vbcode]
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
|