Users Pricing

forum

home / developersection / forums / how can i insert an image in richtextbox using c#?

How can I insert an Image in RichTextBox using C#?

Kate Smith 11264 28 Sep 2013

I'm trying to insert an image in a richtextbox control using C#, but so far I'm only failing.

This is the code that I am using:

DataFormats.Format _dataFormat = DataFormats.GetFormat(DataFormats.Bitmap);

Clipboard.SetImage(Image.FromFile(Application.StartupPath + @"\Images\" + i + ".bmp"));

chat.Paste(_dataFormat);


The code is not printing any picture but any gives an error sound when executed. I have tried the same code with .bmp images, .jpg images and .png images but keep hitting a dead end.

Can anybody help me with this? Please???

Thanks!


Kate Smith

Other


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md