i am uploading the image...
i want to make the corner of image rounded ..
i mean, when i upload the image it should display as corners are rounded in shape..
can anybody please tell me...!!
thanx..:)
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Naveed ZamanPosted May 17, 2013, 2:55 PM
and in the last step it will update the table.
string dir = @"C:\tmp";
if (!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
}
openPicFile.RestoreDirectory = true;
this.openPicFile.Title = "Insert an Image";
string path = Directory.GetCurrentDirectory();
this.openPicFile.Filter = "JPEG Images|*.jpg|GIF Images|*.gif|BITMAPS|*.bmp";
this.openPicFile.FileName = "";
path = Chosen_File;
if (Directory.Exists(path))
{
openPicFile.InitialDirectory = path;
}
else
{
openPicFile.InitialDirectory = path;
}
if (openPicFile.ShowDialog() != DialogResult.Cancel)
{
Chosen_File = openPicFile.FileName;
string localpath = @openPicFile.FileName;
Image sourceImage = Image.FromFile(localpath);
Image temp = ScalImage(sourceImage, new Size(2000, 1500));
string filename = "c:\\tmp\\9ee5887-Scaled" + DateTime.Now.Month + DateTime.Now.Day + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second + DateTime.Now.Millisecond + ".jpg";
temp.Save(filename, System.Drawing.Imaging.ImageFormat.Jpeg);
sourceImage.Dispose();
temp.Dispose();
txtFileName.Text = filename;
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
pictureBox1.Image = new Bitmap(Convert.ToString(this.txtFileName.Text));
string strFn = filename;
FileInfo fiImage = new FileInfo(strFn);
this.m_lImageFileLength = fiImage.Length;
FileStream fs = new FileStream(strFn, FileMode.Open, FileAccess.Read, FileShare.Read);
m_barrImg = new byte[Convert.ToInt32(this.m_lImageFileLength)];
int iBytesRead = fs.Read(m_barrImg, 0, Convert.ToInt32(this.m_lImageFileLength));
fs.Close();
}
this.openPicFile.InitialDirectory = path;
and to save it into the database
sqlCommand1.Connection = this.conn;
if (sqlCommand1.Parameters.Count == 0)
{
this.sqlCommand1.CommandText = "update psh.dbo.Call_Received set CRE_FileName = @Picture where cre_patient_id = '" + this.tbpatient.Text + "'";
this.sqlCommand1.Parameters.Add("@Picture", System.Data.SqlDbType.Image);
}
sqlCommand1.Parameters["@Picture"].Value = this.m_barrImg;
sqlCommand1.ExecuteNonQuery();
sqlCommand1.Parameters.Clear();