RichTextboxex, Images and SQL

psgeorge

New member
Joined
Apr 13, 2015
Messages
1
Programming Experience
10+
Hello,


I have a question about RichTextbox and images. I have a windows application which contains a RichTextbox. I can type text into the box and thenusing the "Print Screen" button on the PC's keyboard, capture a screen (or active window) image to the clipboard and paste it into the RicTextbox according to where the cursor is placed within the RichTextbox. Actually, I can paste several images into the RichTextbox without problem. My intent is to save the contents of the RichTextbox to a SQL table with a field of data type "image" or "varbinary(MAX)". I do NOT want to save the contents as a file. The intent would be to bring back the field at a later time to some other RichTextbox and have both the text and images displayed as were entered.


If required, I will encode the contents of the RichTextbox to a byte array. The problem is that when I examine the contents of the RichTextbox which is displaying the entered text and images, only the text is shown. My question is... Where are the images stored? If they are stored seperately in some metavariable, do I need to store the text and image seperately? Obviously, this is doable... MS Word and other applications do this. I simply have not been able to find any examples or any information describing how this is done.


Any help or information would be most appreciated!


Paul George
 
All content in RichTextBox is stored as rich text format, this is specially formatted plain text and is available from its Rtf property.
 
Back
Top