Dear All
I added below code onto Photo Load Click Event. Photo is added but Size is not Actual. So, How to fixed size. I am managing Path but How to retrieve Image from Database.
string path = null;
OpenFileDialog fileDialog = new OpenFileDialog();
fileDialog.ShowDialog();
path = fileDialog.FileName;
txtPhotoID.Text = path;
PictureBox picBox = new PictureBox();
picBox.Image = new Bitmap(fileDialog.FileName);
picImage.Controls.Add(picBox);
picBox.Height = 300;
picBox.Width = 400;
picBox.BackgroundImageLayout = ImageLayout.Zoom;
OpenFileDialog fileDialog = new OpenFileDialog();
fileDialog.ShowDialog();
path = fileDialog.FileName;
txtPhotoID.Text = path;
PictureBox picBox = new PictureBox();
picBox.Image = new Bitmap(fileDialog.FileName);
picImage.Controls.Add(picBox);
picBox.Height = 300;
picBox.Width = 400;
picBox.BackgroundImageLayout = ImageLayout.Zoom;
PRASANTA BISWASPosted Aug 18, 2014, 9:17 AM
thanks for reply. Actually I declared in database PhotoID as NVARCHAR(100). Because I am Saving Only Path. So How would I show.
Need your Help.
Abhijit PatilPosted Aug 18, 2014, 6:42 AM
there is no need to set size to picturebox used the property of picturebox sizemode="Strech"
it is automatically set in size.
for upload the image write the following code in the upload button click
for fetch images from the database
decalre the
byte[] data;
and write the following code for get image from database and show in picturebox
hope it helps
Ankur JainPosted Aug 18, 2014, 6:11 AM
see below thread...
http://www.msdotnet.co.in/2014/04/how-to-save-image-in-database-and.html#.U_HRJfmSzcg
Dipankar BiswasPosted Aug 18, 2014, 6:05 AM