Hello everyone. I am working on a tool that lets me write on a picturebox, but it is focused on teaching math to students, and I am trying to integrate a "stamp" of sorts like you might see in some paint brush programs.
I can use the mouse to "draw" ink on the picturebox like this..
But I would like to add clip art that the students are interested in. Perhaps from their favorite cartoons. That way I can use them for showing them how multiplication works. Is there a way that if I were to click on a command button, to have the mouse cursor when clicked on the picturebox, leave a copy of the "stamp". You know what I mean? Thanks!
I can use the mouse to "draw" ink on the picturebox like this..
VB Code:
Private Sub DrawPicture_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) PastePicture.Visible = False PasteResize.Visible = False If SelectionStart = True Then PastePicture.Move XX, YY mSetPicture_Click End If If cmdSelectTool.Value = False Then If Button = vbKeyLButton Then Drawing = True drawpicture.DrawWidth = CInt(BrushSize.Text) 'drawpicture.DrawWidth = PenInkSizeLBL.Caption drawpicture.ForeColor = BrushColor.BackColor drawpicture.PSet (X, Y) End If Else SelectPicture = True End If XX = X YY = Y 'If Button = vbKeyRButton Then PopupMenu mDrawMenu End Sub Private Sub DrawPicture_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) On Error Resume Next If Button = vbKeyLButton Then If Drawing Then drawpicture.PSet (X, Y) drawpicture.Line (XX, YY)-(X, Y), BrushColor.BackColor XX = X YY = Y End If If SelectPicture Then With DrawSelection .Visible = True .Move XX, YY, (X - XX), (Y - YY) End With End If End If End Sub Private Sub DrawPicture_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) Drawing = False SelectPicture = False If XX = X Then If YY = Y Then Exit Sub If cmdSelectTool.Value = True And SelectionStart = False Then PastePicture.Move DrawSelection.Left, DrawSelection.Top, DrawSelection.Width, DrawSelection.Height PasteResize.Move DrawSelection.Left + DrawSelection.Width - PasteResize.Width, DrawSelection.Top + DrawSelection.Height - PasteResize.Height PastePicture.Visible = True PasteResize.Visible = True Picture1.Visible = False Picture1.Left = DrawSelection.Left Picture1.Top = DrawSelection.Top Picture1.Width = DrawSelection.Width Picture1.Height = DrawSelection.Height Picture1.PaintPicture drawpicture.Image, 0, 0, DrawSelection.Width, DrawSelection.Height, DrawSelection.Left, DrawSelection.Top, DrawSelection.Width, DrawSelection.Height Picture1.Picture = Picture1.Image PastePicture.Picture = LoadPicture() PastePicture.Stretch = True DrawSelection.Visible = False Picture1.Visible = False Set PastePicture.Picture = Picture1.Image Picture1.Picture = LoadPicture() With PastePicture drawpicture.PaintPicture Picture1.Image, .Left, .Top, .Width, .Height End With SelectionStart = True Else SelectionStart = False End If End Sub
But I would like to add clip art that the students are interested in. Perhaps from their favorite cartoons. That way I can use them for showing them how multiplication works. Is there a way that if I were to click on a command button, to have the mouse cursor when clicked on the picturebox, leave a copy of the "stamp". You know what I mean? Thanks!