chandua
asked on
Control to load a JPG file - Binary stream
Hi,
is there any control which can load a jpg file by passing the Binary stream.
pls let me know asap.
thanks.
is there any control which can load a jpg file by passing the Binary stream.
pls let me know asap.
thanks.
ASKER
hi TAD,
i am creating a Webpart (SPS 2003), i cant have a picture box in it.
i am creating a Webpart (SPS 2003), i cant have a picture box in it.
ASKER
hi TAD,
i am trying to get the stream from database
string sqlText = "SELECT img_data FROM Image WHERE img_pk = " + ImageId;
SqlConnection connection = new SqlConnection( ConfigurationSettings.AppS ettings["D SN"].ToStr ing() );
SqlCommand command = new SqlCommand( sqlText, connection);
//open the database and get a datareader
connection.Open();
SqlDataReader dr = command.ExecuteReader();
if ( dr.Read()) //found image
{
pictureBox1.Image=Image.Fr omStream(( byte[]) dr["img_data"]);
}
i cant pass the dr["img_data"].. how do i convert to straeam/
i am trying to get the stream from database
string sqlText = "SELECT img_data FROM Image WHERE img_pk = " + ImageId;
SqlConnection connection = new SqlConnection( ConfigurationSettings.AppS
SqlCommand command = new SqlCommand( sqlText, connection);
//open the database and get a datareader
connection.Open();
SqlDataReader dr = command.ExecuteReader();
if ( dr.Read()) //found image
{
pictureBox1.Image=Image.Fr
}
i cant pass the dr["img_data"].. how do i convert to straeam/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No, but you can load an image object from a stream and then drop that Image onto a picturebox.
it will look something like this:
picturebox1.Image = Image.FromStream(myBinaryS