Results 1 to 4 of 4

Thread: Making a "stamp" picture function?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421

    Question 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]

  2. #2
    sunnyl
    Guest
    VB Code:
    1. Option Explicit
    2.  
    3. 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
    4. Private Const SRCCOPY = &HCC0020
    5.  
    6. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    7.    
    8.     If Button = 1 Then
    9.         BitBlt Me.hDC, ScaleX(X, vbTwips, vbPixels), ScaleY(Y, vbTwips, vbPixels), Picture1.Width, Picture1.Height, Picture1.hDC, 0, 0, SRCCOPY
    10.     End If
    11. End Sub

    Have a picturebox on your form with the picture in it.

  3. #3
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    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

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421
    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
  •  



Click Here to Expand Forum to Full Width