Image Table
CREATE TABLE [dbo].[Image_Table]
(
[Img_ID] [bigint] IDENTITY(1,1) NOT NULL,
[Image_Name] [image] NULL,
)
How To Convert Byte Array To Image
When you want to take image from database.It must change byte array to image to show it.
The next function convert byte array to image :
public Image byteArrayToImage(byte[] bArray)
{
MemoryStream ms = new MemoryStream(bArray);
Image Img = Image.FromStream(ms);
return Img;
}
How To Show Image
call the function:
pictureBox1.Image=byteArrayToImage((byte[])dr["Image_Name"]);
dr["Image_Name"]: is a data reader .it takes values from database.
9 Aug 2009
Convert ByteArray To Image
Posted by
Hayfa
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment