Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. picture problems in wpf

picture problems in wpf

Scheduled Pinned Locked Moved XML / XSL
csharpquestionwpf
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    angels777
    wrote on last edited by
    #1

    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....

    S 1 Reply Last reply
    0
    • A angels777

      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....

      S Offline
      S Offline
      Scott Dorman
      wrote on last edited by
      #2

      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 the Image control and set the Source 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]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups