picture problems in wpf
-
hi i used to use c# to display my uploaded picture
if (openFileDialog_select_picture.ShowDialog() == DialogResult.OK) { pictureBox_contact.Image = Image.FromFile(openFileDialog_select_picture.FileName); pictureBox_contact.SizeMode = PictureBoxSizeMode.CenterImage; pictureBox_contact.BorderStyle = BorderStyle.Fixed3D; }
but how do i do that in wpf.. ? i cant do pictureBox.Image or .SizeMode.... -
hi i used to use c# to display my uploaded picture
if (openFileDialog_select_picture.ShowDialog() == DialogResult.OK) { pictureBox_contact.Image = Image.FromFile(openFileDialog_select_picture.FileName); pictureBox_contact.SizeMode = PictureBoxSizeMode.CenterImage; pictureBox_contact.BorderStyle = BorderStyle.Fixed3D; }
but how do i do that in wpf.. ? i cant do pictureBox.Image or .SizeMode....You will probably have better luck asking this in the C# forum. Even though WPF uses an XML dialect (XAML) this really isn't an XML question per se. WPF doesn't have a
PictureBox
control, instead you need to use theImage
control and set theSource
property. Take a look at this blog post[^] for more information.Scott. —In just two days, tomorrow will be yesterday. —Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[Forum Guidelines] [Articles] [Blog]