F
Fritz Switzer
With two controls a PictureBox and another "PictureBox like" , Pic2, a
control from a dll, I'm stuck on cannot implicity convert
System.Drawing.Image to System.Drawing.Bitmap error.
How do I convert the following code so that the Pic2 can accept the Image
from the stream where it wants Picture property not and Image property.
Here is a snippet, I'm trying to avoid writing to disk.:
Image i = Pic1.Image;
MemoryStream ms = new MemoryStream();
i.Save(ms, ImageFormat.Jpeg); // need to save in jpeg for Pic2
//Read from MemoryStream into Byte array.
Byte[] bytBLOBData = new Byte[ms.Length];
ms.Position = 0;
ms.Read(bytBLOBData, 0, Convert.ToInt32(ms.Length));
Pic2.Picture = Image.FromStream(ms); // this is the line throwing the
"cannot convert System.Drawing.Image to System.Drawing.Bitmap
Thanks any help would be appreciated,
control from a dll, I'm stuck on cannot implicity convert
System.Drawing.Image to System.Drawing.Bitmap error.
How do I convert the following code so that the Pic2 can accept the Image
from the stream where it wants Picture property not and Image property.
Here is a snippet, I'm trying to avoid writing to disk.:
Image i = Pic1.Image;
MemoryStream ms = new MemoryStream();
i.Save(ms, ImageFormat.Jpeg); // need to save in jpeg for Pic2
//Read from MemoryStream into Byte array.
Byte[] bytBLOBData = new Byte[ms.Length];
ms.Position = 0;
ms.Read(bytBLOBData, 0, Convert.ToInt32(ms.Length));
Pic2.Picture = Image.FromStream(ms); // this is the line throwing the
"cannot convert System.Drawing.Image to System.Drawing.Bitmap
Thanks any help would be appreciated,