I also use the paste method, but I don't do any size checking
or resizing of the picture. (Which the real pros probably do.)
Anyway, my RTB pasted pictures show the dots around the
corners when selected, but I am unable to resize them with
the mouse. The code I use to put in the picture looks like this:
Private Sub insertpicture()
Dim picture As Image = Nothing
Dim ofd As New OpenFileDialog
ofd.Filter = "Image Files(*.BMP;*.JPG;*.GIF;*.TIF)|*.BMP;*.JPG;*.GIF;*.TIF"
ofd.Multiselect = False
If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
Try
picture = Image.FromFile(ofd.FileName)
Catch ex As Exception
MsgBox( "Error opening file > " & ofd.FileName)
Exit Sub
End Try
Else
Exit Sub
End If
Clipboard.Clear()
Clipboard.SetImage(picture)
Do While Clipboard.ContainsImage = False
Loop
RichTextBox1.Paste()
End Sub
|