---
title: "How can I insert an Image in RichTextBox using C#?"  
description: "How can I insert an Image in RichTextBox using C#?"  
author: "Kate Smith"  
published: 2013-09-28  
updated: 2013-09-28  
canonical: https://www.mindstick.com/forum/1570/how-can-i-insert-an-image-in-richtextbox-using-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# How can I insert an Image in RichTextBox using C#?

I'm [trying](https://answers.mindstick.com/qa/93698/6-mistakes-couples-are-trying-to-save-money) to [insert](https://www.mindstick.com/blog/173/executing-insert-delete-or-update-query-in-sqlserver-using-ado-dot-net) an [image](https://www.mindstick.com/articles/23551/an-investigate-distinctive-seafood-restaurant-for-your-image-stamp-character) in a richtextbox [control](https://www.mindstick.com/blog/197/asp-dot-net-repeater-control) using C#, but so far I'm only failing.

**This is the [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) 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](https://www.mindstick.com/blog/63804/5-ways-you-can-use-printing-in-your-marketing-strategy) any [picture](https://answers.mindstick.com/qa/38554/name-the-oscar-winning-sound-designer-who-became-the-first-asian-to-win-the-award-for-best-sound-for-documentary-india-s-daughter-at-the-coveted-motion-picture-sound-editors-63rd-annual-golden-reel-awards) but any gives an [error](https://yourviews.mindstick.com/view/88527/fixing-quickbooks-error-4120-reinstalling-vs-repairing) [sound](https://answers.mindstick.com/qa/35122/who-won-an-oscar-award-recently-for-best-sound-mixing) when executed. I have tried the same code with .bmp [images](https://www.mindstick.com/interview/1067/what-is-the-php-predefined-variable-that-tells-the-what-type-of-images-that-php-support), .jpg images and .png images but keep hitting a dead end.

Can anybody help me with this? Please???

Thanks!

## Replies

### Reply by Samuel Fernandes

You can paste below code into your code and call it: place a picture into your project to embedded resource,and call this method passing the richtextbox.

```
    private void createImage(Control item)
    {
        Hashtable image = new Hashtable(1);
        image.Add(item,yourproject.Properties.Resources.yourpicturename);
        Clipboard.SetImage((Image)image[item]);
        ((RichTextBox)item).Paste();
    }
```

\


---

Original Source: https://www.mindstick.com/forum/1570/how-can-i-insert-an-image-in-richtextbox-using-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
