Hi,
My database have Image Type Data. its not support on my richedit control. but its support Byte[] formate. now My Richedit control image data will show like this
System.Drawing.Bitmap
its show me image formate text only. it doesnt show me the image. so i'm trying to convert it through coding. But i couldn't Help me plz
Code:
DocumentImageCollection imags = richEditControl1.Document.GetImages(richEditControl1.Document.Range);
for (int i = 0; i < imags.Count; i++)
{
byte[] Imgdata = File.ReadAllBytes(imags[i].Image.ToString());
if (imags.Count > i)
if (documentImage != null)
{
Image s = new Bitmap(Imgdata.ToString());
}
richEditControl1.Document.InsertPicture(richEditControl1.Document.CaretPosition, (Image)documentImage);
DocumentImageCollection images = richEditControl1.Document.GetImages(richEditControl1.Document.Range);
for (int i = 0; i <= images.Count - 1; i++) {
Image newImage = images(i).Image.NativeImage.GetThumbnailImage(100, 100, null, IntPtr.Zero);
DocumentPosition start = images(i).Range.Start;
richEditControl1.Document.Delete(images(i).Range);
richEditControl1.Document.InsertImage(start, newImage);
}
I run this code i got exception under images(i).
Method,Delegate,Event Expected.
I tried multiple way. but i'm unable to achieve my goal.