To get an image into a RichText box, the simple way is to use the Clipboard to copy to the image into and then paste the image into the RichTextBox.
Below is quick sample of how to do this.. Dim anImage As Image = Image.FromStream(theItemData.Data)
Clipboard.SetDataObject(anImage)
Dim theImageStream As New MemoryStream
anImage.Save(theImageStream, ImageFormat.Bmp)
summaryReportDetails.SelectionIndent = 30
Dim MyFormat As DataFormats.Format = DataFormats.GetFormat(DataFormats.Bitmap)
If theRichTextBox.CanPaste(MyFormat) Then
summaryReportDetails.Paste(MyFormat)
End If
anImage.Dispose()

No comments yet
Comments feed for this article