string instrPic = comboBox1.SelectedItem.ToString();
SqlConnection roy1 = new SqlConnection(@"server=CAPTSISKO-PC\SQLEXPRESS;Initial Catalog=cable;Integrated Security=True");
roy1.Open();
string newPic = "Select Pic from guidePic WHERE picTitle = '" + instrPic + "'";
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(newPic, roy1);
da.Fill(ds, "newPic");
dataGridView1.DataSource = ds;
dataGridView1.DataMember = "newPic";
int c = ds.Tables["newPic"].Rows.Count;
if(c >0)
{
Byte[] byteRoy = new Byte[0];
byteRoy = (Byte[])(ds.Tables["newPic"].Rows[c - 1]["Pic"]);
MemoryStream stimRoy = new MemoryStream(byteRoy);
pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
pictureBox1.Image = Image.FromStream(stimRoy);
Hello, do you have any topics that cover binary images , the code I am showing does what it suppose to do but the image is too big and the view shows the picture sideways, can I manipulate the image before it is viewed in the picturebox or do you have a tutorial on binary images that can be resize or rotated to fit the picturebox.

New Topic/Question
Reply




MultiQuote




|