RichTextBox and Images

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2007
Posts: 4
Reputation: haroldjclements is an unknown quantity at this point 
Solved Threads: 0
haroldjclements haroldjclements is offline Offline
Newbie Poster

RichTextBox and Images

 
0
  #1
Apr 8th, 2009
I have a RichTextBox that I wish to copy an image to. I have created a Control that inherits from RichTextBox. It appears that my image is not able to be pasted but I am unsure why? If I break into the code, b has the correct size of the image.

Below is my code:
  1. //Bitmap b = new System.Drawing.Bitmap(global::xxxxxx.xxxxxxx.Properties.Resources.logo2);
  2.  
  3. Bitmap b = new Bitmap(@"d:\file.bmp");
  4.  
  5. Clipboard.SetDataObject(b);
  6. DataFormats.Format f = DataFormats.GetFormat(DataFormats.Bitmap);
  7.  
  8. if (CanPaste(f))
  9. {
  10. Paste(f);
  11. }
  12. //paste(f);
Any help will be gratefully received.

Kind Regards,
Harold Clements
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: RichTextBox and Images

 
0
  #2
Apr 9th, 2009
How did you admit the your control works well? maybe the problem in your control.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC